aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/machines
diff options
context:
space:
mode:
authorkstvr32 <109012629+kstvr32@users.noreply.github.com>2024-01-12 12:17:34 -0800
committerGitHub <noreply@github.com>2024-01-12 21:17:34 +0100
commitf567d72909b7eb4448c63eb16af4ed8c60b4cec1 (patch)
tree62d35da129465e9dab9e7be89f7509ce28d516a6 /src/main/java/gregtech/common/tileentities/machines
parent0bbd5f72b17f212b4dcdcc5268b8c2dd1ed68e5c (diff)
downloadGT5-Unofficial-f567d72909b7eb4448c63eb16af4ed8c60b4cec1.tar.gz
GT5-Unofficial-f567d72909b7eb4448c63eb16af4ed8c60b4cec1.tar.bz2
GT5-Unofficial-f567d72909b7eb4448c63eb16af4ed8c60b4cec1.zip
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 <kstvr@kstvr.com>
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java8
1 files changed, 6 insertions, 2 deletions
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<String> 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);
}