From 4ee2d3b47cef5b17898702f7bc6a031b6b206523 Mon Sep 17 00:00:00 2001 From: wizjany Date: Tue, 16 Jul 2019 22:17:19 -0400 Subject: [PATCH] Move isAllowedToFly and setFlying to AbstractPlayer, protect them. --- .../com/sk89q/worldedit/entity/Player.java | 18 ------------------ .../platform/AbstractPlayerActor.java | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java index a51864ee4..3673d8842 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java @@ -187,24 +187,6 @@ public interface Player extends Entity, Actor { */ void floatAt(int x, int y, int z, boolean alwaysGlass); - /** - * Check whether the player is allowed to fly. - * - * @return true if allowed flight - */ - default boolean isAllowedToFly() { - return false; - } - - /** - * Set whether the player is currently flying. - * - * @param flying true to fly - */ - default void setFlying(boolean flying) { - throw new UnsupportedOperationException("setFlying unimplemented but isAllowedToFly was true (or unchecked)"); - } - /** * Get the point of the block that is being stood in. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index fb70c77ba..9c9319e58 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -328,6 +328,24 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { setPosition(Vector3.at(x + 0.5, y, z + 0.5)); } + /** + * Check whether the player is allowed to fly. + * + * @return true if allowed flight + */ + protected boolean isAllowedToFly() { + return false; + } + + /** + * Set whether the player is currently flying. + * + * @param flying true to fly + */ + protected void setFlying(boolean flying) { + } + + @Override public Location getBlockIn() { final Location location = getLocation();