diff --git a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java index 7b0196412..80d103882 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java @@ -527,6 +527,13 @@ public class Settings extends Config { public static int TARGET_TIME = 65; } + @Comment("Settings related to tab completion") + public static final class Tab_Completions { + @Comment({"The time in seconds how long tab completions should remain in cache.", + "0 will disable caching. Lower values may be less performant."}) + public static int CACHE_EXPIRATION = 15; + } + @Comment({"Enable or disable parts of the plugin", "Note: A cache will use some memory if enabled"}) diff --git a/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java b/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java index dbf053c52..56a3ff8fa 100644 --- a/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java +++ b/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java @@ -56,7 +56,9 @@ import java.util.stream.Collectors; public class TabCompletions { private final Cache> cachedCompletionValues = - CacheBuilder.newBuilder().expireAfterWrite(15, TimeUnit.SECONDS).build(); + CacheBuilder.newBuilder() + .expireAfterWrite(Settings.Tab_Completions.CACHE_EXPIRATION, TimeUnit.SECONDS) + .build(); private final Command booleanTrueCompletion = new Command(null, false, "true", "", RequiredType.NONE, null) {};