From 63285c55aa95057b0e65d469d3979aa3cab8fe00 Mon Sep 17 00:00:00 2001 From: Up Date: Thu, 1 Aug 2024 11:52:05 +0200 Subject: [PATCH] misc cleanup --- .../ennuil/ok_zoomer/config/screen/ConfigTextUtils.java | 6 ++++-- .../ok_zoomer/config/screen/OkZoomerConfigScreen.java | 5 +++-- .../java/io/github/ennuil/ok_zoomer/utils/OwoUtils.java | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/github/ennuil/ok_zoomer/config/screen/ConfigTextUtils.java b/src/main/java/io/github/ennuil/ok_zoomer/config/screen/ConfigTextUtils.java index 8a13579..f7d0e26 100644 --- a/src/main/java/io/github/ennuil/ok_zoomer/config/screen/ConfigTextUtils.java +++ b/src/main/java/io/github/ennuil/ok_zoomer/config/screen/ConfigTextUtils.java @@ -8,6 +8,8 @@ import org.quiltmc.config.api.metadata.NamingScheme; import org.quiltmc.config.api.values.TrackedValue; +import java.util.Locale; + public class ConfigTextUtils { private final Config config; private final NamingScheme scheme; @@ -34,10 +36,10 @@ public Component getOptionTextTooltip(TrackedValue trackedValue) { } public Component getEnumOptionText(TrackedValue trackedValue, ConfigEnums.ConfigEnum configEnum) { - return Component.translatable(String.format("config.%s.%s.%s", this.config.family(), this.scheme.coerce(trackedValue.key().toString()), configEnum.toString().toLowerCase())); + return Component.translatable(String.format("config.%s.%s.%s", this.config.family(), this.scheme.coerce(trackedValue.key().toString()), configEnum.toString().toLowerCase(Locale.ROOT))); } public Component getEnumOptionTextTooltip(TrackedValue trackedValue, ConfigEnums.ConfigEnum configEnum) { - return Component.translatable(String.format("config.%s.%s.%s.tooltip", this.config.family(), this.scheme.coerce(trackedValue.key().toString()), configEnum.toString().toLowerCase())); + return Component.translatable(String.format("config.%s.%s.%s.tooltip", this.config.family(), this.scheme.coerce(trackedValue.key().toString()), configEnum.toString().toLowerCase(Locale.ROOT))); } } diff --git a/src/main/java/io/github/ennuil/ok_zoomer/config/screen/OkZoomerConfigScreen.java b/src/main/java/io/github/ennuil/ok_zoomer/config/screen/OkZoomerConfigScreen.java index 1d882ca..78dd734 100644 --- a/src/main/java/io/github/ennuil/ok_zoomer/config/screen/OkZoomerConfigScreen.java +++ b/src/main/java/io/github/ennuil/ok_zoomer/config/screen/OkZoomerConfigScreen.java @@ -26,6 +26,7 @@ import org.quiltmc.config.api.values.ValueTreeNode; import org.quiltmc.loader.api.minecraft.ClientOnly; +import java.util.Locale; import java.util.Map; import java.util.Set; @@ -176,9 +177,9 @@ protected void init() { } this.entryListWidget.addCategory(Component.translatable("config.ok_zoomer.presets")); - var presetButton = CycleButton.builder(value -> Component.translatable(String.format("config.ok_zoomer.presets.preset.%s", value.toString().toLowerCase()))) + var presetButton = CycleButton.builder(value -> Component.translatable(String.format("config.ok_zoomer.presets.preset.%s", value.toString().toLowerCase(Locale.ROOT)))) .withValues(ConfigEnums.ZoomPresets.values()) - .withTooltip(value -> Tooltip.create(Component.translatable(String.format("config.ok_zoomer.presets.preset.%s.tooltip", value.toString().toLowerCase())))) + .withTooltip(value -> Tooltip.create(Component.translatable(String.format("config.ok_zoomer.presets.preset.%s.tooltip", value.toString().toLowerCase(Locale.ROOT))))) .withInitialValue(ConfigEnums.ZoomPresets.DEFAULT) .create(0, 0, 150, 20, Component.translatable("config.ok_zoomer.presets.preset")); diff --git a/src/main/java/io/github/ennuil/ok_zoomer/utils/OwoUtils.java b/src/main/java/io/github/ennuil/ok_zoomer/utils/OwoUtils.java index 9c2c050..27043d5 100644 --- a/src/main/java/io/github/ennuil/ok_zoomer/utils/OwoUtils.java +++ b/src/main/java/io/github/ennuil/ok_zoomer/utils/OwoUtils.java @@ -19,6 +19,6 @@ public class OwoUtils { public static void printOwo() { Random random = new Random(); - ZoomUtils.LOGGER.info(String.format("[Ok Zoomer] %s what's this", OWO_ARRAY[random.nextInt(OWO_ARRAY.length)])); + ZoomUtils.LOGGER.info("[Ok Zoomer] {} what's this", OWO_ARRAY[random.nextInt(OWO_ARRAY.length)]); } }