From 890011a442b41bbb66d0973a9857c1977660ce49 Mon Sep 17 00:00:00 2001 From: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com> Date: Fri, 1 Nov 2024 08:16:15 -0400 Subject: [PATCH 1/4] Show a range's default value in config file Closes https://github.com/neoforged/NeoForge/issues/1643 --- src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java b/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java index 870ce31e09..5b2867abfc 100644 --- a/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java +++ b/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java @@ -363,7 +363,8 @@ public > ConfigValue defineInRange(String pat public > ConfigValue defineInRange(List path, Supplier defaultSupplier, V min, V max, Class clazz) { Range range = new Range<>(clazz, min, max); context.setRange(range); - comment("Range: " + range.toString()); + comment("Range: " + range); + comment("Default: " + defaultSupplier.get()); return define(path, defaultSupplier, range); } From f63847bb6725749a77da2fe68fccad645bb718b2 Mon Sep 17 00:00:00 2001 From: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com> Date: Fri, 1 Nov 2024 08:40:56 -0400 Subject: [PATCH 2/4] Update pr package From 96f5c7708903d897f4b99ad254cbd27f02841f18 Mon Sep 17 00:00:00 2001 From: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com> Date: Fri, 1 Nov 2024 09:11:25 -0400 Subject: [PATCH 3/4] reverse range and default --- src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java b/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java index 5b2867abfc..6b232adf7c 100644 --- a/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java +++ b/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java @@ -363,8 +363,8 @@ public > ConfigValue defineInRange(String pat public > ConfigValue defineInRange(List path, Supplier defaultSupplier, V min, V max, Class clazz) { Range range = new Range<>(clazz, min, max); context.setRange(range); - comment("Range: " + range); comment("Default: " + defaultSupplier.get()); + comment("Range: " + range); return define(path, defaultSupplier, range); } From 2044346631366c9364f499dd049bbcfe7365cf22 Mon Sep 17 00:00:00 2001 From: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com> Date: Sat, 2 Nov 2024 07:53:44 -0400 Subject: [PATCH 4/4] spacing!! --- .../java/net/neoforged/neoforge/common/ModConfigSpec.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java b/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java index 6b232adf7c..0bd991443d 100644 --- a/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java +++ b/src/main/java/net/neoforged/neoforge/common/ModConfigSpec.java @@ -363,8 +363,8 @@ public > ConfigValue defineInRange(String pat public > ConfigValue defineInRange(List path, Supplier defaultSupplier, V min, V max, Class clazz) { Range range = new Range<>(clazz, min, max); context.setRange(range); - comment("Default: " + defaultSupplier.get()); - comment("Range: " + range); + comment(" Default: " + defaultSupplier.get()); + comment(" Range: " + range); return define(path, defaultSupplier, range); }