|
13 | 13 | import net.minecraft.client.gui.narration.NarratableEntry; |
14 | 14 | import net.minecraft.client.input.MouseButtonEvent; |
15 | 15 | import net.minecraft.client.resources.language.I18n; |
| 16 | +import net.minecraft.locale.Language; |
16 | 17 | import net.minecraft.network.chat.Component; |
17 | 18 | import net.minecraft.network.chat.HoverEvent; |
18 | 19 | import net.minecraft.network.chat.MutableComponent; |
@@ -41,7 +42,7 @@ public class OptionList extends ContainerObjectSelectionList<OptionList.Entry> { |
41 | 42 | private static MutableComponent getOptionComponent(Option option) { |
42 | 43 | String friendlyKey = "modernfix.option.name." + option.getName(); |
43 | 44 | MutableComponent baseComponent = Component.literal(option.getSelfName()); |
44 | | - if(I18n.exists(friendlyKey)) |
| 45 | + if(Language.getInstance().has(friendlyKey)) |
45 | 46 | return Component.translatable(friendlyKey).withStyle(style -> style.withHoverEvent(new HoverEvent.ShowText(baseComponent))); |
46 | 47 | else |
47 | 48 | return baseComponent; |
@@ -168,7 +169,7 @@ public OptionEntry(String optionName, Option option) { |
168 | 169 | }).pos(75, 0).size(20, 20).build(); |
169 | 170 | String helpKey = "modernfix.option." + optionName; |
170 | 171 | String helpText = I18n.get(helpKey); |
171 | | - if(!I18n.exists(helpKey) || helpText == null || helpText.isBlank() || helpText.equals(helpKey)) { |
| 172 | + if(!Language.getInstance().has(helpKey) || helpText == null || helpText.isBlank() || helpText.equals(helpKey)) { |
172 | 173 | this.helpButton.active = false; |
173 | 174 | if(ModernFixPlatformHooks.INSTANCE.isDevEnv() && OPTIONS_MISSING_HELP.add(optionName)) |
174 | 175 | ModernFix.LOGGER.warn("Missing help for {}", optionName); |
|
0 commit comments