diff --git a/build.gradle.kts b/build.gradle.kts index 49a0316ecf..e9b722928d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -38,7 +38,7 @@ repositories { } dependencies { - implementation("com.github.retrooper:packetevents-spigot:2.5.0-SNAPSHOT") + implementation("com.github.retrooper:packetevents-spigot:2.5.1-SNAPSHOT") implementation("co.aikar:acf-paper:0.5.1-SNAPSHOT") implementation("club.minnced:discord-webhooks:0.8.0") // Newer versions include kotlin-stdlib, which leads to incompatibility with plugins that use Kotlin implementation("it.unimi.dsi:fastutil:8.5.13") diff --git a/src/main/java/ac/grim/grimac/checks/impl/scaffolding/MultiPlace.java b/src/main/java/ac/grim/grimac/checks/impl/scaffolding/MultiPlace.java index dc0e184e45..3d5aeab809 100644 --- a/src/main/java/ac/grim/grimac/checks/impl/scaffolding/MultiPlace.java +++ b/src/main/java/ac/grim/grimac/checks/impl/scaffolding/MultiPlace.java @@ -56,7 +56,7 @@ public void onBlockPlace(final BlockPlace place) { @Override public void onPacketReceive(PacketReceiveEvent event) { - if (WrapperPlayClientPlayerFlying.isFlying(event.getPacketType())) { + if (WrapperPlayClientPlayerFlying.isFlying(event.getPacketType()) && !player.packetStateData.lastPacketWasTeleport && !player.packetStateData.lastPacketWasOnePointSeventeenDuplicate) { hasPlaced = false; } } diff --git a/src/main/java/ac/grim/grimac/checks/impl/scaffolding/RotationPlace.java b/src/main/java/ac/grim/grimac/checks/impl/scaffolding/RotationPlace.java new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/main/java/ac/grim/grimac/manager/ConfigManager.java b/src/main/java/ac/grim/grimac/manager/ConfigManager.java index 496ca0b7da..9c9bd124cc 100644 --- a/src/main/java/ac/grim/grimac/manager/ConfigManager.java +++ b/src/main/java/ac/grim/grimac/manager/ConfigManager.java @@ -3,6 +3,7 @@ import ac.grim.grimac.GrimAC; import ac.grim.grimac.GrimAPI; import ac.grim.grimac.utils.anticheat.LogUtil; +import ac.grim.grimac.utils.math.GrimMath; import github.scarsz.configuralize.DynamicConfig; import github.scarsz.configuralize.Language; import lombok.Getter; @@ -77,7 +78,15 @@ public void reload() { } catch (Exception e) { throw new RuntimeException("Failed to load config", e); } - maxPingTransaction = config.getIntElse("max-transaction-time", 60); + + final int configuredMaxTransactionTime = config.getIntElse("max-transaction-time", 60); + maxPingTransaction = (int) GrimMath.clamp(configuredMaxTransactionTime, 1, 180); + if (maxPingTransaction != configuredMaxTransactionTime) { + LogUtil.warn("Detected invalid max-transaction-time! This setting is clamped between 1 and 180 to prevent issues. " + + "Changed: " + configuredMaxTransactionTime + " -> " + maxPingTransaction); + LogUtil.warn("Attempting to disable or set this too high can result in memory usage issues."); + } + ignoredClientPatterns.clear(); for (String string : config.getStringList("client-brand.ignored-clients")) { try {