summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorRigby <rigby@onarandombox.com>2011-09-21 11:48:24 +0100
committerEvilSeph <evilseph@gmail.com>2011-09-21 16:25:26 -0400
commite6e9cec1e9b0b718d19816a767845a27fdffcb66 (patch)
treeaef99ca03664cc6e83e2341ab7dd373a784a1c83 /src/main/java/net/minecraft/server
parent1da2d1f5b619706ae64f317fe9a822e4ab9efeaf (diff)
downloadcraftbukkit-e6e9cec1e9b0b718d19816a767845a27fdffcb66.tar
craftbukkit-e6e9cec1e9b0b718d19816a767845a27fdffcb66.tar.gz
craftbukkit-e6e9cec1e9b0b718d19816a767845a27fdffcb66.tar.lz
craftbukkit-e6e9cec1e9b0b718d19816a767845a27fdffcb66.tar.xz
craftbukkit-e6e9cec1e9b0b718d19816a767845a27fdffcb66.zip
Added PlayerToggleSprint event and sprinting related API.
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java
index e0dfeac5..11c2438d 100644
--- a/src/main/java/net/minecraft/server/NetServerHandler.java
+++ b/src/main/java/net/minecraft/server/NetServerHandler.java
@@ -28,6 +28,7 @@ import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.player.PlayerToggleSneakEvent;
+import org.bukkit.event.player.PlayerToggleSprintEvent;
// CraftBukkit end
public class NetServerHandler extends NetHandler implements ICommandListener {
@@ -846,6 +847,15 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
return;
}
}
+
+ if (packet19entityaction.animation == 4 || packet19entityaction.animation == 5) {
+ PlayerToggleSprintEvent event = new PlayerToggleSprintEvent(this.getPlayer(), packet19entityaction.animation == 4);
+ this.server.getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) {
+ return;
+ }
+ }
// CraftBukkit end
if (packet19entityaction.animation == 1) {