Fix freezeafk so that moving with mouse does not teleport you about. Add check for if some takes the ground away from you

This commit is contained in:
ementalo 2011-09-29 00:24:52 +01:00
parent d2c553652f
commit 48049f3870

View File

@ -94,16 +94,9 @@ public class EssentialsPlayerListener extends PlayerListener
final Location from = event.getFrom(); final Location from = event.getFrom();
final Location to = event.getTo().clone(); final Location to = event.getTo().clone();
to.setX(from.getX()); to.setX(from.getX());
to.setY(from.getY()); to.setY(from.getBlock().getTypeId() == 0 ? from.getY() - 1 : from.getY());
to.setZ(from.getZ()); to.setZ(from.getZ());
try event.setTo(to);
{
event.setTo(Util.getSafeDestination(to));
}
catch (Exception ex)
{
event.setTo(to);
}
return; return;
} }