From f8489552637b3176e61fce358a6f0bd562b905ec Mon Sep 17 00:00:00 2001 From: Bioxx Date: Tue, 29 Apr 2014 19:40:32 -0400 Subject: [PATCH] Adds a new ReplaceBiomeBlocks Event constructor that supplies the metadata array if applicable and updates the ChunkProviderGenerate class to pass in the metadata array. --- .../world/gen/ChunkProviderGenerate.java.patch | 2 +- .../event/terraingen/ChunkProviderEvent.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch index 699724c64..ac2d1b245 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch @@ -50,7 +50,7 @@ public void func_147422_a(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_5_); ++ ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_4_, p_147422_5_); + MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == Result.DENY) return; + diff --git a/src/main/java/net/minecraftforge/event/terraingen/ChunkProviderEvent.java b/src/main/java/net/minecraftforge/event/terraingen/ChunkProviderEvent.java index e61a00964..aeb1b55d1 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/ChunkProviderEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/ChunkProviderEvent.java @@ -27,6 +27,7 @@ public class ChunkProviderEvent extends Event public final int chunkX; public final int chunkZ; public final Block[] blockArray; + public final byte[] metaArray; public final BiomeGenBase[] biomeArray; public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, BiomeGenBase[] biomeArray) @@ -36,6 +37,17 @@ public class ChunkProviderEvent extends Event this.chunkZ = chunkZ; this.blockArray = blockArray; this.biomeArray = biomeArray; + metaArray = new byte[256]; + } + + public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, byte[] metaArray, BiomeGenBase[] biomeArray) + { + super(chunkProvider); + this.chunkX = chunkX; + this.chunkZ = chunkZ; + this.blockArray = blockArray; + this.biomeArray = biomeArray; + this.metaArray = metaArray; } }