mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 13:24:17 -07:00
Added PlayerToggleSneakEvent.isSneaking().
By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
@@ -8,10 +8,21 @@ import org.bukkit.event.Cancellable;
|
|||||||
* @author azi
|
* @author azi
|
||||||
*/
|
*/
|
||||||
public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable {
|
public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable {
|
||||||
|
private boolean isSneaking;
|
||||||
private boolean cancel = false;
|
private boolean cancel = false;
|
||||||
|
|
||||||
public PlayerToggleSneakEvent(final Player player) {
|
public PlayerToggleSneakEvent(final Player player, boolean isSneaking) {
|
||||||
super(Type.PLAYER_TOGGLE_SNEAK, player);
|
super(Type.PLAYER_TOGGLE_SNEAK, player);
|
||||||
|
this.isSneaking = isSneaking;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the player is now sneaking.
|
||||||
|
*
|
||||||
|
* @return sneaking state
|
||||||
|
*/
|
||||||
|
public boolean isSneaking() {
|
||||||
|
return isSneaking;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user