diff --git a/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java b/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java index a45a9a3..ec010b1 100644 --- a/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java @@ -75,6 +75,8 @@ this.drawTexturedModalRect(i + 6, j + 7, 0 + l % 8 * 18, 198 + l / 8 * 18, 18, 18); } + potion.renderInventoryEffect(i, j, potioneffect, mc); + if (!potion.shouldRenderInvText(potioneffect)) continue; String s1 = I18n.format(potion.getName(), new Object[0]); if (potioneffect.getAmplifier() == 1) diff --git a/src/main/java/net/minecraft/client/renderer/ItemRenderer.java b/src/main/java/net/minecraft/client/renderer/ItemRenderer.java index 2bc5df3..c88dcb0 100644 --- a/src/main/java/net/minecraft/client/renderer/ItemRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/ItemRenderer.java @@ -547,6 +547,7 @@ if (this.mc.thePlayer.isBurning()) { + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.mc.thePlayer, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.FIRE, Blocks.fire, MathHelper.floor_double(this.mc.thePlayer.posX), MathHelper.floor_double(this.mc.thePlayer.posY), MathHelper.floor_double(this.mc.thePlayer.posZ)))) this.renderFireInFirstPerson(p_78447_1_); } @@ -559,6 +560,7 @@ if (this.mc.theWorld.getBlock(i, j, k).isNormalCube()) { + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.mc.thePlayer, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, block, i, j, k))) this.renderInsideOfBlock(p_78447_1_, block.getBlockTextureFromSide(2)); } else @@ -581,12 +583,14 @@ if (block.getMaterial() != Material.air) { + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.mc.thePlayer, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, block, i, j, k))) this.renderInsideOfBlock(p_78447_1_, block.getBlockTextureFromSide(2)); } } if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) { + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.mc.thePlayer, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.WATER, Blocks.water, MathHelper.floor_double(this.mc.thePlayer.posX), MathHelper.floor_double(this.mc.thePlayer.posY), MathHelper.floor_double(this.mc.thePlayer.posZ)))) this.renderWarpedTextureOverlay(p_78447_1_); } diff --git a/src/main/java/net/minecraft/potion/Potion.java b/src/main/java/net/minecraft/potion/Potion.java index f1ba611..46a36e3 100644 --- a/src/main/java/net/minecraft/potion/Potion.java +++ b/src/main/java/net/minecraft/potion/Potion.java @@ -307,4 +307,27 @@ { return p_111183_2_.getAmount() * (double)(p_111183_1_ + 1); } + + /* ======================================== FORGE START =====================================*/ + + /** + * If the standard PotionEffect text (name and duration) should be drawn when this potion is active. + * @param effect the active PotionEffect + * @return true to draw the standard text + */ + public boolean shouldRenderInvText(PotionEffect effect) + { + return true; + } + + /** + * Called to draw the this Potion onto the player's inventory when it's active. + * This can be used to e.g. render Potion icons from your own texture. + * @param x the x coordinate + * @param y the y coordinate + * @param effect the active PotionEffect + * @param mc the Minecraft instance, for convenience + */ + @SideOnly(Side.CLIENT) + public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) { } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenHills.java b/src/main/java/net/minecraft/world/biome/BiomeGenHills.java index 337d102..badd912 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenHills.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenHills.java @@ -55,7 +55,7 @@ j1 = p_76728_2_.nextInt(28) + 4; int k1 = p_76728_4_ + p_76728_2_.nextInt(16); - if (p_76728_1_.getBlock(i1, j1, k1) == Blocks.stone) + if (p_76728_1_.getBlock(i1, j1, k1).isReplaceableOreGen(p_76728_1_, i1, j1, k1, Blocks.stone)) { p_76728_1_.setBlock(i1, j1, k1, Blocks.emerald_ore, 0, 2); } diff --git a/src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java b/src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java index b30aa55..111c8ab 100644 --- a/src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java +++ b/src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java @@ -125,9 +125,14 @@ } } + @Deprecated // Supply metadata to the below function. public void func_147421_b(int p_147421_1_, int p_147421_2_, Block[] p_147421_3_, BiomeGenBase[] p_147421_4_) { - ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147421_1_, p_147421_2_, p_147421_3_, p_147421_4_); + replaceBiomeBlocks(p_147421_1_, p_147421_2_, p_147421_3_, p_147421_4_, new byte[p_147421_3_.length]); + } + public void replaceBiomeBlocks(int p_147421_1_, int p_147421_2_, Block[] p_147421_3_, BiomeGenBase[] p_147421_4_, byte[] meta) + { + ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147421_1_, p_147421_2_, p_147421_3_, meta, p_147421_4_, this.endWorld); MinecraftForge.EVENT_BUS.post(event); if (event.getResult() == Result.DENY) return; @@ -193,10 +198,11 @@ { this.endRNG.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); Block[] ablock = new Block[32768]; + byte[] meta = new byte[ablock.length]; this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); this.func_147420_a(p_73154_1_, p_73154_2_, ablock, this.biomesForGeneration); - this.func_147421_b(p_73154_1_, p_73154_2_, ablock, this.biomesForGeneration); - Chunk chunk = new Chunk(this.endWorld, ablock, p_73154_1_, p_73154_2_); + this.replaceBiomeBlocks(p_73154_1_, p_73154_2_, ablock, this.biomesForGeneration, meta); + Chunk chunk = new Chunk(this.endWorld, ablock, meta, p_73154_1_, p_73154_2_); byte[] abyte = chunk.getBiomeArray(); for (int k = 0; k < abyte.length; ++k) diff --git a/src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java b/src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java index a67b62f..414705c 100644 --- a/src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java +++ b/src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java @@ -65,7 +65,7 @@ mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(mineshaftGenerator, MINESHAFT); scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator, SCATTERED_FEATURE); ravineGenerator = TerrainGen.getModdedMapGen(ravineGenerator, RAVINE); - } + } public ChunkProviderGenerate(World p_i2006_1_, long p_i2006_2_, boolean p_i2006_4_) { @@ -182,7 +182,7 @@ public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) { - ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_4_, p_147422_5_); + ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_4_, p_147422_5_, this.worldObj); MinecraftForge.EVENT_BUS.post(event); if (event.getResult() == Result.DENY) return; diff --git a/src/main/java/net/minecraft/world/gen/ChunkProviderHell.java b/src/main/java/net/minecraft/world/gen/ChunkProviderHell.java index e7e71f4..3107255 100644 --- a/src/main/java/net/minecraft/world/gen/ChunkProviderHell.java +++ b/src/main/java/net/minecraft/world/gen/ChunkProviderHell.java @@ -155,9 +155,14 @@ } } + @Deprecated //You should provide meatadata and biome data in the below method public void func_147418_b(int p_147418_1_, int p_147418_2_, Block[] p_147418_3_) { - ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147418_1_, p_147418_2_, p_147418_3_, null); + replaceBiomeBlocks(p_147418_1_, p_147418_2_, p_147418_3_, new byte[p_147418_3_.length], null); + } + public void replaceBiomeBlocks(int p_147418_1_, int p_147418_2_, Block[] p_147418_3_, byte[] meta, BiomeGenBase[] biomes) + { + ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147418_1_, p_147418_2_, p_147418_3_, meta, biomes, this.worldObj); MinecraftForge.EVENT_BUS.post(event); if (event.getResult() == Result.DENY) return; @@ -261,12 +266,13 @@ { this.hellRNG.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); Block[] ablock = new Block[32768]; + byte[] meta = new byte[ablock.length]; + BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); //Forge Move up to allow for passing to replaceBiomeBlocks this.func_147419_a(p_73154_1_, p_73154_2_, ablock); - this.func_147418_b(p_73154_1_, p_73154_2_, ablock); + this.replaceBiomeBlocks(p_73154_1_, p_73154_2_, ablock, meta, abiomegenbase); this.netherCaveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); this.genNetherBridge.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); - Chunk chunk = new Chunk(this.worldObj, ablock, p_73154_1_, p_73154_2_); - BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + Chunk chunk = new Chunk(this.worldObj, ablock, meta, p_73154_1_, p_73154_2_); byte[] abyte = chunk.getBiomeArray(); for (int k = 0; k < abyte.length; ++k) @@ -463,7 +469,7 @@ } i1 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); - + doGen = TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, GLOWSTONE); for (j1 = 0; doGen && j1 < i1; ++j1) { diff --git a/src/main/java/net/minecraftforge/client/event/RenderBlockOverlayEvent.java b/src/main/java/net/minecraftforge/client/event/RenderBlockOverlayEvent.java new file mode 100644 index 0000000..ed4c8d3 --- /dev/null +++ b/src/main/java/net/minecraftforge/client/event/RenderBlockOverlayEvent.java @@ -0,0 +1,51 @@ +package net.minecraftforge.client.event; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; + +/** + * Called when a block's texture is going to be overlaid on the player's HUD. Cancel this event to prevent the overlay. + */ +@Cancelable +public class RenderBlockOverlayEvent extends Event { + + public static enum OverlayType { + FIRE, BLOCK, WATER + } + + /** + * The player which the overlay will apply to + */ + public final EntityPlayer player; + public final float renderPartialTicks; + /** + * The type of overlay to occur + */ + public final OverlayType overlayType; + /** + * If the overlay type is BLOCK, then this is the block which the overlay is getting it's icon from + */ + public final Block blockForOverlay; + public final int blockX; + public final int blockY; + public final int blockZ; + + public RenderBlockOverlayEvent(EntityPlayer player, float renderPartialTicks, OverlayType type, Block block, int blockX, int blockY, int blockZ) + { + this.player = player; + this.renderPartialTicks = renderPartialTicks; + this.overlayType = type; + if (this.overlayType == OverlayType.BLOCK) + this.blockForOverlay = block; + else + this.blockForOverlay = null; + this.blockX = blockX; + this.blockY = blockY; + this.blockZ = blockZ; + + } + +} diff --git a/src/main/java/net/minecraftforge/common/BiomeDictionary.java b/src/main/java/net/minecraftforge/common/BiomeDictionary.java index e5ee85b..9391bbf 100644 --- a/src/main/java/net/minecraftforge/common/BiomeDictionary.java +++ b/src/main/java/net/minecraftforge/common/BiomeDictionary.java @@ -3,6 +3,7 @@ import java.util.*; import cpw.mods.fml.common.FMLLog; +import net.minecraft.init.Blocks; import net.minecraft.world.biome.*; import net.minecraftforge.event.terraingen.DeferredBiomeDecorator; import static net.minecraft.world.biome.BiomeGenBase.*; @@ -12,21 +13,66 @@ { public enum Type { + /*Temperature-based tags. Specifying neither implies a biome is temperate*/ + HOT, + COLD, + /*Tags specifying the amount of vegetation a biome has. Specifying neither implies a biome to have moderate amounts*/ + SPARSE, + DENSE, + /*Tags specifying how moist a biome is. Specifying neither implies the biome as having moderate humidity*/ + WET, + DRY, + /*Tree-based tags, SAVANNA refers to dry, desert-like trees (Such as Acacia), CONIFEROUS refers to snowy trees (Such as Spruce) and JUNGLE refers to jungle trees. + * Specifying no tag implies a biome has temperate trees (Such as Oak)*/ + SAVANNA, + CONIFEROUS, + JUNGLE, + + /*Tags specifying the nature of a biome*/ + SPOOKY, + DEAD, + LUSH, + NETHER, + END, + MUSHROOM, + MAGICAL, + + OCEAN, + RIVER, + /**A general tag for all water-based biomes. Shown as present if OCEAN or RIVER are.**/ + WATER(OCEAN, RIVER), + + /*Generic types which a biome can be*/ + MESA, FOREST, PLAINS, MOUNTAIN, HILLS, SWAMP, - WATER, - DESERT, - FROZEN, - JUNGLE, + SANDY, + SNOWY, WASTELAND, BEACH, - NETHER, - END, - MUSHROOM, - MAGICAL; + + /*Deprecated tags, kept for compatibility*/ + @Deprecated + /**Replaced by SANDY**/ + DESERT(SANDY), + @Deprecated + /**Replaced by SNOWY**/ + FROZEN(SNOWY); + + private List subTags; + + private Type(Type... subTags) + { + this.subTags = Arrays.asList(subTags); + } + + private boolean hasSubTags() + { + return subTags != null && !subTags.isEmpty(); + } } private static final int BIOME_LIST_SIZE = BiomeGenBase.getBiomeGenArray().length; @@ -62,6 +108,8 @@ */ public static boolean registerBiomeType(BiomeGenBase biome, Type ... types) { + types = listSubTags(types); + if(BiomeGenBase.getBiomeGenArray()[biome.biomeID] != null) { for(Type type : types) @@ -232,15 +280,20 @@ */ public static void makeBestGuess(BiomeGenBase biome) { - if(biome.theBiomeDecorator.treesPerChunk >= 3) + if (biome.theBiomeDecorator.treesPerChunk >= 3) { - if(biome.isHighHumidity() && biome.temperature >= 1.0F) + if (biome.isHighHumidity() && biome.temperature >= 0.9F) { BiomeDictionary.registerBiomeType(biome, JUNGLE); } - else if(!biome.isHighHumidity()) + else if (!biome.isHighHumidity()) { BiomeDictionary.registerBiomeType(biome, FOREST); + + if (biome.temperature <= 0.2f) + { + BiomeDictionary.registerBiomeType(biome, CONIFEROUS); + } } } else if(biome.heightVariation <= 0.3F && biome.heightVariation >= 0.0F) @@ -251,29 +304,83 @@ } } - if(biome.isHighHumidity() && biome.rootHeight < 0.0F && (biome.heightVariation <= 0.3F && biome.heightVariation >= 0.0F)) + if (biome.rainfall > 0.85f) + { + BiomeDictionary.registerBiomeType(biome, WET); + } + + if (biome.rainfall < 0.15f) + { + BiomeDictionary.registerBiomeType(biome, DRY); + } + + if (biome.temperature > 0.85f) + { + BiomeDictionary.registerBiomeType(biome, HOT); + } + + if (biome.temperature < 0.15f) + { + BiomeDictionary.registerBiomeType(biome, COLD); + } + + if (biome.theBiomeDecorator.treesPerChunk > 0 && biome.theBiomeDecorator.treesPerChunk < 3) + { + BiomeDictionary.registerBiomeType(biome, SPARSE); + } + else if (biome.theBiomeDecorator.treesPerChunk >= 10) + { + BiomeDictionary.registerBiomeType(biome, DENSE); + } + + if (biome.isHighHumidity() && biome.rootHeight < 0.0F && (biome.heightVariation <= 0.3F && biome.heightVariation >= 0.0F)) { BiomeDictionary.registerBiomeType(biome, SWAMP); } - if(biome.rootHeight <= -0.5F) + if (biome.rootHeight <= -0.5F) { - BiomeDictionary.registerBiomeType(biome, WATER); + if (biome.heightVariation == 0.0F) + { + BiomeDictionary.registerBiomeType(biome, RIVER); + } + else + { + BiomeDictionary.registerBiomeType(biome, OCEAN); + } } - if(biome.heightVariation >= 1.5F) + if (biome.heightVariation >= 0.4F && biome.heightVariation < 1.5F) + { + BiomeDictionary.registerBiomeType(biome, HILLS); + } + + if (biome.heightVariation >= 1.5F) { BiomeDictionary.registerBiomeType(biome, MOUNTAIN); } - - if(biome.getEnableSnow() || biome.temperature < 0.2F) + + if (biome.getEnableSnow()) { - BiomeDictionary.registerBiomeType(biome, FROZEN); + BiomeDictionary.registerBiomeType(biome, SNOWY); } - - if(!biome.isHighHumidity() && biome.temperature >= 1.0F) + + if (biome.topBlock != Blocks.sand && biome.temperature >= 1.0f && biome.rainfall < 0.2f) { - BiomeDictionary.registerBiomeType(biome, DESERT); + BiomeDictionary.registerBiomeType(biome, SAVANNA); + } + + if (biome.topBlock == Blocks.sand ) + { + BiomeDictionary.registerBiomeType(biome, SANDY); + } + else if (biome.topBlock == Blocks.hardened_clay) + { + BiomeDictionary.registerBiomeType(biome, MESA); + } + else if (biome.topBlock == Blocks.mycelium) + { + BiomeDictionary.registerBiomeType(biome, MUSHROOM); } } @@ -288,50 +395,73 @@ private static boolean containsType(BiomeInfo info, Type type) { + if (type.hasSubTags()) + { + for (Type remappedType : listSubTags(type)) + { + if (info.typeList.contains(remappedType)) return true; + } + + return false; + } + return info.typeList.contains(type); } + + private static Type[] listSubTags(Type... types) + { + List subTags = new ArrayList(); + + for (Type type : types) + { + if (type.hasSubTags()) subTags.addAll(type.subTags); + else subTags.add(type); + } + + return subTags.toArray(new Type[subTags.size()]); + } private static void registerVanillaBiomes() { - registerBiomeType(ocean, WATER ); - registerBiomeType(plains, PLAINS ); - registerBiomeType(desert, DESERT ); - registerBiomeType(extremeHills, MOUNTAIN ); - registerBiomeType(forest, FOREST ); - registerBiomeType(taiga, FOREST, FROZEN); - registerBiomeType(taigaHills, FOREST, FROZEN); - registerBiomeType(swampland, SWAMP ); - registerBiomeType(river, WATER ); - registerBiomeType(frozenOcean, WATER, FROZEN); - registerBiomeType(frozenRiver, WATER, FROZEN); - registerBiomeType(icePlains, FROZEN ); - registerBiomeType(iceMountains, FROZEN ); - registerBiomeType(beach, BEACH ); - registerBiomeType(desertHills, DESERT ); - registerBiomeType(jungle, JUNGLE ); - registerBiomeType(jungleHills, JUNGLE ); - registerBiomeType(forestHills, FOREST ); - registerBiomeType(sky, END ); - registerBiomeType(hell, NETHER ); - registerBiomeType(mushroomIsland, MUSHROOM ); - registerBiomeType(extremeHillsEdge, MOUNTAIN ); - registerBiomeType(mushroomIslandShore, MUSHROOM, BEACH); - registerBiomeType(jungleEdge, JUNGLE ); - registerBiomeType(deepOcean, WATER ); - registerBiomeType(stoneBeach, BEACH ); - registerBiomeType(coldBeach, BEACH, FROZEN); - registerBiomeType(birchForest, FOREST ); - registerBiomeType(birchForestHills, FOREST ); - registerBiomeType(roofedForest, FOREST ); - registerBiomeType(coldTaiga, FOREST, FROZEN); - registerBiomeType(coldTaigaHills, FOREST, FROZEN); - registerBiomeType(megaTaiga, FOREST ); - registerBiomeType(megaTaigaHills, FOREST ); - registerBiomeType(extremeHillsPlus, FOREST ); - registerBiomeType(savanna, PLAINS, DESERT); - registerBiomeType(savannaPlateau, PLAINS, DESERT); - registerBiomeType(mesa, DESERT ); - registerBiomeType(mesaPlateau_F, DESERT ); - registerBiomeType(mesaPlateau, DESERT ); + registerBiomeType(ocean, OCEAN ); + registerBiomeType(plains, PLAINS ); + registerBiomeType(desert, HOT, DRY, SANDY ); + registerBiomeType(extremeHills, MOUNTAIN, HILLS ); + registerBiomeType(forest, FOREST ); + registerBiomeType(taiga, COLD, CONIFEROUS, FOREST ); + registerBiomeType(taigaHills, COLD, CONIFEROUS, FOREST, HILLS ); + registerBiomeType(swampland, WET, SWAMP ); + registerBiomeType(river, RIVER ); + registerBiomeType(frozenOcean, COLD, OCEAN, SNOWY ); + registerBiomeType(frozenRiver, COLD, RIVER, SNOWY ); + registerBiomeType(icePlains, COLD, SNOWY, WASTELAND ); + registerBiomeType(iceMountains, COLD, SNOWY, MOUNTAIN ); + registerBiomeType(beach, BEACH ); + registerBiomeType(desertHills, HOT, DRY, SANDY, HILLS ); + registerBiomeType(jungle, HOT, WET, DENSE, JUNGLE ); + registerBiomeType(jungleHills, HOT, WET, DENSE, JUNGLE, HILLS); + registerBiomeType(forestHills, FOREST, HILLS ); + registerBiomeType(sky, COLD, DRY, END ); + registerBiomeType(hell, HOT, DRY, NETHER ); + registerBiomeType(mushroomIsland, MUSHROOM ); + registerBiomeType(extremeHillsEdge, MOUNTAIN ); + registerBiomeType(mushroomIslandShore, MUSHROOM, BEACH ); + registerBiomeType(jungleEdge, HOT, WET, JUNGLE, FOREST ); + registerBiomeType(deepOcean, OCEAN ); + registerBiomeType(stoneBeach, BEACH ); + registerBiomeType(coldBeach, COLD, BEACH, SNOWY ); + registerBiomeType(birchForest, FOREST ); + registerBiomeType(birchForestHills, FOREST, HILLS ); + registerBiomeType(roofedForest, SPOOKY, DENSE, FOREST ); + registerBiomeType(coldTaiga, COLD, CONIFEROUS, FOREST, SNOWY ); + registerBiomeType(coldTaigaHills, COLD, CONIFEROUS, FOREST, SNOWY, HILLS); + registerBiomeType(megaTaiga, COLD, CONIFEROUS, FOREST ); + registerBiomeType(megaTaigaHills, COLD, CONIFEROUS, FOREST, HILLS ); + registerBiomeType(extremeHillsPlus, MOUNTAIN, FOREST, SPARSE ); + registerBiomeType(savanna, HOT, SAVANNA, PLAINS, SPARSE ); + registerBiomeType(savannaPlateau, HOT, SAVANNA, PLAINS, SPARSE ); + registerBiomeType(mesa, MESA, SANDY ); + registerBiomeType(mesaPlateau_F, MESA, SPARSE, SANDY ); + registerBiomeType(mesaPlateau, MESA, SANDY ); } } diff --git a/src/main/java/net/minecraftforge/event/terraingen/ChunkProviderEvent.java b/src/main/java/net/minecraftforge/event/terraingen/ChunkProviderEvent.java index ea1d02d..55841fb 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/ChunkProviderEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/ChunkProviderEvent.java @@ -2,6 +2,7 @@ import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.block.Block; +import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.IChunkProvider; @@ -9,56 +10,60 @@ { public final IChunkProvider chunkProvider; - + public ChunkProviderEvent(IChunkProvider chunkProvider) { this.chunkProvider = chunkProvider; } - + /** * This event is fired when a chunks blocks are replaced by a biomes top and * filler blocks. - * + * * You can set the result to DENY to prevent the default replacement. */ @HasResult - public static class ReplaceBiomeBlocks extends ChunkProviderEvent + public static class ReplaceBiomeBlocks extends ChunkProviderEvent { public final int chunkX; public final int chunkZ; public final Block[] blockArray; - public final byte[] metaArray; + public final byte[] metaArray; // CAN BE NULL public final BiomeGenBase[] biomeArray; - + public final World world; // CAN BE NULL + + @Deprecated // TODO: Remove in 1.8 public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, BiomeGenBase[] biomeArray) { - super(chunkProvider); - this.chunkX = chunkX; - this.chunkZ = chunkZ; - this.blockArray = blockArray; - this.biomeArray = biomeArray; - metaArray = new byte[256]; + this(chunkProvider, chunkX, chunkZ, blockArray, new byte[256], biomeArray, null); } - + + @Deprecated // TODO: Remove in 1.8 public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, byte[] metaArray, BiomeGenBase[] biomeArray) { + this(chunkProvider, chunkZ, chunkZ, blockArray, metaArray, biomeArray, null); + } + + public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, byte[] metaArray, BiomeGenBase[] biomeArray, World world) + { super(chunkProvider); this.chunkX = chunkX; this.chunkZ = chunkZ; this.blockArray = blockArray; this.biomeArray = biomeArray; this.metaArray = metaArray; + this.world = world; } - + } - + /** * This event is fired before a chunks terrain noise field is initialized. - * + * * You can set the result to DENY to substitute your own noise field. */ @HasResult - public static class InitNoiseField extends ChunkProviderEvent + public static class InitNoiseField extends ChunkProviderEvent { public double[] noisefield; public final int posX; @@ -67,7 +72,7 @@ public final int sizeX; public final int sizeY; public final int sizeZ; - + public InitNoiseField(IChunkProvider chunkProvider, double[] noisefield, int posX, int posY, int posZ, int sizeX, int sizeY, int sizeZ) { super(chunkProvider); @@ -79,6 +84,6 @@ this.sizeY = sizeY; this.sizeZ = sizeZ; } - + } } diff --git a/src/main/resources/fmlversion.properties b/src/main/resources/fmlversion.properties index d83a147..4eafe44 100644 --- a/src/main/resources/fmlversion.properties +++ b/src/main/resources/fmlversion.properties @@ -1,6 +1,6 @@ fmlbuild.major.number=7 fmlbuild.minor.number=10 fmlbuild.revision.number=11 -fmlbuild.build.number=54 +fmlbuild.build.number=55 fmlbuild.mcversion=1.7.10 fmlbuild.mcpversion=9.05