mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
Make AreaEffectCloudApplyEvent cancellable
By: bermudalocket <bermudalckt@gmail.com>
This commit is contained in:
parent
68fb5a7b3f
commit
922e10ff3e
1 changed files with 13 additions and 1 deletions
|
@ -4,21 +4,33 @@ import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.entity.AreaEffectCloud;
|
import org.bukkit.entity.AreaEffectCloud;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a lingering potion applies it's effects. Happens
|
* Called when a lingering potion applies it's effects. Happens
|
||||||
* once every 5 ticks
|
* once every 5 ticks
|
||||||
*/
|
*/
|
||||||
public class AreaEffectCloudApplyEvent extends EntityEvent {
|
public class AreaEffectCloudApplyEvent extends EntityEvent implements Cancellable {
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private final List<LivingEntity> affectedEntities;
|
private final List<LivingEntity> affectedEntities;
|
||||||
|
private boolean cancelled = false;
|
||||||
|
|
||||||
public AreaEffectCloudApplyEvent(final AreaEffectCloud entity, final List<LivingEntity> affectedEntities) {
|
public AreaEffectCloudApplyEvent(final AreaEffectCloud entity, final List<LivingEntity> affectedEntities) {
|
||||||
super(entity);
|
super(entity);
|
||||||
this.affectedEntities = affectedEntities;
|
this.affectedEntities = affectedEntities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return this.cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean cancel) {
|
||||||
|
this.cancelled = cancel;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AreaEffectCloud getEntity() {
|
public AreaEffectCloud getEntity() {
|
||||||
return (AreaEffectCloud) entity;
|
return (AreaEffectCloud) entity;
|
||||||
|
|
Loading…
Reference in a new issue