package org.bukkit.event.inventory; import org.bukkit.block.Block; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.inventory.ItemStack; /** * Called when an ItemStack is successfully burned as fuel in a furnace. */ public class FurnaceBurnEvent extends Event implements Cancellable { private Block furnace; private ItemStack fuel; private int burnTime; private boolean cancelled; private boolean burning; public FurnaceBurnEvent(Block furnace, ItemStack fuel, int burnTime) { super(Type.FURNACE_BURN); this.furnace = furnace; this.fuel = fuel; this.burnTime = burnTime; this.cancelled = false; this.burning = true; } /** * Gets the block for the furnace involved in this event * * @return the block of the furnace */ public Block getFurnace() { return furnace; } /** * Gets the fuel ItemStack for this event * * @return the fuel ItemStack */ public ItemStack getFuel() { return fuel; } /** * Gets the burn time for this fuel * * @return the burn time for this fuel */ public int getBurnTime() { return burnTime; } /** * Sets the burn time for this fuel * * @param burnTime the burn time for this fuel */ public void setBurnTime(int burnTime) { this.burnTime = burnTime; } /** * Gets whether the furnace's fuel is burning or not. * * @return whether the furnace's fuel is burning or not. */ public boolean isBurning() { return this.burning; } /** * Sets whether the furnace's fuel is burning or not. * * @param burning true if the furnace's fuel is burning */ public void setBurning(boolean burning) { this.burning = burning; } public boolean isCancelled() { return cancelled; } public void setCancelled(boolean cancel) { this.cancelled = cancel; } }