Move floatAt logic to AbstractPlayer, add isAllowedToFly and setFlying.

This commit is contained in:
wizjany
2019-07-11 20:27:05 -04:00
parent 8545417b3a
commit 2cc6a367c6
6 changed files with 54 additions and 36 deletions

View File

@ -185,14 +185,13 @@ public class BukkitPlayer extends AbstractPlayerActor {
}
@Override
public void floatAt(int x, int y, int z, boolean alwaysGlass) {
if (alwaysGlass || !player.getAllowFlight()) {
super.floatAt(x, y, z, alwaysGlass);
return;
}
public boolean isAllowedToFly() {
return player.getAllowFlight();
}
setPosition(Vector3.at(x + 0.5, y, z + 0.5));
player.setFlying(true);
@Override
public void setFlying(boolean flying) {
player.setFlying(flying);
}
@Override