diff options
author | GunfighterJ <joseph.jenniges@gmail.com> | 2013-05-10 11:18:59 -0500 |
---|---|---|
committer | GunfighterJ <joseph.jenniges@gmail.com> | 2013-05-10 11:21:39 -0500 |
commit | 3042151fee43edfb9127ba8f69e144d1bb4429aa (patch) | |
tree | 6cca5c1f0c8f161b8a77f63f9a3a0bf13cb29a33 | |
parent | 59f67acfd0ce6f01a1fd09bd36b23d083f3d53d2 (diff) | |
download | Essentials-3042151fee43edfb9127ba8f69e144d1bb4429aa.tar Essentials-3042151fee43edfb9127ba8f69e144d1bb4429aa.tar.gz Essentials-3042151fee43edfb9127ba8f69e144d1bb4429aa.tar.lz Essentials-3042151fee43edfb9127ba8f69e144d1bb4429aa.tar.xz Essentials-3042151fee43edfb9127ba8f69e144d1bb4429aa.zip |
[Fix] Check initial direction when looking for a safe teleport spot
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Util.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index fc67fe21b..c907a1ad6 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -274,7 +274,6 @@ public class Util AIR_MATERIALS.add(Material.VINE.getId()); AIR_MATERIALS.add(Material.FENCE_GATE.getId()); AIR_MATERIALS.add(Material.WATER_LILY.getId()); - AIR_MATERIALS.add(Material.NETHER_FENCE.getId()); AIR_MATERIALS.add(Material.NETHER_WARTS.getId()); for (Integer integer : AIR_MATERIALS) @@ -358,7 +357,13 @@ public class Util break; } } - + + if (isBlockUnsafe(world, x, y, z)) + { + x = Math.round(loc.getX()) == origX ? x - 1 : x + 1; + z = Math.round(loc.getZ()) == origZ ? z - 1 : z + 1; + } + int i = 0; while (isBlockUnsafe(world, x, y, z)) { |