Added config option for using the cache.

This commit is contained in:
2025-05-24 22:44:07 +01:00
parent 20a56f83e0
commit 042ebf10dc
3 changed files with 24 additions and 11 deletions

View File

@ -63,15 +63,23 @@ public final class Config {
}
public static class Server {
public static ForgeConfigSpec.BooleanValue optimizationUseCache;
private static ForgeConfigSpec.ConfigValue<List<? extends String>> blockBreakGlobalOperationsRaw;
public static List<GlobalOperationItem> blockBreakGlobalOperationItems;
private static ForgeConfigSpec.ConfigValue<List<? extends String>> blockBreakOperationsRaw;
public static List<OperationItem> blockBreakOperationItems;
Server(ForgeConfigSpec.Builder builder) {
builder.comment("Available operations: " + Arrays.toString(OperationType.values()));
builder.comment("Settings for optimizations").push("optimization");
optimizationUseCache = builder
.comment("When enabled, the list of operations to perform per unique_id will be cached after the first calculation.")
.comment("Although this does increase performance at the cost of RAM, the overall performance hit of this mod is tiny anyway... but oh well")
.define("optimizationUseCache", true);
builder.pop();
builder.comment("Settings for block breaking").push("block_breaking");
builder.comment("Available operations: " + Arrays.toString(OperationType.values()));
blockBreakGlobalOperationsRaw = builder
.comment("List of global operations. Format: '[operation],[min],[max],[priority]'")
.comment("Global operations are run before any unique operations.")