Skip to content

Commit

Permalink
declare more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Aug 6, 2024
1 parent 3a18475 commit 080599e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 080599e

Please sign in to comment.