mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes: Almost all int x, int y, int z parameters have been changed to BlockPos class ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing. All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it. Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated. As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format. Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata. Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
This commit is contained in:
1 parent
0e91787efb
commit
53659fca06
410 files changed
+8717
-14103
No files matched your search
@@ -19,23 +19,11 @@ import net.minecraftforge.common.util.EnumHelper;
|
||||
public class BiomeManager
|
||||
{
|
||||
private static TrackedList<BiomeEntry>[] biomes = setupBiomes();
|
||||
|
||||
/*
|
||||
* These lists should no longer be accessed directly. Instead, use the appropriate add, remove and get methods within this class.
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<BiomeEntry> desertBiomes = biomes[BiomeType.DESERT.ordinal()];
|
||||
@Deprecated
|
||||
public static List<BiomeEntry> warmBiomes = biomes[BiomeType.WARM.ordinal()];
|
||||
@Deprecated
|
||||
public static List<BiomeEntry> coolBiomes = biomes[BiomeType.COOL.ordinal()];
|
||||
@Deprecated
|
||||
public static List<BiomeEntry> icyBiomes = biomes[BiomeType.ICY.ordinal()];
|
||||
|
||||
|
||||
private static boolean isModded = false;
|
||||
|
||||
|
||||
public static List<BiomeGenBase> oceanBiomes = new ArrayList<BiomeGenBase>();
|
||||
|
||||
|
||||
public static ArrayList<BiomeGenBase> strongHoldBiomes = new ArrayList<BiomeGenBase>();
|
||||
public static ArrayList<BiomeGenBase> strongHoldBiomesBlackList = new ArrayList<BiomeGenBase>();
|
||||
|
||||
@@ -45,19 +33,19 @@ public class BiomeManager
|
||||
oceanBiomes.add(BiomeGenBase.deepOcean);
|
||||
oceanBiomes.add(BiomeGenBase.frozenOcean);
|
||||
}
|
||||
|
||||
|
||||
private static TrackedList<BiomeEntry>[] setupBiomes()
|
||||
{
|
||||
TrackedList<BiomeEntry>[] currentBiomes = new TrackedList[BiomeType.values().length];
|
||||
List list = new ArrayList();
|
||||
|
||||
|
||||
list.add(new BiomeEntry(BiomeGenBase.forest, 10));
|
||||
list.add(new BiomeEntry(BiomeGenBase.roofedForest, 10));
|
||||
list.add(new BiomeEntry(BiomeGenBase.extremeHills, 10));
|
||||
list.add(new BiomeEntry(BiomeGenBase.plains, 10));
|
||||
list.add(new BiomeEntry(BiomeGenBase.birchForest, 10));
|
||||
list.add(new BiomeEntry(BiomeGenBase.swampland, 10));
|
||||
|
||||
|
||||
currentBiomes[BiomeType.WARM.ordinal()] = new TrackedList(list);
|
||||
list.clear();
|
||||
|
||||
@@ -65,7 +53,7 @@ public class BiomeManager
|
||||
list.add(new BiomeEntry(BiomeGenBase.extremeHills, 10));
|
||||
list.add(new BiomeEntry(BiomeGenBase.taiga, 10));
|
||||
list.add(new BiomeEntry(BiomeGenBase.plains, 10));
|
||||
|
||||
|
||||
currentBiomes[BiomeType.COOL.ordinal()] = new TrackedList(list);
|
||||
list.clear();
|
||||
|
||||
@@ -74,9 +62,9 @@ public class BiomeManager
|
||||
|
||||
currentBiomes[BiomeType.ICY.ordinal()] = new TrackedList(list);
|
||||
list.clear();
|
||||
|
||||
|
||||
currentBiomes[BiomeType.DESERT.ordinal()] = new TrackedList(list);
|
||||
|
||||
|
||||
return currentBiomes;
|
||||
}
|
||||
|
||||
@@ -133,67 +121,67 @@ public class BiomeManager
|
||||
WorldChunkManager.allowedBiomes.remove(biome);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void addBiome(BiomeType type, BiomeEntry entry)
|
||||
{
|
||||
isModded = true;
|
||||
|
||||
|
||||
int idx = type.ordinal();
|
||||
List<BiomeEntry> list = idx > biomes.length ? null : biomes[idx];
|
||||
if (list != null) list.add(entry);
|
||||
}
|
||||
|
||||
|
||||
public static void removeBiome(BiomeType type, BiomeEntry entry)
|
||||
{
|
||||
isModded = true;
|
||||
|
||||
|
||||
int idx = type.ordinal();
|
||||
List<BiomeEntry> list = idx > biomes.length ? null : biomes[idx];
|
||||
|
||||
|
||||
if (list != null && list.contains(entry))
|
||||
{
|
||||
list.remove(entry);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static ImmutableList<BiomeEntry> getBiomes(BiomeType type)
|
||||
{
|
||||
int idx = type.ordinal();
|
||||
List<BiomeEntry> list = idx > biomes.length ? null : biomes[idx];
|
||||
|
||||
|
||||
return list != null ? ImmutableList.copyOf(list) : null;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isTypeListModded(BiomeType type)
|
||||
{
|
||||
int idx = type.ordinal();
|
||||
TrackedList<BiomeEntry> list = idx > biomes.length ? null : biomes[idx];
|
||||
|
||||
|
||||
if (list != null) return list.isModded();
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static enum BiomeType
|
||||
{
|
||||
DESERT, WARM, COOL, ICY;
|
||||
|
||||
|
||||
public static BiomeType getType(String name)
|
||||
{
|
||||
name = name.toUpperCase();
|
||||
|
||||
|
||||
for (BiomeType t : values())
|
||||
{
|
||||
if (t.name().equals(name)) return t;
|
||||
}
|
||||
|
||||
|
||||
BiomeType ret = EnumHelper.addEnum(BiomeType.class, name, BiomeType.class);
|
||||
|
||||
|
||||
if (ret.ordinal() >= biomes.length)
|
||||
{
|
||||
biomes = Arrays.copyOf(biomes, ret.ordinal());
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -201,89 +189,89 @@ public class BiomeManager
|
||||
public static class BiomeEntry extends WeightedRandom.Item
|
||||
{
|
||||
public final BiomeGenBase biome;
|
||||
|
||||
|
||||
public BiomeEntry(BiomeGenBase biome, int weight)
|
||||
{
|
||||
super(weight);
|
||||
|
||||
|
||||
this.biome = biome;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class TrackedList<E> extends ArrayList<E>
|
||||
{
|
||||
private boolean isModded = false;
|
||||
|
||||
public TrackedList(Collection<? extends E> c)
|
||||
|
||||
public TrackedList(Collection<? extends E> c)
|
||||
{
|
||||
super(c);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public E set(int index, E element)
|
||||
public E set(int index, E element)
|
||||
{
|
||||
isModded = true;
|
||||
return super.set(index, element);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean add(E e)
|
||||
public boolean add(E e)
|
||||
{
|
||||
isModded = true;
|
||||
return super.add(e);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void add(int index, E element)
|
||||
public void add(int index, E element)
|
||||
{
|
||||
isModded = true;
|
||||
super.add(index, element);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public E remove(int index)
|
||||
public E remove(int index)
|
||||
{
|
||||
isModded = true;
|
||||
return super.remove(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Object o)
|
||||
public boolean remove(Object o)
|
||||
{
|
||||
isModded = true;
|
||||
return super.remove(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear()
|
||||
public void clear()
|
||||
{
|
||||
isModded = true;
|
||||
super.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addAll(Collection<? extends E> c)
|
||||
public boolean addAll(Collection<? extends E> c)
|
||||
{
|
||||
isModded = true;
|
||||
return super.addAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addAll(int index, Collection<? extends E> c)
|
||||
public boolean addAll(int index, Collection<? extends E> c)
|
||||
{
|
||||
isModded = true;
|
||||
return super.addAll(index, c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAll(Collection<?> c)
|
||||
public boolean removeAll(Collection<?> c)
|
||||
{
|
||||
isModded = true;
|
||||
return super.removeAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean retainAll(Collection<?> c)
|
||||
public boolean retainAll(Collection<?> c)
|
||||
{
|
||||
isModded = true;
|
||||
return super.retainAll(c);
|
||||
|
||||
Reference in new issue
Block a user