mirror of https://github.com/PaperMC/Paper.git
47 lines
1.0 KiB
Java
47 lines
1.0 KiB
Java
package com.destroystokyo.paper.event.entity;
|
|
|
|
import org.bukkit.entity.LivingEntity;
|
|
import org.bukkit.event.Cancellable;
|
|
import org.bukkit.event.HandlerList;
|
|
import org.bukkit.event.entity.EntityEvent;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
/**
|
|
* Called when an entity jumps
|
|
* <p>
|
|
* Cancelling the event will stop the entity from jumping
|
|
*/
|
|
public class EntityJumpEvent extends EntityEvent implements Cancellable {
|
|
private static final HandlerList handlers = new HandlerList();
|
|
private boolean canceled;
|
|
|
|
public EntityJumpEvent(@NotNull LivingEntity entity) {
|
|
super(entity);
|
|
}
|
|
|
|
@NotNull
|
|
@Override
|
|
public LivingEntity getEntity() {
|
|
return (LivingEntity) entity;
|
|
}
|
|
|
|
public boolean isCancelled() {
|
|
return canceled;
|
|
}
|
|
|
|
public void setCancelled(boolean cancel) {
|
|
canceled = cancel;
|
|
}
|
|
|
|
@NotNull
|
|
@Override
|
|
public HandlerList getHandlers() {
|
|
return handlers;
|
|
}
|
|
|
|
@NotNull
|
|
public static HandlerList getHandlerList() {
|
|
return handlers;
|
|
}
|
|
}
|