diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 5d121b82e..3d5851d93 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -95,9 +95,16 @@ public class EssentialsPlayerListener extends PlayerListener final Location from = event.getFrom(); final Location to = event.getTo().clone(); to.setX(from.getX()); - to.setY(from.getBlock().getTypeId() == 0 ? from.getY() - 1 : from.getY()); + to.setY(from.getY()); to.setZ(from.getZ()); - event.setTo(to); + try + { + event.setTo(Util.getSafeDestination(to)); + } + catch (Exception ex) + { + event.setTo(to); + } return; } |