From 080599e69eb76dc64e59a7b2502c86839e7f4723 Mon Sep 17 00:00:00 2001 From: xGinko Date: Wed, 7 Aug 2024 00:32:18 +0200 Subject: [PATCH] declare more readable --- .../aef/modules/illegals/items/IllegalItemModule.java | 11 +++++------ .../aef/modules/illegals/items/IllegalItemModule.java | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) 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