geforkt von Mirrors/Paper
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 <evilseph@unaligned.org>
Dieser Commit ist enthalten in:
Ursprung
1325d8f15d
Commit
f82f291deb
@ -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
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren