Added config for extra debugging.
This commit is contained in:
@ -63,6 +63,8 @@ public final class Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class Server {
|
public static class Server {
|
||||||
|
public static ForgeConfigSpec.BooleanValue debugExtra;
|
||||||
|
|
||||||
public static ForgeConfigSpec.BooleanValue optimizationUseCache;
|
public static ForgeConfigSpec.BooleanValue optimizationUseCache;
|
||||||
|
|
||||||
private static ForgeConfigSpec.ConfigValue<List<? extends String>> blockBreakGlobalOperationsRaw;
|
private static ForgeConfigSpec.ConfigValue<List<? extends String>> blockBreakGlobalOperationsRaw;
|
||||||
@ -71,6 +73,12 @@ public final class Config {
|
|||||||
public static List<OperationItem> blockBreakOperationItems;
|
public static List<OperationItem> blockBreakOperationItems;
|
||||||
|
|
||||||
Server(ForgeConfigSpec.Builder builder) {
|
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");
|
builder.comment("Settings for optimizations").push("optimization");
|
||||||
optimizationUseCache = builder
|
optimizationUseCache = builder
|
||||||
.comment("When enabled, the list of operations to perform per unique_id will be cached after the first calculation.")
|
.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
|
// Debug logging
|
||||||
XpTools.LOGGER.debug("Completed block break event:");
|
if (Config.Server.debugExtra.get()) {
|
||||||
XpTools.LOGGER.debug("\tOperations: {}", operations);
|
XpTools.LOGGER.debug("Completed block break event:");
|
||||||
XpTools.LOGGER.debug("\tTime taken (nano seconds): {}", Duration.between(start, Instant.now()).toNanos());
|
XpTools.LOGGER.debug("\tOperations: {}", operations);
|
||||||
XpTools.LOGGER.debug("\tXP: {} -> {}", event.getExpToDrop(), xpToDrop);
|
XpTools.LOGGER.debug("\tTime taken (nano seconds): {}", Duration.between(start, Instant.now()).toNanos());
|
||||||
|
XpTools.LOGGER.debug("\tXP: {} -> {}", event.getExpToDrop(), xpToDrop);
|
||||||
|
}
|
||||||
|
|
||||||
// Apply xp drop
|
// Apply xp drop
|
||||||
event.setExpToDrop((int)xpToDrop);
|
event.setExpToDrop((int)xpToDrop);
|
||||||
|
Reference in New Issue
Block a user