mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-06 02:51:32 +01:00
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:
parent
d2c553652f
commit
48049f3870
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user