diff options
Diffstat (limited to 'common/darkknight/jewelrycraft/item/ItemRing.java')
| -rw-r--r-- | common/darkknight/jewelrycraft/item/ItemRing.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/darkknight/jewelrycraft/item/ItemRing.java b/common/darkknight/jewelrycraft/item/ItemRing.java index 3941770..1207bac 100644 --- a/common/darkknight/jewelrycraft/item/ItemRing.java +++ b/common/darkknight/jewelrycraft/item/ItemRing.java @@ -18,6 +18,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; public class ItemRing extends ItemBase @@ -69,6 +70,21 @@ public class ItemRing extends ItemBase return 0; } + public String getItemDisplayName(ItemStack stack) + { + if (stack.hasTagCompound()) + { + if (stack.getTagCompound().hasKey("ingot")) + { + NBTTagCompound ingotNBT = (NBTTagCompound) stack.getTagCompound().getTag("ingot"); + ItemStack ingotStack = new ItemStack(0, 0, 0); + ingotStack.readFromNBT(ingotNBT); + return ingotStack.getDisplayName().replace("Ingot", " ").trim() + " " + ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + } + return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + public static void addMetal(ItemStack item, ItemStack metal) { NBTTagCompound itemStackData; |
