diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-03-25 07:35:47 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-03-25 07:35:47 +0100 |
commit | 95c08f854f162dd552987506fd927e0b56cc5146 (patch) | |
tree | 8e31784a0f4b46b8953c602e4075f297863d5911 /src/main/java/net/minecraft/server/ItemInWorldManager.java | |
parent | f330025f1fc00eaaa39a4493a7e13a5394d99fd1 (diff) | |
download | craftbukkit-95c08f854f162dd552987506fd927e0b56cc5146.tar craftbukkit-95c08f854f162dd552987506fd927e0b56cc5146.tar.gz craftbukkit-95c08f854f162dd552987506fd927e0b56cc5146.tar.lz craftbukkit-95c08f854f162dd552987506fd927e0b56cc5146.tar.xz craftbukkit-95c08f854f162dd552987506fd927e0b56cc5146.zip |
Fix inability to use items under certain circumstances
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemInWorldManager.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemInWorldManager.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/net/minecraft/server/ItemInWorldManager.java b/src/main/java/net/minecraft/server/ItemInWorldManager.java index 0dbbe80a..14c0b379 100644 --- a/src/main/java/net/minecraft/server/ItemInWorldManager.java +++ b/src/main/java/net/minecraft/server/ItemInWorldManager.java @@ -186,11 +186,6 @@ public class ItemInWorldManager { public boolean a(EntityHuman entityhuman, World world, ItemStack itemstack) { int i = itemstack.count; - PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(entityhuman, Action.RIGHT_CLICK_AIR, itemstack); - if (event.useItemInHand() == Event.Result.DENY) { - return false; - } - ItemStack itemstack1 = itemstack.a(world, entityhuman); if (itemstack1 == itemstack && (itemstack1 == null || itemstack1.count == i)) { @@ -220,10 +215,14 @@ public class ItemInWorldManager { } } else { result = Block.byId[i1].a(world, i, j, k, entityhuman); + if (itemstack != null && !result) { + result = itemstack.a(entityhuman, world, i, j, k, l); + } } + // If we have 'true' and no explicit deny *or* an explicit allow -- run the item part of the hook if (itemstack != null && ((!result && event.useItemInHand() != Event.Result.DENY) || event.useItemInHand() == Event.Result.ALLOW)) { - result = itemstack.a(entityhuman, world, i, j, k, l); + this.a(entityhuman, world, itemstack); } } return result; |