From 9421587f9dc0ae11eb1d1883f736bca57096e8dd Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 4 Dec 2022 19:13:57 +0000 Subject: [PATCH] Switch to using JVM args for debugging --- .../com/minelittlepony/unicopia/Debug.java | 33 ++----------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/Debug.java b/src/main/java/com/minelittlepony/unicopia/Debug.java index cbc9b9ec..581e5e28 100644 --- a/src/main/java/com/minelittlepony/unicopia/Debug.java +++ b/src/main/java/com/minelittlepony/unicopia/Debug.java @@ -1,33 +1,6 @@ package com.minelittlepony.unicopia; -import java.util.HashMap; -import java.util.Map; - -import net.fabricmc.loader.api.FabricLoader; - -public final class Debug { - public static final boolean DEBUG_SPELLBOOK_CHAPTERS; - public static final boolean DEBUG_COMMANDS; - - static { - Map args = parseArguments(FabricLoader.getInstance().getLaunchArguments(true)); - DEBUG_SPELLBOOK_CHAPTERS = "true".equalsIgnoreCase(args.getOrDefault("--unicopia.debug.spellbookChapters", "false")); - DEBUG_COMMANDS = "true".equalsIgnoreCase(args.getOrDefault("--unicopia.debug.commands", "false")); - } - - static Map parseArguments(String[] args) { - Map arguments = new HashMap<>(); - - for (int i = 0; i < args.length; i++) { - String arg = args[i]; - String next = i < args.length - 1 ? args[i + 1] : null; - - if (arg.startsWith("--") && next != null && !next.startsWith("--")) { - arguments.put(arg, next); - i++; - } - } - - return arguments; - } +public interface Debug { + boolean DEBUG_SPELLBOOK_CHAPTERS = Boolean.getBoolean("unicopia.debug.spellbookChapters"); + boolean DEBUG_COMMANDS = Boolean.getBoolean("unicopia.debug.commands"); }