From 96b3a075aff4cd110c4b6dbfc94ae21814adae63 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 15 Jan 2012 10:55:33 +0000 Subject: Added Player set/getAllowFlight methods. Thanks to Qala for the PR. --- src/main/java/org/bukkit/entity/Player.java | 15 +++++++++++++++ src/test/java/org/bukkit/plugin/messaging/TestPlayer.java | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java index 7947b771..8132cf66 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -471,4 +471,19 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi * @return Bed Spawn Location if bed exists, otherwise null. */ public Location getBedSpawnLocation(); + + /** + * Determines if the Player is allowed to fly via jump key double-tap like in creative mode. + * + * @return True if the player is allowed to fly. + */ + public boolean getAllowFlight(); + + /** + * Sets if the Player is allowed to fly via jump key double-tap like in creative mode. + * + * @param flight If flight should be allowed. + */ + public void setAllowFlight(boolean flight); + } diff --git a/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java b/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java index 6fa07704..119903af 100644 --- a/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java +++ b/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java @@ -597,4 +597,12 @@ public class TestPlayer implements Player { public void playEffect(EntityEffect type) { throw new UnsupportedOperationException("Not supported yet."); } + + public boolean getAllowFlight() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setAllowFlight(boolean flight) { + throw new UnsupportedOperationException("Not supported yet."); + } } -- cgit v1.2.3