From f82f291deb702393915c5a0d0f84dd42303f2b44 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 30 Jun 2011 23:03:26 -0400 Subject: [PATCH] Improved FurnaceBurn event. - Added the ability to set the burn time of the fuel. - Added the ability to set if a fuel should burn or not. By: EvilSeph --- .../event/inventory/FurnaceBurnEvent.java | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java b/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java index ed1f489bd7..dd60a903cd 100644 --- a/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java @@ -12,6 +12,7 @@ public class FurnaceBurnEvent extends Event implements Cancellable { private ItemStack fuel; private int burnTime; private boolean cancelled; + private boolean burning; public FurnaceBurnEvent(Block furnace, ItemStack fuel, int burnTime) { super(Type.FURNACE_BURN); @@ -20,6 +21,7 @@ public class FurnaceBurnEvent extends Event implements Cancellable { this.fuel = fuel; this.burnTime = burnTime; this.cancelled = false; + this.burning = true; } /** @@ -41,14 +43,41 @@ public class FurnaceBurnEvent extends Event implements Cancellable { } /** - * Gets the default burn time for this fuel + * Gets the burn time for this fuel * - * @return the default 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; + } + /** * Gets the cancellation state of this event. A cancelled event will not * be executed in the server, but will still pass to other plugins