Add leash API. Adds BUKKIT-4459 and BUKKIT-4583
By: T00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.entity.EntityUnleashEvent;
|
||||
|
||||
/**
|
||||
* Called prior to an entity being unleashed due to a player's action.
|
||||
*/
|
||||
public class PlayerUnleashEntityEvent extends EntityUnleashEvent implements Cancellable {
|
||||
private final Player player;
|
||||
private boolean cancelled = false;
|
||||
|
||||
public PlayerUnleashEntityEvent(Entity entity, Player player) {
|
||||
super(entity, UnleashReason.PLAYER_UNLEASH);
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the player who is unleashing the entity.
|
||||
*
|
||||
* @return The player
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user