From d63c8c113c8d878071e23439405f9fc2a439b275 Mon Sep 17 00:00:00 2001 From: sk89q Date: Tue, 19 Oct 2010 20:36:57 -0700 Subject: [PATCH] Fixed /ceil. --- src/WorldEditPlayer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/WorldEditPlayer.java b/src/WorldEditPlayer.java index 4453252d5..6cbd0b3ef 100644 --- a/src/WorldEditPlayer.java +++ b/src/WorldEditPlayer.java @@ -287,11 +287,11 @@ public boolean descendLevel() { public boolean ascendToCeiling(int clearance) { Vector pos = getBlockIn(); int x = pos.getBlockX(); + int initialY = pos.getBlockY(); int y = pos.getBlockY() + 2; - int initialY = y; int z = pos.getBlockZ(); - // Nothing above + // No free space above if (server.getBlockType(new Vector(x, y, z)) != 0) { return false; } @@ -299,10 +299,10 @@ public boolean ascendToCeiling(int clearance) { while (y <= 127) { // Found a ceiling! if (server.getBlockType(new Vector(x, y, z)) != 0) { - int platformY = Math.max(initialY, y - 3); + int platformY = Math.max(initialY, y - 3 - clearance); server.setBlockType(new Vector(x, platformY, z), BlockType.GLASS.getID()); - setPosition(new Vector(x, platformY + 1, z)); + setPosition(new Vector(x + 0.5, platformY + 1, z + 0.5)); return true; }