summaryrefslogtreecommitdiff
path: root/common/darkknight/jewelrycraft/item/ItemRing.java
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-20 11:47:07 +0200
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-20 11:47:07 +0200
commit188150bf829add4418cdbb15f679d705b489ff9e (patch)
treee7929744805fb38233697de46626b3301c8da158 /common/darkknight/jewelrycraft/item/ItemRing.java
parentd8bcaa05a5536f76aaf3d2286d3bb1c368586d1e (diff)
Working stuff
Diffstat (limited to 'common/darkknight/jewelrycraft/item/ItemRing.java')
-rw-r--r--common/darkknight/jewelrycraft/item/ItemRing.java16
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;