@@ -197,6 +197,10 @@ public class CreatureSpawnEvent extends EntitySpawnEvent {
|
||||
* When a creature is spawned by the "/summon" command
|
||||
*/
|
||||
COMMAND,
|
||||
/**
|
||||
* When a creature is spawned by an enchantment
|
||||
*/
|
||||
ENCHANTMENT,
|
||||
/**
|
||||
* When a creature is spawned by plugins
|
||||
*/
|
||||
|
||||
@@ -11,7 +11,12 @@ import org.jetbrains.annotations.Nullable;
|
||||
public class EntityCombustByBlockEvent extends EntityCombustEvent {
|
||||
private final Block combuster;
|
||||
|
||||
@Deprecated
|
||||
public EntityCombustByBlockEvent(@Nullable final Block combuster, @NotNull final Entity combustee, final int duration) {
|
||||
this(combuster, combustee, (float) duration);
|
||||
}
|
||||
|
||||
public EntityCombustByBlockEvent(@Nullable final Block combuster, @NotNull final Entity combustee, final float duration) {
|
||||
super(combustee, duration);
|
||||
this.combuster = combuster;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,12 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class EntityCombustByEntityEvent extends EntityCombustEvent {
|
||||
private final Entity combuster;
|
||||
|
||||
@Deprecated
|
||||
public EntityCombustByEntityEvent(@NotNull final Entity combuster, @NotNull final Entity combustee, final int duration) {
|
||||
this(combuster, combustee, (float) duration);
|
||||
}
|
||||
|
||||
public EntityCombustByEntityEvent(@NotNull final Entity combuster, @NotNull final Entity combustee, final float duration) {
|
||||
super(combustee, duration);
|
||||
this.combuster = combuster;
|
||||
}
|
||||
|
||||
@@ -12,10 +12,15 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class EntityCombustEvent extends EntityEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private int duration;
|
||||
private float duration;
|
||||
private boolean cancel;
|
||||
|
||||
@Deprecated
|
||||
public EntityCombustEvent(@NotNull final Entity combustee, final int duration) {
|
||||
this(combustee, (float) duration);
|
||||
}
|
||||
|
||||
public EntityCombustEvent(@NotNull final Entity combustee, final float duration) {
|
||||
super(combustee);
|
||||
this.duration = duration;
|
||||
this.cancel = false;
|
||||
@@ -35,7 +40,7 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable {
|
||||
* @return the amount of time (in seconds) the combustee should be alight
|
||||
* for
|
||||
*/
|
||||
public int getDuration() {
|
||||
public float getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
@@ -47,6 +52,21 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable {
|
||||
*
|
||||
* @param duration the time in seconds to be alight for.
|
||||
*/
|
||||
public void setDuration(float duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of seconds the combustee should be alight for.
|
||||
* <p>
|
||||
* This value will only ever increase the combustion time, not decrease
|
||||
* existing combustion times.
|
||||
*
|
||||
* @param duration the time in seconds to be alight for.
|
||||
* @see #setDuration(float)
|
||||
* @deprecated duration is now a float
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public void setDuration(int duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user