Made /up and /ceil benefit from fly mode.

This avoids littering the world with floating glass blocks when possible.
This commit is contained in:
TomyLobo
2013-10-23 19:03:09 +02:00
parent 90e1788781
commit dcd1c7cee8
3 changed files with 43 additions and 5 deletions

View File

@ -19,6 +19,7 @@
package com.sk89q.worldedit.bukkit;
import com.sk89q.worldedit.blocks.BlockID;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -150,4 +151,15 @@ public class BukkitPlayer extends LocalPlayer {
public boolean hasCreativeMode() {
return player.getGameMode() == GameMode.CREATIVE;
}
@Override
public void floatAt(int x, int y, int z, boolean alwaysGlass) {
if (alwaysGlass || !player.getAllowFlight()) {
super.floatAt(x, y, z, alwaysGlass);
return;
}
setPosition(new Vector(x + 0.5, y, z + 0.5));
player.setFlying(true);
}
}