Fix inability to use items under certain circumstances

This commit is contained in:
Erik Broes
2011-03-25 07:35:47 +01:00
parent f330025f1f
commit 95c08f854f
2 changed files with 9 additions and 7 deletions

View File

@@ -412,7 +412,10 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
// CraftBukkit start
int itemstackAmount = itemstack.count;
this.e.c.a(this.e, this.e.world, itemstack);
PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.e, Action.RIGHT_CLICK_AIR, itemstack);
if (event.useItemInHand() != Event.Result.DENY) {
this.e.c.a(this.e, this.e.world, itemstack);
}
// CraftBukkit notch decrements the counter by 1 in the above method with food,
// snowballs and so forth, but he does it in a place that doesn't cause the