Add EntityToggleSwimEvent and isSwimming / setSwimming API
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Sent when an entity's swimming status is toggled.
|
||||
*/
|
||||
public class EntityToggleSwimEvent extends EntityEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
private boolean cancel = false;
|
||||
private final boolean isSwimming;
|
||||
|
||||
public EntityToggleSwimEvent(LivingEntity who, final boolean isSwimming) {
|
||||
super(who);
|
||||
this.isSwimming = isSwimming;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
public boolean isSwimming() {
|
||||
return isSwimming;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user