Fix false positive with horse and jump boost, added "max-setback-distance".

This commit is contained in:
Rammelkast committed 2020-07-29 14:06:49 +02:00
1 parent 9850f48a4e
commit 07f957cf35
8 files changed
+31 -27

No files matched your search

@@ -21,6 +21,8 @@ package com.rammelkast.anticheatreloaded.util;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
public class MovementManager {
// Ticks in air
@@ -161,5 +163,8 @@ public class MovementManager {
if (this.halfMovementHistoryCounter > 0)
this.halfMovementHistoryCounter--;
}
// Update "good location"
AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId()).setGoodLocation(from);
}
}
@@ -217,7 +217,8 @@ public class User {
* @return last known valid location
*/
public Location getGoodLocation(Location location) {
if (goodLocation == null) {
if (goodLocation == null || !location.getWorld().equals(goodLocation.getWorld())
|| location.distance(goodLocation) > config.getConfig().maxSetbackDistance.getValue()) {
return location;
}