Added config for extra debugging.
This commit is contained in:
@ -63,6 +63,8 @@ public final class Config {
|
||||
}
|
||||
|
||||
public static class Server {
|
||||
public static ForgeConfigSpec.BooleanValue debugExtra;
|
||||
|
||||
public static ForgeConfigSpec.BooleanValue optimizationUseCache;
|
||||
|
||||
private static ForgeConfigSpec.ConfigValue<List<? extends String>> blockBreakGlobalOperationsRaw;
|
||||
@ -71,6 +73,12 @@ public final class Config {
|
||||
public static List<OperationItem> blockBreakOperationItems;
|
||||
|
||||
Server(ForgeConfigSpec.Builder builder) {
|
||||
builder.comment("Settings for debugging").push("debug");
|
||||
debugExtra = builder
|
||||
.comment("Whether to log more extensive debug information.")
|
||||
.define("debugExtra", false);
|
||||
builder.pop();
|
||||
|
||||
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.")
|
||||
|
@ -110,10 +110,12 @@ public class OnBlockBreakEventHandler {
|
||||
}
|
||||
|
||||
// Debug logging
|
||||
if (Config.Server.debugExtra.get()) {
|
||||
XpTools.LOGGER.debug("Completed block break event:");
|
||||
XpTools.LOGGER.debug("\tOperations: {}", operations);
|
||||
XpTools.LOGGER.debug("\tTime taken (nano seconds): {}", Duration.between(start, Instant.now()).toNanos());
|
||||
XpTools.LOGGER.debug("\tXP: {} -> {}", event.getExpToDrop(), xpToDrop);
|
||||
}
|
||||
|
||||
// Apply xp drop
|
||||
event.setExpToDrop((int)xpToDrop);
|
||||
|
Reference in New Issue
Block a user