From a753ee587d60d5c315a662a19643225b7b796457 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 15 Jan 2012 10:55:05 +0000 Subject: [PATCH] Implemented allowFlight methods. Thanks to Qala for the PR. --- .../java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index c86c8720ea..1730751171 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -538,6 +538,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getHandle().getFoodData().foodLevel = value; } + public boolean getAllowFlight() { + return getHandle().itemInWorldManager.player.abilities.canFly; + } + + public void setAllowFlight(boolean flight) { + getHandle().itemInWorldManager.player.abilities.canFly = flight; + } + public Location getBedSpawnLocation() { World world = getServer().getWorld(getHandle().spawnWorld); if ((world != null) && (getHandle().getBed() != null)) {