diff --git a/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/illegals/items/IllegalItemModule.java b/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/illegals/items/IllegalItemModule.java index 3b30cbe8..ef8408aa 100644 --- a/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/illegals/items/IllegalItemModule.java +++ b/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/illegals/items/IllegalItemModule.java @@ -150,12 +150,11 @@ private void onChunkLoad(ChunkLoadEvent event) { } this.listenerCooldowns = Caffeine.newBuilder().expireAfterWrite(Duration.ofMinutes(5)).build(); - this.createIfAbsent = k -> new ExpiringSet<>(Duration.ofMillis( - config.getInt(configPath+".check-rate-limit-millis", 3000, """ - The time in milliseconds to wait before performing another check,\s - if a check was positive. Helps with lag resulting from repeatedly\s - checking illegals.""") - )); + final Duration delay = Duration.ofMillis(config.getInt(configPath+".check-rate-limit-millis", 3000, """ + The time in milliseconds to wait before performing another check,\s + if a check was positive. Helps with lag resulting from repeatedly\s + checking illegals.""")); + this.createIfAbsent = eventClass -> new ExpiringSet<>(delay); } @Override diff --git a/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/illegals/items/IllegalItemModule.java b/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/illegals/items/IllegalItemModule.java index 30c838ad..97e5cd37 100644 --- a/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/illegals/items/IllegalItemModule.java +++ b/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/illegals/items/IllegalItemModule.java @@ -152,12 +152,11 @@ private void onChunkLoad(ChunkLoadEvent event) { } this.listenerCooldowns = Caffeine.newBuilder().expireAfterWrite(Duration.ofMinutes(5)).build(); - this.createIfAbsent = k -> new ExpiringSet<>(Duration.ofMillis( - config.getInt(configPath+".check-rate-limit-millis", 3000, - "The time in milliseconds to wait before performing another check,\n" + - "if a check was positive. Helps with lag resulting from repeatedly\n" + - "checking illegals.") - )); + final Duration delay = Duration.ofMillis(config.getInt(configPath+".check-rate-limit-millis", 3000, + "The time in milliseconds to wait before performing another check,\n" + + "if a check was positive. Helps with lag resulting from repeatedly\n" + + "checking illegals.")); + this.createIfAbsent = eventClass -> new ExpiringSet<>(delay); } @Override