diff options
Diffstat (limited to 'src/main/java/org/bukkit/event/entity/EntityCombustEvent.java')
-rw-r--r-- | src/main/java/org/bukkit/event/entity/EntityCombustEvent.java | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java b/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java index 0587576e..9b3f38f3 100644 --- a/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java @@ -4,15 +4,17 @@ import org.bukkit.entity.Entity; import org.bukkit.event.Cancellable; /** - * Called when an entity combusts due to the sun. + * Called when an entity combusts. *<p /> * If an Entity Combust event is cancelled, the entity will not combust. */ public class EntityCombustEvent extends EntityEvent implements Cancellable { + private int duration; private boolean cancel; - public EntityCombustEvent(Entity what) { - super(Type.ENTITY_COMBUST, what); + public EntityCombustEvent(Entity combustee, int duration) { + super(Type.ENTITY_COMBUST, combustee); + this.duration = duration; this.cancel = false; } @@ -23,4 +25,21 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable { public void setCancelled(boolean cancel) { this.cancel = cancel; } + + /** + * @return the amount of time (in seconds) the combustee should be alight for + */ + public int getDuration() { + return duration; + } + + /** + * The number of seconds the combustee should be alight for. + * + * This value will only ever increase the combustion time, not decrease existing combustion times. + * @param duration the time in seconds to be alight for. + */ + public void setDuration(int duration) { + this.duration = duration; + } } |