mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Cleaned up /ascend. Now uses WorldEditPlayer.getBlockIn() for better accuracy.
This commit is contained in:
parent
263417550b
commit
ad0bb92c8f
@ -169,27 +169,24 @@ public abstract class WorldEditPlayer {
|
||||
* @return true if a spot was found
|
||||
*/
|
||||
public boolean ascendLevel() {
|
||||
Vector pos = getPosition();
|
||||
Vector pos = getBlockIn();
|
||||
int x = pos.getBlockX();
|
||||
int y = pos.getBlockY();
|
||||
int z = pos.getBlockZ();
|
||||
|
||||
byte free = 0;
|
||||
byte spots = 0;
|
||||
boolean inFree = false;
|
||||
|
||||
while (y <= 129) {
|
||||
if (server.getBlockType(new Vector(x, y, z)) == 0) {
|
||||
free++;
|
||||
} else {
|
||||
free = 0;
|
||||
inFree = false;
|
||||
}
|
||||
|
||||
if (free == 2 && inFree == false) {
|
||||
inFree = true;
|
||||
if (free == 2) {
|
||||
spots++;
|
||||
if (y >= 129 || spots == 2) {
|
||||
if (spots == 2) {
|
||||
setPosition(new Vector(x + 0.5, y - 1, z + 0.5));
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user