Skip to content
Permalink
Browse files

Move isAllowedToFly and setFlying to AbstractPlayer, protect them.

  • Loading branch information...
wizjany committed Jul 17, 2019
1 parent 579ca8d commit 8d653931e0adcbd419dc84b6479dd467f7069279
@@ -187,24 +187,6 @@
*/
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.
*
@@ -328,6 +328,24 @@ public void floatAt(int x, int y, int z, boolean alwaysGlass) {
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();

0 comments on commit 8d65393

Please sign in to comment.
You can’t perform that action at this time.