Skip to content

Commit

Permalink
* reintroduces CRIB name in WAILA if not default
Browse files Browse the repository at this point in the history
* renames default from unlocalized to localized name
  • Loading branch information
kstvr committed Jan 12, 2024
1 parent de55694 commit a1f8563
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ public String getName() {
if (getCrafterIcon() != null) {
name.append(getCrafterIcon().getDisplayName());
} else {
name.append(getInventoryName());
name.append(getLocalName());
}

if (mInventory[SLOT_CIRCUIT] != null) {
Expand Down Expand Up @@ -776,6 +776,8 @@ public ItemStack[] getSharedItems() {
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) {
Expand Down Expand Up @@ -823,7 +825,9 @@ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompou
}

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);
}

Expand Down

0 comments on commit a1f8563

Please sign in to comment.