Also added extra KillAura check and fixed compatibility issues
This commit is contained in:
Rammelkast committed 2020-04-07 20:40:04 +02:00
1 parent 7c9a05ff92
commit 661718d001
11 files changed
+159 -54

No files matched your search

@@ -82,7 +82,7 @@ public class FlightCheck {
}
public static boolean isMovingExempt(Player player) {
return isDoing(player, MOVING_EXEMPT, -1);
return isDoing(player, MOVING_EXEMPT, -1) || player.isInsideVehicle();
}
private static boolean isDoing(Player player, Map<UUID, Long> map, double max) {
@@ -31,6 +31,9 @@ import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
import com.rammelkast.anticheatreloaded.check.CheckResult;
import com.rammelkast.anticheatreloaded.util.VersionUtil;
/**
* This check is an outdated mess which needs to be replaced
*/
public class SpeedCheck {
public static final Map<UUID, Integer> SPEED_VIOLATIONS = new HashMap<UUID, Integer>();
@@ -73,9 +76,16 @@ public class SpeedCheck {
&& ((player.getEyeLocation().getBlock().getRelative(BlockFace.UP).getType() != Material.AIR)
&& (player.getEyeLocation().getBlock().getRelative(BlockFace.UP)
.getType() != Material.CAVE_AIR))) {
reason = "while boosting on " + blockDownName.toLowerCase().replaceAll("_", " ") + " ";
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_SPRINT()
+ (blockDownName.equals("BLUE_ICE") ? 0.20925D : 0.165D);
if (player.getLocation().getBlock().getType().name().endsWith("TRAPDOOR")) {
reason = "while boosting on " + blockDownName.toLowerCase().replaceAll("_", " ")
+ " and trapdoor";
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_SPRINT()
+ (blockDownName.equals("BLUE_ICE") ? 0.35925D : 0.35D);
} else {
reason = "while boosting on " + blockDownName.toLowerCase().replaceAll("_", " ") + " ";
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_SPRINT()
+ (blockDownName.equals("BLUE_ICE") ? 0.20925D : 0.2D);
}
} else {
reason = "while sprinting ";
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_SPRINT();
@@ -99,7 +99,8 @@ public class WaterWalkCheck {
}
} else if (block.getRelative(BlockFace.DOWN).isLiquid()
&& !AntiCheatReloaded.getManager().getBackend().isAscending(player) && Utilities.cantStandAt(block)
&& Utilities.cantStandAt(block.getRelative(BlockFace.DOWN))) {
&& Utilities.cantStandAt(block.getRelative(BlockFace.DOWN)) && (y < 0.025
|| y == 0.09999999999999964 || y == 0.14999999999999947 || y == 0.04999999999999982)) {
if (WATER_ASCENSION_VIOLATIONS.containsKey(uuid)) {
int v = WATER_ASCENSION_VIOLATIONS.get(uuid);
if (v >= AntiCheatReloaded.getManager().getBackend().getMagic().WATER_ASCENSION_VIOLATION_MAX()) {