diff options
author | EvilSeph <evilseph@unaligned.org> | 2011-06-23 01:08:56 -0400 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-06-23 01:25:08 -0400 |
commit | ebfd973d09a87b8f7cc6314935e876d864d1eab6 (patch) | |
tree | 83a757ad373675e667dd727ef852df89a2c4be39 | |
parent | 98098481e9d680107bbd2eef17e3dcd31ac7ce7f (diff) | |
download | craftbukkit-ebfd973d09a87b8f7cc6314935e876d864d1eab6.tar craftbukkit-ebfd973d09a87b8f7cc6314935e876d864d1eab6.tar.gz craftbukkit-ebfd973d09a87b8f7cc6314935e876d864d1eab6.tar.lz craftbukkit-ebfd973d09a87b8f7cc6314935e876d864d1eab6.tar.xz craftbukkit-ebfd973d09a87b8f7cc6314935e876d864d1eab6.zip |
Fixed PlayerPickupItem event firing even if the player could not pick up the item.
-rw-r--r-- | src/main/java/net/minecraft/server/EntityItem.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java index f7b55c7c..529dd327 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -127,12 +127,12 @@ public class EntityItem extends Entity { int i = this.itemStack.count; // CraftBukkit start - if (this.pickupDelay <= 0) { // <-- == to <= + if (this.pickupDelay <= 0 && entityhuman.inventory.canHold(this.itemStack)) { // <-- == to <= Player player = (Player) entityhuman.getBukkitEntity(); PlayerPickupItemEvent event = new PlayerPickupItemEvent(player, (org.bukkit.entity.Item) this.getBukkitEntity()); - ((WorldServer) world).getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event); - if (event.isCancelled() || !entityhuman.inventory.canHold(this.itemStack)) { + if (event.isCancelled()) { return; } // CraftBukkit end |