diff --git a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch index f39cc259f..826d96b12 100644 --- a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch @@ -1,5 +1,14 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenBase.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenBase.java +@@ -70,7 +70,7 @@ + protected static final WorldGenTrees worldGeneratorTrees = new WorldGenTrees(false); + protected static final WorldGenBigTree worldGeneratorBigTree = new WorldGenBigTree(false); + protected static final WorldGenSwamp worldGeneratorSwamp = new WorldGenSwamp(); +- public static final RegistryNamespaced field_185377_q = new RegistryNamespaced(); ++ public static final RegistryNamespaced field_185377_q = net.minecraftforge.fml.common.registry.GameData.getBiomeRegistry(); + private final String biomeName; + private final float minHeight; + private final float maxHeight; @@ -128,11 +128,12 @@ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); diff --git a/src/main/java/net/minecraftforge/fml/common/registry/GameData.java b/src/main/java/net/minecraftforge/fml/common/registry/GameData.java index 525f9cde5..54715ed98 100644 --- a/src/main/java/net/minecraftforge/fml/common/registry/GameData.java +++ b/src/main/java/net/minecraftforge/fml/common/registry/GameData.java @@ -21,6 +21,8 @@ import net.minecraft.item.ItemBlock; import net.minecraft.potion.Potion; import net.minecraft.util.ObjectIntIdentityMap; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.registry.RegistryNamespaced; +import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.fml.common.FMLLog; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.ModContainer; @@ -36,6 +38,8 @@ public class GameData static final int MAX_ITEM_ID = 31999; public static final int MIN_POTION_ID = 0; // 0-~31 are vanilla, forge start at 32 public static final int MAX_POTION_ID = 255; // S1DPacketEntityEffect sends bytes, we can only use 255 + public static final int MIN_BIOME_ID = 0; // 0-~31 are vanilla, forge start at 32 + public static final int MAX_BIOME_ID = 255; // S1DPacketEntityEffect sends bytes, we can only use 255 private static final GameData mainData = new GameData(); // public api @@ -69,6 +73,8 @@ public class GameData return getMain().iPotionRegistry; } + public static FMLControlledNamespacedRegistry getBiomeRegistry() { return getMain().iBiomeRegistry; } + /*************************************************** * INTERNAL CODE FROM HERE ON DO NOT USE! @@ -114,6 +120,7 @@ public class GameData private final FMLControlledNamespacedRegistry iBlockRegistry = PersistentRegistryManager.createRegistry(PersistentRegistryManager.BLOCKS, Block.class, new ResourceLocation("minecraft:air"), MAX_BLOCK_ID, MIN_BLOCK_ID, true, BlockStateCapture.INSTANCE); private final FMLControlledNamespacedRegistry iItemRegistry = PersistentRegistryManager.createRegistry(PersistentRegistryManager.ITEMS, Item.class, null, MAX_ITEM_ID, MIN_ITEM_ID, true, ItemBlockCapture.INSTANCE); private final FMLControlledNamespacedRegistry iPotionRegistry = PersistentRegistryManager.createRegistry(PersistentRegistryManager.POTIONS, Potion.class, null, MAX_POTION_ID, MIN_POTION_ID, false, PotionArrayCapture.INSTANCE); + private final FMLControlledNamespacedRegistry iBiomeRegistry = PersistentRegistryManager.createRegistry(PersistentRegistryManager.BIOMES, BiomeGenBase.class, null, MAX_BIOME_ID, MIN_BIOME_ID, false, BiomeCapture.INSTANCE); int registerItem(Item item, String name) // from GameRegistry { @@ -257,4 +264,13 @@ public class GameData // no op for the minute? } } + private static class BiomeCapture implements FMLControlledNamespacedRegistry.AddCallback + { + static final BiomeCapture INSTANCE = new BiomeCapture(); + + @Override + public void onAdd(BiomeGenBase potion, int id) { + // no op for the minute? + } + } } \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/fml/common/registry/PersistentRegistryManager.java b/src/main/java/net/minecraftforge/fml/common/registry/PersistentRegistryManager.java index 379e298f5..c87476d03 100644 --- a/src/main/java/net/minecraftforge/fml/common/registry/PersistentRegistryManager.java +++ b/src/main/java/net/minecraftforge/fml/common/registry/PersistentRegistryManager.java @@ -129,6 +129,7 @@ public class PersistentRegistryManager public static final ResourceLocation BLOCKS = new ResourceLocation("minecraft:blocks"); public static final ResourceLocation ITEMS = new ResourceLocation("minecraft:items"); public static final ResourceLocation POTIONS = new ResourceLocation("minecraft:potions"); + public static final ResourceLocation BIOMES = new ResourceLocation("minecraft:biomes"); public static FMLControlledNamespacedRegistry createRegistry(ResourceLocation registryName, Class registryType, ResourceLocation optionalDefaultKey, int maxId, int minId, boolean hasDelegates, FMLControlledNamespacedRegistry.AddCallback addCallback) {