summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockPressurePlateBinary.patch
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-11-26 08:32:16 +1100
committermd_5 <git@md-5.net>2014-11-28 17:16:30 +1100
commit24557bc2b37deb6a0edf497d547471832457b1dd (patch)
treec560572889a3b0b34964a0cddb35dc87fda3c914 /nms-patches/BlockPressurePlateBinary.patch
parenta4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff)
downloadcraftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'nms-patches/BlockPressurePlateBinary.patch')
-rw-r--r--nms-patches/BlockPressurePlateBinary.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/nms-patches/BlockPressurePlateBinary.patch b/nms-patches/BlockPressurePlateBinary.patch
new file mode 100644
index 00000000..a1d38a16
--- /dev/null
+++ b/nms-patches/BlockPressurePlateBinary.patch
@@ -0,0 +1,38 @@
+--- ../work/decompile-bb26c12b/net/minecraft/server/BlockPressurePlateBinary.java 2014-11-27 08:59:46.557422481 +1100
++++ src/main/java/net/minecraft/server/BlockPressurePlateBinary.java 2014-11-27 08:42:10.152850911 +1100
+@@ -3,6 +3,8 @@
+ import java.util.Iterator;
+ import java.util.List;
+
++import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
++
+ public class BlockPressurePlateBinary extends BlockPressurePlateAbstract {
+
+ public static final BlockStateBoolean POWERED = BlockStateBoolean.of("powered");
+@@ -44,6 +46,26 @@
+
+ while (iterator.hasNext()) {
+ Entity entity = (Entity) iterator.next();
++
++ // CraftBukkit start - Call interact event when turning on a pressure plate
++ if (this.e(world.getType(blockposition)) == 0) {
++ org.bukkit.World bworld = world.getWorld();
++ org.bukkit.plugin.PluginManager manager = world.getServer().getPluginManager();
++ org.bukkit.event.Cancellable cancellable;
++
++ if (entity instanceof EntityHuman) {
++ cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null);
++ } else {
++ cancellable = new EntityInteractEvent(entity.getBukkitEntity(), bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
++ manager.callEvent((EntityInteractEvent) cancellable);
++ }
++
++ // We only want to block turning the plate on if all events are cancelled
++ if (cancellable.isCancelled()) {
++ continue;
++ }
++ }
++ // CraftBukkit end
+
+ if (!entity.aH()) {
+ return 15;