summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-08-08 23:00:09 +0100
committerKHobbits <rob@khobbits.co.uk>2012-08-08 23:00:09 +0100
commit17adafecf9ed58081c2c45dc8d5045a5d88ce597 (patch)
tree19fdaf5dac2c5fd4f2c723e61cd6cf03cb7ab987
parentdd12e5db66d89dc7310651a9860cf061141e0d67 (diff)
downloadEssentials-17adafecf9ed58081c2c45dc8d5045a5d88ce597.tar
Essentials-17adafecf9ed58081c2c45dc8d5045a5d88ce597.tar.gz
Essentials-17adafecf9ed58081c2c45dc8d5045a5d88ce597.tar.lz
Essentials-17adafecf9ed58081c2c45dc8d5045a5d88ce597.tar.xz
Essentials-17adafecf9ed58081c2c45dc8d5045a5d88ce597.zip
Fix /top so that glass counts as a real block.
-rw-r--r--Essentials/src/com/earth2me/essentials/Util.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtop.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java
index 68fb956ef..0b5c3e426 100644
--- a/Essentials/src/com/earth2me/essentials/Util.java
+++ b/Essentials/src/com/earth2me/essentials/Util.java
@@ -368,7 +368,7 @@ public class Util
while (isBlockUnsafe(world, x, y, z))
{
y += 1;
- if (y >= world.getHighestBlockYAt(x, z))
+ if (y >= world.getMaxHeight())
{
x += 1;
break;
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtop.java b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
index e91d0984a..fe7690646 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
@@ -20,8 +20,8 @@ public class Commandtop extends EssentialsCommand
{
final int topX = user.getLocation().getBlockX();
final int topZ = user.getLocation().getBlockZ();
- final int topY = user.getWorld().getHighestBlockYAt(topX, topZ);
- user.getTeleport().teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), new Trade(this.getName(), ess), TeleportCause.COMMAND);
+ final Location location = new Location(user.getWorld(), topX, user.getWorld().getMaxHeight(), topZ);
+ user.getTeleport().teleport(location, new Trade(this.getName(), ess), TeleportCause.COMMAND);
user.sendMessage(_("teleportTop"));
}
}