From ad0bb92c8f194fb2ca5a5b521ec291e0e5fee08f Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 16 Oct 2010 16:56:59 -0700 Subject: [PATCH] Cleaned up /ascend. Now uses WorldEditPlayer.getBlockIn() for better accuracy. --- src/WorldEditPlayer.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/WorldEditPlayer.java b/src/WorldEditPlayer.java index 87a508b7e..e20535d5c 100644 --- a/src/WorldEditPlayer.java +++ b/src/WorldEditPlayer.java @@ -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; }