diff options
author | QuarterAnimal <quarteranimal@gmail.com> | 2013-01-02 12:36:23 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-01-24 19:50:21 -0600 |
commit | b82375a5964c093746a0bbe48a6329c80e41c429 (patch) | |
tree | c5ceafa64a14d6d1d621aab9c8f9804051706b76 /src | |
parent | f10c9861369d5ecbad793f5e5be3638bc975a22f (diff) | |
download | craftbukkit-b82375a5964c093746a0bbe48a6329c80e41c429.tar craftbukkit-b82375a5964c093746a0bbe48a6329c80e41c429.tar.gz craftbukkit-b82375a5964c093746a0bbe48a6329c80e41c429.tar.lz craftbukkit-b82375a5964c093746a0bbe48a6329c80e41c429.tar.xz craftbukkit-b82375a5964c093746a0bbe48a6329c80e41c429.zip |
Preserve source block in mushroom spread event. Fixes BUKKIT-3354
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockMushroom.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java index bfc48d49..38fac4cf 100644 --- a/src/main/java/net/minecraft/server/BlockMushroom.java +++ b/src/main/java/net/minecraft/server/BlockMushroom.java @@ -48,6 +48,12 @@ public class BlockMushroom extends BlockFlower { j1 = j + random.nextInt(2) - random.nextInt(2); k1 = k + random.nextInt(3) - 1; + // CraftBukkit start - preserve source block coordinates + int sourceX = i; + int sourceY = j; + int sourceZ = k; + // CraftBukkit end + for (int l1 = 0; l1 < 4; ++l1) { if (world.isEmpty(i1, j1, k1) && this.d(world, i1, j1, k1)) { i = i1; @@ -66,7 +72,7 @@ public class BlockMushroom extends BlockFlower { BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); blockState.setTypeId(this.id); - BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState); + BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(sourceX, sourceY, sourceZ), blockState); world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { |