mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 19:15:32 +01:00
Implement FurnaceExtractEvent. Adds BUKKIT-2114
This commit is contained in:
parent
e760d6eb31
commit
12c7c2f695
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user