Skip to content

Commit

Permalink
Fix Modification Table Screen language stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
Direwolf20-MC committed Feb 16, 2024
1 parent ac9d29b commit 8a0e597
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8a0e597

Please sign in to comment.