diff options
author | Rigby <rigby@onarandombox.com> | 2011-09-21 11:48:24 +0100 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2011-09-21 16:25:26 -0400 |
commit | e6e9cec1e9b0b718d19816a767845a27fdffcb66 (patch) | |
tree | aef99ca03664cc6e83e2341ab7dd373a784a1c83 /src/main/java/org | |
parent | 1da2d1f5b619706ae64f317fe9a822e4ab9efeaf (diff) | |
download | craftbukkit-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/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index e38ec9b0..7ce51a20 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -298,6 +298,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return getHandle().isSneaking(); } + public boolean isSprinting() { + return getHandle().at(); + } + + public void setSprinting(boolean sprinting) { + getHandle().g(sprinting); + } + public void loadData() { server.getHandle().playerFileData.b(getHandle()); } @@ -411,7 +419,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setGameMode(GameMode mode) { if (getHandle().netServerHandler == null) return; - + if (mode == null) { throw new IllegalArgumentException("Mode cannot be null"); } |