Make AreaEffectCloudApplyEvent cancellable

By: bermudalocket <bermudalckt@gmail.com>
This commit is contained in:
Bukkit/Spigot 2019-02-06 23:19:04 -05:00
parent 68fb5a7b3f
commit 922e10ff3e

View file

@ -4,21 +4,33 @@ import java.util.List;
import org.bukkit.entity.AreaEffectCloud;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Called when a lingering potion applies it's effects. Happens
* once every 5 ticks
*/
public class AreaEffectCloudApplyEvent extends EntityEvent {
public class AreaEffectCloudApplyEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final List<LivingEntity> affectedEntities;
private boolean cancelled = false;
public AreaEffectCloudApplyEvent(final AreaEffectCloud entity, final List<LivingEntity> affectedEntities) {
super(entity);
this.affectedEntities = affectedEntities;
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
@Override
public AreaEffectCloud getEntity() {
return (AreaEffectCloud) entity;