diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-06-12 00:02:58 +0200 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-06-12 00:30:52 +0200 |
commit | 96b1b8a10cec88c724b83541aed6f87b188f5e14 (patch) | |
tree | 7058be20c6adb15cad2c823784b04340b1b1e44f /src/main/java/net/minecraft/server/BlockPressurePlate.java | |
parent | 938db4de2d86d8cc05c258eeae2c43ef428588f3 (diff) | |
download | craftbukkit-96b1b8a10cec88c724b83541aed6f87b188f5e14.tar craftbukkit-96b1b8a10cec88c724b83541aed6f87b188f5e14.tar.gz craftbukkit-96b1b8a10cec88c724b83541aed6f87b188f5e14.tar.lz craftbukkit-96b1b8a10cec88c724b83541aed6f87b188f5e14.tar.xz craftbukkit-96b1b8a10cec88c724b83541aed6f87b188f5e14.zip |
Generic cleanup
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockPressurePlate.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockPressurePlate.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/BlockPressurePlate.java b/src/main/java/net/minecraft/server/BlockPressurePlate.java index 2afbb309..98a4a655 100644 --- a/src/main/java/net/minecraft/server/BlockPressurePlate.java +++ b/src/main/java/net/minecraft/server/BlockPressurePlate.java @@ -108,14 +108,15 @@ public class BlockPressurePlate extends Block { for (Object object: list) { if (object != null) { Cancellable cancellable; + if (object instanceof EntityHuman) { cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) object, Action.PHYSICAL, i, j, k, -1, null); + } else if (object instanceof Entity) { + cancellable = new EntityInteractEvent(((Entity) object).getBukkitEntity(), ((WorldServer) world).getWorld().getBlockAt(i, j, k)); + ((CraftServer) Bukkit.getServer()).getPluginManager().callEvent((EntityInteractEvent) cancellable); + } else { + continue; } - else if (object instanceof Entity) { - cancellable = new EntityInteractEvent(((Entity) object).getBukkitEntity(), ((WorldServer)world).getWorld().getBlockAt(i, j, k)); - ((CraftServer)Bukkit.getServer()).getPluginManager().callEvent((EntityInteractEvent) cancellable); - } - else continue; if (cancellable.isCancelled()) { return; } |