From 24557bc2b37deb6a0edf497d547471832457b1dd Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 26 Nov 2014 08:32:16 +1100 Subject: Update to Minecraft 1.8 For more information please see http://www.spigotmc.org/ --- nms-patches/BlockVine.patch | 76 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 nms-patches/BlockVine.patch (limited to 'nms-patches/BlockVine.patch') diff --git a/nms-patches/BlockVine.patch b/nms-patches/BlockVine.patch new file mode 100644 index 00000000..5e920272 --- /dev/null +++ b/nms-patches/BlockVine.patch @@ -0,0 +1,76 @@ +--- ../work/decompile-bb26c12b/net/minecraft/server/BlockVine.java 2014-11-27 08:59:46.589422340 +1100 ++++ src/main/java/net/minecraft/server/BlockVine.java 2014-11-27 08:42:10.156850903 +1100 +@@ -3,6 +3,8 @@ + import java.util.Iterator; + import java.util.Random; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++ + public class BlockVine extends Block { + + public static final BlockStateBoolean UP = BlockStateBoolean.of("up"); +@@ -203,7 +205,13 @@ + } + + if (((Boolean) iblockdata1.get(BlockVine.NORTH)).booleanValue() || ((Boolean) iblockdata1.get(BlockVine.EAST)).booleanValue() || ((Boolean) iblockdata1.get(BlockVine.SOUTH)).booleanValue() || ((Boolean) iblockdata1.get(BlockVine.WEST)).booleanValue()) { +- world.setTypeAndData(blockposition.up(), iblockdata1, 2); ++ // CraftBukkit start - Call BlockSpreadEvent ++ // world.setTypeAndData(blockposition.up(), iblockdata1, 2); ++ BlockPosition target = blockposition.up(); ++ org.bukkit.block.Block source = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block block = world.getWorld().getBlockAt(target.getX(), target.getY(), target.getZ()); ++ CraftEventFactory.handleBlockSpreadEvent(block, source, this, toLegacyData(iblockdata1)); ++ // CraftBukkit end + } + + } +@@ -222,18 +230,30 @@ + boolean flag2 = ((Boolean) iblockdata.get(a(enumdirection2))).booleanValue(); + BlockPosition blockposition2 = blockposition1.shift(enumdirection1); + BlockPosition blockposition3 = blockposition1.shift(enumdirection2); ++ ++ // CraftBukkit start - Call BlockSpreadEvent ++ org.bukkit.block.Block source = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ()); + + if (flag1 && this.c(world.getType(blockposition2).getBlock())) { +- world.setTypeAndData(blockposition1, this.getBlockData().set(a(enumdirection1), Boolean.valueOf(true)), 2); ++ // world.setTypeAndData(blockposition1, this.getBlockData().set(a(enumdirection1), Boolean.valueOf(true)), 2); ++ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, block, toLegacyData(this.getBlockData().set(a(enumdirection1), Boolean.valueOf(true)))); + } else if (flag2 && this.c(world.getType(blockposition3).getBlock())) { +- world.setTypeAndData(blockposition1, this.getBlockData().set(a(enumdirection2), Boolean.valueOf(true)), 2); ++ // world.setTypeAndData(blockposition1, this.getBlockData().set(a(enumdirection2), Boolean.valueOf(true)), 2); ++ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, block, toLegacyData(this.getBlockData().set(a(enumdirection2), Boolean.valueOf(true)))); + } else if (flag1 && world.isEmpty(blockposition2) && this.c(world.getType(blockposition.shift(enumdirection1)).getBlock())) { +- world.setTypeAndData(blockposition2, this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)), 2); ++ // world.setTypeAndData(blockposition2, this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)), 2); ++ bukkitBlock = world.getWorld().getBlockAt(blockposition2.getX(), blockposition2.getY(), blockposition2.getZ()); ++ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, block, toLegacyData(this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)))); + } else if (flag2 && world.isEmpty(blockposition3) && this.c(world.getType(blockposition.shift(enumdirection2)).getBlock())) { +- world.setTypeAndData(blockposition3, this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)), 2); ++ // world.setTypeAndData(blockposition3, this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)), 2); ++ bukkitBlock = world.getWorld().getBlockAt(blockposition3.getX(), blockposition3.getY(), blockposition3.getZ()); ++ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, block, toLegacyData(this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)))); + } else if (this.c(world.getType(blockposition1.up()).getBlock())) { +- world.setTypeAndData(blockposition1, this.getBlockData(), 2); ++ // world.setTypeAndData(blockposition1, this.getBlockData(), 2); ++ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, block, toLegacyData(this.getBlockData())); + } ++ // CraftBukkit end + } else if (block.material.k() && block.d()) { + world.setTypeAndData(blockposition, iblockdata.set(a(enumdirection), Boolean.valueOf(true)), 2); + } +@@ -260,7 +280,12 @@ + } + + if (((Boolean) iblockdata3.get(BlockVine.NORTH)).booleanValue() || ((Boolean) iblockdata3.get(BlockVine.EAST)).booleanValue() || ((Boolean) iblockdata3.get(BlockVine.SOUTH)).booleanValue() || ((Boolean) iblockdata3.get(BlockVine.WEST)).booleanValue()) { +- world.setTypeAndData(blockposition1, iblockdata3, 2); ++ // CraftBukkit start - Call BlockSpreadEvent ++ // world.setTypeAndData(blockposition1, iblockdata3, 2); ++ org.bukkit.block.Block source = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ()); ++ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(iblockdata3)); ++ // CraftBukkit end + } + } else if (block1 == this) { + iblockdata3 = iblockdata2; -- cgit v1.2.3