From f567d72909b7eb4448c63eb16af4ed8c60b4cec1 Mon Sep 17 00:00:00 2001 From: kstvr32 <109012629+kstvr32@users.noreply.github.com> Date: Fri, 12 Jan 2024 12:17:34 -0800 Subject: Reintroduce CRIB name to WAILA (#2447) * reintroduces CRIB name in WAILA if not default * renames default from unlocalized to localized name Co-authored-by: kstvr --- .../machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities/machines') diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java index cbbacf65d2..940877bf3e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java @@ -476,7 +476,7 @@ public class GT_MetaTileEntity_Hatch_CraftingInput_ME extends GT_MetaTileEntity_ if (getCrafterIcon() != null) { name.append(getCrafterIcon().getDisplayName()); } else { - name.append(getInventoryName()); + name.append(getLocalName()); } if (mInventory[SLOT_CIRCUIT] != null) { @@ -776,6 +776,8 @@ public class GT_MetaTileEntity_Hatch_CraftingInput_ME extends GT_MetaTileEntity_ public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { NBTTagCompound tag = accessor.getNBTData(); + if (tag.hasKey("name")) + currenttip.add(EnumChatFormatting.AQUA + tag.getString("name") + EnumChatFormatting.RESET); if (tag.hasKey("inventory")) { var inventory = tag.getTagList("inventory", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < inventory.tagCount(); ++i) { @@ -823,7 +825,9 @@ public class GT_MetaTileEntity_Hatch_CraftingInput_ME extends GT_MetaTileEntity_ } tag.setTag("inventory", inventory); - tag.setString("name", getName()); + if (!Objects.equals(getName(), getLocalName())) { + tag.setString("name", getName()); + } super.getWailaNBTData(player, tile, tag, world, x, y, z); } -- cgit