forked from Upstream/Velocitab
Add option to configure the PAPIProxyBridge cache time
This commit is contained in:
parent
07fd9c306a
commit
a55eda8e52
@ -89,8 +89,14 @@ public class Settings {
|
||||
|
||||
@Getter
|
||||
@YamlKey("enable_papi_hook")
|
||||
@YamlComment("Whether to enable the PAPIProxyBridge hook for PAPI support")
|
||||
private boolean enablePapiHook = true;
|
||||
|
||||
@Getter
|
||||
@YamlKey("papi_cache_time")
|
||||
@YamlComment("How long in seconds to cache PAPI placeholders for. (0 to disable)")
|
||||
private int papiCacheTime = 30;
|
||||
|
||||
@Getter
|
||||
@YamlKey("enable_miniplaceholders_hook")
|
||||
@YamlComment("If you are using MINIMESSAGE formatting, enable this to support MiniPlaceholders in formatting.")
|
||||
|
@ -33,6 +33,7 @@ public class PAPIProxyBridgeHook extends Hook {
|
||||
public PAPIProxyBridgeHook(@NotNull Velocitab plugin) {
|
||||
super(plugin);
|
||||
this.api = PlaceholderAPI.getInstance();
|
||||
this.api.setCacheExpiry(plugin.getSettings().getPapiCacheTime());
|
||||
}
|
||||
|
||||
public CompletableFuture<String> formatPlaceholders(@NotNull String input, @NotNull Player player) {
|
||||
|
Loading…
Reference in New Issue
Block a user