diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-03-18 12:20:40 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-18 12:35:43 -0500 |
commit | 2e6cfdb3cc9147d49c050dbd21a6ae37c3a916dd (patch) | |
tree | 877ac484d98e87a31558a140a5b233126974ccad /src | |
parent | 2642fbdf7e3612c5f8804b4f8fada6fea7641065 (diff) | |
download | craftbukkit-2e6cfdb3cc9147d49c050dbd21a6ae37c3a916dd.tar craftbukkit-2e6cfdb3cc9147d49c050dbd21a6ae37c3a916dd.tar.gz craftbukkit-2e6cfdb3cc9147d49c050dbd21a6ae37c3a916dd.tar.lz craftbukkit-2e6cfdb3cc9147d49c050dbd21a6ae37c3a916dd.tar.xz craftbukkit-2e6cfdb3cc9147d49c050dbd21a6ae37c3a916dd.zip |
Implement InventoryPickupItemEvent. Adds BUKKIT-3798
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/TileEntityHopper.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java index c9ece0aa..25cf3df8 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -5,6 +5,7 @@ import java.util.List; // CraftBukkit start import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.entity.HumanEntity; +import org.bukkit.event.inventory.InventoryPickupItemEvent; // CraftBukkit end public class TileEntityHopper extends TileEntity implements IHopper { @@ -261,6 +262,14 @@ public class TileEntityHopper extends TileEntity implements IHopper { if (entityitem == null) { return false; } else { + // CraftBukkit start + InventoryPickupItemEvent event = new InventoryPickupItemEvent(iinventory.getOwner().getInventory(), (org.bukkit.entity.Item) entityitem.getBukkitEntity()); + entityitem.world.getServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return false; + } + // CraftBukkit end + ItemStack itemstack = entityitem.getItemStack().cloneItemStack(); ItemStack itemstack1 = a(iinventory, itemstack, -1); |