forked from Upstream/Velocitab
Add a bit more validation to the PAPI cache time option
This commit is contained in:
parent
a55eda8e52
commit
4a0895cc8b
@ -94,7 +94,7 @@ public class Settings {
|
||||
|
||||
@Getter
|
||||
@YamlKey("papi_cache_time")
|
||||
@YamlComment("How long in seconds to cache PAPI placeholders for. (0 to disable)")
|
||||
@YamlComment("How long in seconds to cache PAPI placeholders for, in seconds. (0 to disable)")
|
||||
private int papiCacheTime = 30;
|
||||
|
||||
@Getter
|
||||
|
@ -33,7 +33,7 @@ public class PAPIProxyBridgeHook extends Hook {
|
||||
public PAPIProxyBridgeHook(@NotNull Velocitab plugin) {
|
||||
super(plugin);
|
||||
this.api = PlaceholderAPI.getInstance();
|
||||
this.api.setCacheExpiry(plugin.getSettings().getPapiCacheTime());
|
||||
this.api.setCacheExpiry(Math.max(0, plugin.getSettings().getPapiCacheTime()));
|
||||
}
|
||||
|
||||
public CompletableFuture<String> formatPlaceholders(@NotNull String input, @NotNull Player player) {
|
||||
|
Loading…
Reference in New Issue
Block a user