diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-08 02:56:09 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-08 03:58:34 -0600 |
commit | 12c7c2f695251e70363eca08bb97baa25d0f3bb7 (patch) | |
tree | 452a8be08405cf15abbbcad4ee4410e7287537a4 | |
parent | e760d6eb31682e2c3691b9c161d766adde0fcaa3 (diff) | |
download | craftbukkit-12c7c2f695251e70363eca08bb97baa25d0f3bb7.tar craftbukkit-12c7c2f695251e70363eca08bb97baa25d0f3bb7.tar.gz craftbukkit-12c7c2f695251e70363eca08bb97baa25d0f3bb7.tar.lz craftbukkit-12c7c2f695251e70363eca08bb97baa25d0f3bb7.tar.xz craftbukkit-12c7c2f695251e70363eca08bb97baa25d0f3bb7.zip |
Implement FurnaceExtractEvent. Adds BUKKIT-2114
-rw-r--r-- | src/main/java/net/minecraft/server/SlotFurnaceResult.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/SlotFurnaceResult.java b/src/main/java/net/minecraft/server/SlotFurnaceResult.java index ed2e00d3..c8812336 100644 --- a/src/main/java/net/minecraft/server/SlotFurnaceResult.java +++ b/src/main/java/net/minecraft/server/SlotFurnaceResult.java @@ -1,5 +1,10 @@ package net.minecraft.server; +// CraftBukkit start +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.FurnaceExtractEvent; +// CraftBukkit end + public class SlotFurnaceResult extends Slot { private EntityHuman a; @@ -50,6 +55,17 @@ public class SlotFurnaceResult extends Slot { i = j; } + // CraftBukkit start + Player player = (Player) a.getBukkitEntity(); + TileEntityFurnace furnace = ((TileEntityFurnace) this.inventory); + org.bukkit.block.Block block = a.world.getWorld().getBlockAt(furnace.x, furnace.y, furnace.z); + + FurnaceExtractEvent event = new FurnaceExtractEvent(player, block, org.bukkit.Material.getMaterial(itemstack.id), itemstack.count, i); + a.world.getServer().getPluginManager().callEvent(event); + + i = event.getExpToDrop(); + // CraftBukkit end + while (i > 0) { j = EntityExperienceOrb.getOrbValue(i); i -= j; |