Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.0' into los-containers
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/ac/grim/grimac/checks/impl/scaffolding/RotationPlace.java
  • Loading branch information
Axionize committed Sep 27, 2024
2 parents 6d3a172 + b27678c commit 6994975
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Empty file.
11 changes: 10 additions & 1 deletion src/main/java/ac/grim/grimac/manager/ConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6994975

Please sign in to comment.