Skip to content

Commit

Permalink
Display custom name in MemoryCard tooltip (#614)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Robertz <dream-master@gmx.net>
  • Loading branch information
Worive and Dream-Master authored Dec 9, 2024
1 parent 403d80a commit 8187c77
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/appeng/items/tools/ToolMemoryCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ public void addCheckedInformation(final ItemStack stack, final EntityPlayer play

lines.add(String.format(local, freqTooltip));
}
if (data.hasKey("custom_name")) lines.add(data.getString("custom_name"));

if (data.hasKey("custom_name")) {
lines.add(data.getString("custom_name"));
} else if (data.hasKey("display") && data.getCompoundTag("display").hasKey("Name")) {
lines.add(data.getCompoundTag("display").getString("Name"));
}
}

/**
Expand Down

0 comments on commit 8187c77

Please sign in to comment.