Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Commit

Permalink
- added translation keys as names (#15)
Browse files Browse the repository at this point in the history
also #14 added now, forgot to mention that
  • Loading branch information
UltraBlackLinux committed May 12, 2021
1 parent b804faf commit 86151de
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Util;
Expand Down Expand Up @@ -117,6 +118,9 @@ private void renderGui(MatrixStack matrixStack, int mouseX, int mouseY) {
}
}

String itemName = value.get("name").getAsString().trim();
Text itemNameText = new TranslatableText(itemName);


int primaryColor;
try { primaryColor = RandomUtil.getColor(Config.get().minemenuFabric.primaryColor).getColor(); }
Expand All @@ -137,8 +141,8 @@ private void renderGui(MatrixStack matrixStack, int mouseX, int mouseY) {
primaryColor);

this.client.textRenderer.draw(matrixStack,
value.get("name").getAsString(),
centerX - this.client.textRenderer.getWidth(value.get("name").getAsString()) / 2.0F,
itemNameText,
centerX - this.client.textRenderer.getWidth(itemNameText) / 2.0F,
centerY + outerRadius + 10,
0xFFFFFF);
} else {
Expand Down

0 comments on commit 86151de

Please sign in to comment.