diff --git a/src/main/java/dev/fire/TextUtil.java b/src/main/java/dev/fire/TextUtil.java index 9634327..ec4fbd3 100644 --- a/src/main/java/dev/fire/TextUtil.java +++ b/src/main/java/dev/fire/TextUtil.java @@ -158,7 +158,6 @@ public static Text replaceTags(Text text, boolean isTabList) { for (Map.Entry entry : DefaultConfig.oldChatTags.entrySet()) { String key = entry.getKey(); - ChatTag chattag = entry.getValue(); MiniMessageChatTag custom = c.chatTags.get(key); ChatTag replacetag = DefaultConfig.newChatTags.get(key); diff --git a/src/main/java/dev/fire/config/Config.java b/src/main/java/dev/fire/config/Config.java index dc9eef6..3944567 100644 --- a/src/main/java/dev/fire/config/Config.java +++ b/src/main/java/dev/fire/config/Config.java @@ -39,23 +39,29 @@ public static Map convertToMinimessage(Map chatTags.get(key).mainvalue, - opt -> chatTags.get(key).mainvalue = opt - ) - .controller(StringControllerBuilder::create) - .build()) - .option(Option.createBuilder(String.class) - .name(Text.literal("Short Tag Value")) - .description(OptionDescription.createBuilder() - .text(Text.literal("Defines what the tag looks like when its compressed")) - .build()) - .binding( - DefaultConfig.oldChatTags.get(key).toShortValue(), - () -> chatTags.get(key).shortvalue, - opt -> chatTags.get(key).shortvalue = opt - ) - .controller(StringControllerBuilder::create) - .build()); + .description(OptionDescription.of(Text.literal(name + " Chat Tag"))); + if (key == "vip") { + optionGroup.option(Option.createBuilder(boolean.class) + .name(Text.literal("Vip Enabled")) + .description(OptionDescription.createBuilder() + .text(Text.literal("Toggles weather the VIP tag is shown.")) + .text(Text.literal("This also affects the VIP tag and VIP founding badge in player's profiles when you /whois them.")) + .text(Text.literal("")) + .build()) + .binding( + DefaultConfig.VipEnabled, + () -> VipEnabled, + opt -> VipEnabled = opt + ) + .controller(TickBoxControllerBuilder::create) + .build()); + } + + optionGroup + .option(Option.createBuilder(String.class) + .name(Text.literal("Main Text Value")) + .description(OptionDescription.createBuilder() + .text(Text.literal("Formatted in MiniMessage")) + .build()) + .binding( + mainDefault, + () -> chatTags.get(key).mainvalue, + opt -> chatTags.get(key).mainvalue = opt + ) + .controller(StringControllerBuilder::create) + .build()) + .option(Option.createBuilder(String.class) + .name(Text.literal("Short Tag Value")) + .description(OptionDescription.createBuilder() + .text(Text.literal("Defines what the tag looks like when its compressed")) + .build()) + .binding( + shortDefault, + () -> chatTags.get(key).shortvalue, + opt -> chatTags.get(key).shortvalue = opt + ) + .controller(StringControllerBuilder::create) + .build()); + + return optionGroup; + } @@ -187,21 +220,7 @@ private OptionGroup.Builder groupBuilder(String key, String name) { private ConfigCategory.Builder miscCategory() { return ConfigCategory.createBuilder() .name(Text.literal("Misc. Toggles")) - .tooltip(Text.literal("Toggle visibility of chat tags.")) - .option(Option.createBuilder(boolean.class) - .name(Text.literal("Vip Enabled")) - .description(OptionDescription.createBuilder() - .text(Text.literal("Toggles weather the VIP tag is shown.")) - .text(Text.literal("This also affects the VIP tag and VIP founding badge in player's profiles when you /whois them.")) - .text(Text.literal("")) - .build()) - .binding( - DefaultConfig.VipEnabled, - () -> VipEnabled, - opt -> VipEnabled = opt - ) - .controller(TickBoxControllerBuilder::create) - .build()) + .tooltip(Text.literal("Some random options.")) .option(Option.createBuilder(boolean.class) .name(Text.literal("Disable Mod")) .description(OptionDescription.createBuilder() @@ -251,9 +270,7 @@ private ConfigCategory.Builder staffChatTags() { staffChatTagList.forEach(k -> { String key = (String) k; String name = DefaultConfig.newChatTags.get(key).TextContent; - if (key == "emeritus") { - name = "Emeritus"; - } + OptionGroup.Builder builder = groupBuilder(key,name); configBuilder.group(builder.build()); @@ -302,6 +319,9 @@ private ConfigCategory.Builder specialChatTags() { specialChatTagList.forEach(k -> { String key = (String) k; String name = DefaultConfig.newChatTags.get(key).TextContent; + if (Objects.equals(key, "emeritus")) { + name = "Emeritus"; + } OptionGroup.Builder builder = groupBuilder(key,name); if (Objects.equals(key, "vip")) {