mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-05 12:02:53 +00: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
1 changed files with 486 additions and 493 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue