diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-03-23 12:22:13 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-03-23 16:51:43 +0100 |
commit | f33de669fb1cb86ba668d60ba2f2352fd63b4417 (patch) | |
tree | 0b713c8318cb327e564ab94951c2f1e9324cfe14 /src/main/java/net/minecraft/server/BlockButton.java | |
parent | bb9558adec41922473de87718a53f5d3533deb7a (diff) | |
download | craftbukkit-f33de669fb1cb86ba668d60ba2f2352fd63b4417.tar craftbukkit-f33de669fb1cb86ba668d60ba2f2352fd63b4417.tar.gz craftbukkit-f33de669fb1cb86ba668d60ba2f2352fd63b4417.tar.lz craftbukkit-f33de669fb1cb86ba668d60ba2f2352fd63b4417.tar.xz craftbukkit-f33de669fb1cb86ba668d60ba2f2352fd63b4417.zip |
Major overhaul implementing PLAYER_INTERACT, removing PLAYER_ITEM, BLOCK_INTERACT, BLOCK_RIGHT_CLICK
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockButton.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockButton.java | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/main/java/net/minecraft/server/BlockButton.java b/src/main/java/net/minecraft/server/BlockButton.java index 6121e602..1d09e635 100644 --- a/src/main/java/net/minecraft/server/BlockButton.java +++ b/src/main/java/net/minecraft/server/BlockButton.java @@ -6,9 +6,6 @@ import java.util.Random; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; -import org.bukkit.entity.LivingEntity; -import org.bukkit.event.Event.Type; -import org.bukkit.event.block.BlockInteractEvent; import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit end @@ -126,21 +123,6 @@ public class BlockButton extends Block { } public boolean a(World world, int i, int j, int k, EntityHuman entityhuman) { - // CraftBukkit start - Interact Button - CraftWorld craftWorld = ((WorldServer) world).getWorld(); - CraftServer server = ((WorldServer) world).getServer(); - Type eventType = Type.BLOCK_INTERACT; - CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k); - LivingEntity who = (entityhuman == null) ? null : (LivingEntity) entityhuman.getBukkitEntity(); - - BlockInteractEvent event = new BlockInteractEvent(eventType, block, who); - server.getPluginManager().callEvent(event); - - if (event.isCancelled()) { - return true; - } - // CraftBukkit end - int l = world.getData(i, j, k); int i1 = l & 7; int j1 = 8 - (l & 8); @@ -149,6 +131,10 @@ public class BlockButton extends Block { return true; } else { // CraftBukkit start + CraftWorld craftWorld = ((WorldServer) world).getWorld(); + CraftServer server = ((WorldServer) world).getServer(); + CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k); + int old = (j1 != 8) ? 1 : 0; int current = (j1 == 8) ? 1 : 0; BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current); |