Skip to content

Commit

Permalink
Improved FurnaceBurn event.
Browse files Browse the repository at this point in the history
- Added the ability to set the burn time of the fuel.
- Added the ability to set if a fuel should burn or not.
  • Loading branch information
EvilSeph committed Jul 3, 2011
1 parent 35574b8 commit 38863ab
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -20,6 +21,7 @@ public FurnaceBurnEvent(Block furnace, ItemStack fuel, int burnTime) {
this.fuel = fuel;
this.burnTime = burnTime;
this.cancelled = false;
this.burning = true;
}

/**
Expand All @@ -41,14 +43,41 @@ public ItemStack getFuel() {
}

/**
* 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
Expand Down

0 comments on commit 38863ab

Please sign in to comment.