From 8a0e59756b0799661b1701aaef83b549e0921f2a Mon Sep 17 00:00:00 2001 From: direwolf20 <39863894+Direwolf20-MC@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:57:55 -0500 Subject: [PATCH] Fix Modification Table Screen language stuff. --- .../client/screens/ModificationTableScreen.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java index d060d6b..924450c 100644 --- a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java +++ b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java @@ -24,6 +24,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.neoforged.neoforge.client.gui.widget.ScrollPanel; +import net.neoforged.neoforge.common.I18nExtension; import net.neoforged.neoforge.network.PacketDistributor; @@ -54,11 +55,11 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partia int relY = (this.height) / 2; //guiGraphics.drawCenteredString(font, ForgeI18n.getPattern(String.format("%s.%s", MiningGadgets.MOD_ID, "text.modification_table")), relX, relY - 100, 0xFFFFFF); - guiGraphics.drawCenteredString(font, MiningGadgets.MOD_ID + "text.modification_table", relX, relY - 100, 0xFFFFFF); + guiGraphics.drawCenteredString(font, Component.translatable(MiningGadgets.MOD_ID + ".text.modification_table"), relX, relY - 100, 0xFFFFFF); if (this.container.getUpgradesCache().size() == 0) { - //String string = ForgeI18n.getPattern(String.format("%s.%s", MiningGadgets.MOD_ID, "text.empty_table_helper")); - String string = MiningGadgets.MOD_ID + "text.empty_table_helper"; + String string = I18nExtension.parseMessage(String.format("%s.%s", MiningGadgets.MOD_ID, "text.empty_table_helper")); + //String string = MiningGadgets.MOD_ID + ".text.empty_table_helper"; String[] parts = string.split("\n"); for (int i = 0; i < parts.length; i++) { drawScaledCenteredString(guiGraphics, (relX + 17) - (font.width(parts[0]) / 2), (relY - 68) + (i * font.lineHeight), .8f, parts[i], 0xFFFFFF);