From 1f6f3152edeb4560d76b43aa0be5a8a2000e1699 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 7 May 2016 23:38:50 +0200 Subject: [PATCH] Added max damage display to the advanced tooltip --- .../de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java index 49dae44e4..334f28ff8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java @@ -63,8 +63,9 @@ public class TooltipEvent{ //Metadata int meta = event.getItemStack().getItemDamage(); + int max = event.getItemStack().getMaxDamage(); event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".meta.desc")+":"); - event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+meta); + event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+meta+(max > 0 ? "/"+max : "")); //Unlocalized Name String metaName = event.getItemStack().getItem().getUnlocalizedName(event.getItemStack());