Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 89 lines 2.1 kB view raw
1package org.bukkit.event.inventory; 2 3import org.bukkit.block.Block; 4import org.bukkit.event.Cancellable; 5import org.bukkit.event.Event; 6import org.bukkit.inventory.ItemStack; 7 8/** 9 * Called when an ItemStack is successfully burned as fuel in a furnace. 10 */ 11public class FurnaceBurnEvent extends Event implements Cancellable { 12 private Block furnace; 13 private ItemStack fuel; 14 private int burnTime; 15 private boolean cancelled; 16 private boolean burning; 17 18 public FurnaceBurnEvent(Block furnace, ItemStack fuel, int burnTime) { 19 super(Type.FURNACE_BURN); 20 21 this.furnace = furnace; 22 this.fuel = fuel; 23 this.burnTime = burnTime; 24 this.cancelled = false; 25 this.burning = true; 26 } 27 28 /** 29 * Gets the block for the furnace involved in this event 30 * 31 * @return the block of the furnace 32 */ 33 public Block getFurnace() { 34 return furnace; 35 } 36 37 /** 38 * Gets the fuel ItemStack for this event 39 * 40 * @return the fuel ItemStack 41 */ 42 public ItemStack getFuel() { 43 return fuel; 44 } 45 46 /** 47 * Gets the burn time for this fuel 48 * 49 * @return the burn time for this fuel 50 */ 51 public int getBurnTime() { 52 return burnTime; 53 } 54 55 /** 56 * Sets the burn time for this fuel 57 * 58 * @param burnTime the burn time for this fuel 59 */ 60 public void setBurnTime(int burnTime) { 61 this.burnTime = burnTime; 62 } 63 64 /** 65 * Gets whether the furnace's fuel is burning or not. 66 * 67 * @return whether the furnace's fuel is burning or not. 68 */ 69 public boolean isBurning() { 70 return this.burning; 71 } 72 73 /** 74 * Sets whether the furnace's fuel is burning or not. 75 * 76 * @param burning true if the furnace's fuel is burning 77 */ 78 public void setBurning(boolean burning) { 79 this.burning = burning; 80 } 81 82 public boolean isCancelled() { 83 return cancelled; 84 } 85 86 public void setCancelled(boolean cancel) { 87 this.cancelled = cancel; 88 } 89}