From c5e04f2c8e0c5393d9a5ef63a87ae4f0094af301 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Thu, 7 May 2015 13:34:21 +0100 Subject: - Added EE3 EMC values, thank you to MineMarteen for providing the ThirdPartyManager code :) - Working on making it possible to translate every part of the mod - Created an interface modders can use to make an item wearable in the jewelry inventory and have special effects --- src/main/java/darkknight/jewelrycraft/item/ItemGoldObj.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/main/java/darkknight/jewelrycraft/item/ItemGoldObj.java') diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemGoldObj.java b/src/main/java/darkknight/jewelrycraft/item/ItemGoldObj.java index 6d20408..182644b 100644 --- a/src/main/java/darkknight/jewelrycraft/item/ItemGoldObj.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemGoldObj.java @@ -14,6 +14,7 @@ import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import darkknight.jewelrycraft.util.JewelryNBT; @@ -57,13 +58,13 @@ public class ItemGoldObj extends Item public String getItemStackDisplayName(ItemStack stack) { - if (stack != null && stack.hasTagCompound() && stack.getTagCompound().hasKey("target") && Item.getItemById(Integer.valueOf(stack.getTagCompound().getTag("target").toString().split(",")[0].substring(4).replace("s", ""))) != null && JewelryNBT.item(stack) != null) return "Golden " + JewelryNBT.item(stack).getDisplayName(); - return "Golden Object"; + if (stack != null && stack.hasTagCompound() && stack.getTagCompound().hasKey("target") && Item.getItemById(Integer.valueOf(stack.getTagCompound().getTag("target").toString().split(",")[0].substring(4).replace("s", ""))) != null && JewelryNBT.item(stack) != null) return StatCollector.translateToLocal("info." + Variables.MODID + ".golden") + " " + JewelryNBT.item(stack).getDisplayName(); + return StatCollector.translateToLocal("item." + Variables.MODID + ".goldObject.name"); } public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) { - if (displayInfo) if (stack != null && JewelryNBT.item(stack) != null && JewelryNBT.item(stack).getItem() instanceof ItemFood) list.add(EnumChatFormatting.DARK_PURPLE + "It's made of solid gold! How are you suppose to eat this?"); - else list.add(EnumChatFormatting.DARK_PURPLE + "Shiny, but useless :("); + if (displayInfo) if (stack != null && JewelryNBT.item(stack) != null && JewelryNBT.item(stack).getItem() instanceof ItemFood) list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("item." + Variables.MODID + ".goldObject.info.food")); + else list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("item." + Variables.MODID + ".goldObject.info.standard")); } } -- cgit v1.2.3