summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft
diff options
context:
space:
mode:
authorAlexander Hesse <webmasterœaquanasoft.de>2011-01-25 19:08:54 +0100
committerErik Broes <erikbroes@ripe.net>2011-02-08 17:12:51 +0100
commit6ad4ca2a426346e08228ce36564472468a8c2713 (patch)
tree23db4b38b07d43830c620e8bd47804cc8fdb1fcf /src/main/java/net/minecraft
parent1a983aceb395bea98789ee396b899d9bb4a6258b (diff)
downloadcraftbukkit-6ad4ca2a426346e08228ce36564472468a8c2713.tar
craftbukkit-6ad4ca2a426346e08228ce36564472468a8c2713.tar.gz
craftbukkit-6ad4ca2a426346e08228ce36564472468a8c2713.tar.lz
craftbukkit-6ad4ca2a426346e08228ce36564472468a8c2713.tar.xz
craftbukkit-6ad4ca2a426346e08228ce36564472468a8c2713.zip
Implemented Sneak event
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java
index 0ae1d3e6..3d54810f 100644
--- a/src/main/java/net/minecraft/server/NetServerHandler.java
+++ b/src/main/java/net/minecraft/server/NetServerHandler.java
@@ -24,6 +24,7 @@ import org.bukkit.event.player.PlayerItemEvent;
import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerMoveEvent;
+import org.bukkit.event.player.PlayerToggleSneakEvent;
import org.bukkit.plugin.Plugin;
// CraftBukkit end
@@ -652,6 +653,17 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
}
public void a(Packet19EntityAction packet19entityaction) {
+ // CraftBukkit: Toggle Sneak
+ if (packet19entityaction.b == 1 || packet19entityaction.b == 2) {
+ Player player = getPlayer();
+ PlayerToggleSneakEvent event = new PlayerToggleSneakEvent(Type.PLAYER_TOGGLE_SNEAK, player);
+ server.getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ return;
+ }
+ }
+ // CraftBukkit: Set Sneaking
+
if (packet19entityaction.b == 1) {
this.e.b(true);
} else if (packet19entityaction.b == 2) {