From 2a62ac59bfa5914466c6071944cb6fb4f303d990 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 18 Jun 2011 14:34:59 -0700 Subject: [PATCH] Added PlayerToggleSneakEvent.isSneaking(). By: sk89q --- .../bukkit/event/player/PlayerToggleSneakEvent.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java index 6df7091a4a..58d0bfbbc1 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java @@ -8,10 +8,21 @@ import org.bukkit.event.Cancellable; * @author azi */ public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable { + private boolean isSneaking; private boolean cancel = false; - public PlayerToggleSneakEvent(final Player player) { + public PlayerToggleSneakEvent(final Player player, boolean isSneaking) { super(Type.PLAYER_TOGGLE_SNEAK, player); + this.isSneaking = isSneaking; + } + + /** + * Returns whether the player is now sneaking. + * + * @return sneaking state + */ + public boolean isSneaking() { + return isSneaking; } /**