diff --git a/src/main/java/mekanism/common/item/ItemBalloon.java b/src/main/java/mekanism/common/item/ItemBalloon.java index 5ed5dd7180c..90ffafe19c7 100644 --- a/src/main/java/mekanism/common/item/ItemBalloon.java +++ b/src/main/java/mekanism/common/item/ItemBalloon.java @@ -1,7 +1,7 @@ package mekanism.common.item; -import java.util.List; - +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import mekanism.api.Coord4D; import mekanism.api.EnumColor; import mekanism.api.Pos3D; @@ -17,10 +17,11 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class ItemBalloon extends ItemMekanism { @@ -74,14 +75,20 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer @Override public String getItemStackDisplayName(ItemStack stack) { - String color = getColor(stack).getDyedName(); + EnumColor color = getColor(stack); + String dyeName = color.getDyedName(); + + if(StatCollector.canTranslate(getUnlocalizedName(stack) + "." + color.dyeName)) + { + return LangUtils.localize(getUnlocalizedName(stack) + "." + color.dyeName); + } if(getColor(stack) == EnumColor.BLACK) { - color = EnumColor.DARK_GREY + getColor(stack).getDyeName(); + dyeName = EnumColor.DARK_GREY + color.getDyeName(); } - return color + " " + LangUtils.localize("tooltip.balloon"); + return dyeName + " " + LangUtils.localize("tooltip.balloon"); } @Override diff --git a/src/main/java/mekanism/common/item/ItemBlockMachine.java b/src/main/java/mekanism/common/item/ItemBlockMachine.java index a9eba495199..9f32a843775 100644 --- a/src/main/java/mekanism/common/item/ItemBlockMachine.java +++ b/src/main/java/mekanism/common/item/ItemBlockMachine.java @@ -1,13 +1,15 @@ package mekanism.common.item; +import cofh.api.energy.IEnergyContainerItem; +import cpw.mods.fml.common.Optional.Interface; +import cpw.mods.fml.common.Optional.InterfaceList; +import cpw.mods.fml.common.Optional.Method; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; import ic2.api.item.IElectricItemManager; import ic2.api.item.ISpecialElectricItem; - -import java.util.List; -import java.util.Map; - import mekanism.api.Coord4D; import mekanism.api.EnumColor; import mekanism.api.MekanismConfig.general; @@ -18,25 +20,14 @@ import mekanism.common.Mekanism; import mekanism.common.Tier.BaseTier; import mekanism.common.Upgrade; -import mekanism.common.base.IElectricChest; -import mekanism.common.base.IFactory; -import mekanism.common.base.IRedstoneControl; +import mekanism.common.base.*; import mekanism.common.base.IRedstoneControl.RedstoneControl; -import mekanism.common.base.ISideConfiguration; -import mekanism.common.base.ISustainedData; -import mekanism.common.base.ISustainedInventory; -import mekanism.common.base.ISustainedTank; -import mekanism.common.base.IUpgradeTile; import mekanism.common.block.BlockMachine.MachineType; import mekanism.common.integration.IC2ItemManager; import mekanism.common.inventory.InventoryElectricChest; import mekanism.common.network.PacketElectricChest.ElectricChestMessage; import mekanism.common.network.PacketElectricChest.ElectricChestPacketType; -import mekanism.common.tile.TileEntityBasicBlock; -import mekanism.common.tile.TileEntityElectricBlock; -import mekanism.common.tile.TileEntityElectricChest; -import mekanism.common.tile.TileEntityFactory; -import mekanism.common.tile.TileEntityPortableTank; +import mekanism.common.tile.*; import mekanism.common.util.LangUtils; import mekanism.common.util.MekanismUtils; import net.minecraft.block.Block; @@ -53,6 +44,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants.NBT; import net.minecraftforge.common.util.ForgeDirection; @@ -60,12 +52,9 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; -import cofh.api.energy.IEnergyContainerItem; -import cpw.mods.fml.common.Optional.Interface; -import cpw.mods.fml.common.Optional.InterfaceList; -import cpw.mods.fml.common.Optional.Method; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; +import java.util.Map; /** * Item class for handling multiple machine block IDs. @@ -149,10 +138,14 @@ public String getItemStackDisplayName(ItemStack itemstack) if(type == MachineType.BASIC_FACTORY || type == MachineType.ADVANCED_FACTORY || type == MachineType.ELITE_FACTORY) { - String tier = type == MachineType.BASIC_FACTORY ? BaseTier.BASIC.getLocalizedName() : (type == MachineType.ADVANCED_FACTORY ? - BaseTier.ADVANCED.getLocalizedName() : BaseTier.ELITE.getLocalizedName()); - - return tier + " " + RecipeType.values()[getRecipeType(itemstack)].getLocalizedName() + " " + super.getItemStackDisplayName(itemstack); + BaseTier tier = type == MachineType.BASIC_FACTORY ? BaseTier.BASIC : (type == MachineType.ADVANCED_FACTORY ? BaseTier.ADVANCED : BaseTier.ELITE); + + if(StatCollector.canTranslate("tile." + tier.getName() + RecipeType.values()[getRecipeType(itemstack)].getUnlocalizedName() + "Factory")) + { + return LangUtils.localize("tile." + tier.getName() + RecipeType.values()[getRecipeType(itemstack)].getUnlocalizedName() + "Factory"); + } + + return tier.getLocalizedName() + " " + RecipeType.values()[getRecipeType(itemstack)].getLocalizedName() + " " + super.getItemStackDisplayName(itemstack); } return super.getItemStackDisplayName(itemstack); diff --git a/src/main/java/mekanism/common/item/ItemBlockPlastic.java b/src/main/java/mekanism/common/item/ItemBlockPlastic.java index 5d3eb309d1e..ceaa791a262 100644 --- a/src/main/java/mekanism/common/item/ItemBlockPlastic.java +++ b/src/main/java/mekanism/common/item/ItemBlockPlastic.java @@ -1,13 +1,14 @@ package mekanism.common.item; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import mekanism.api.EnumColor; - +import mekanism.common.util.LangUtils; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.StatCollector; public class ItemBlockPlastic extends ItemBlock { @@ -37,6 +38,12 @@ public String getItemStackDisplayName(ItemStack stack) { EnumColor colour = EnumColor.DYES[stack.getItemDamage()&15]; String colourName; + + if(StatCollector.canTranslate(getUnlocalizedName(stack) + "." + colour.dyeName)) + { + return LangUtils.localize(getUnlocalizedName(stack) + "." + colour.dyeName); + } + if(colour == EnumColor.BLACK) { colourName = EnumColor.DARK_GREY + colour.getDyeName(); diff --git a/src/main/java/mekanism/common/multipart/ItemGlowPanel.java b/src/main/java/mekanism/common/multipart/ItemGlowPanel.java index 2461b4fe4b8..c630d584ad4 100644 --- a/src/main/java/mekanism/common/multipart/ItemGlowPanel.java +++ b/src/main/java/mekanism/common/multipart/ItemGlowPanel.java @@ -1,24 +1,26 @@ package mekanism.common.multipart; -import java.util.List; - +import codechicken.lib.vec.BlockCoord; +import codechicken.lib.vec.Vector3; +import codechicken.microblock.HollowMicroblock; +import codechicken.multipart.JItemMultiPart; +import codechicken.multipart.TMultiPart; +import codechicken.multipart.TileMultipart; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import mekanism.api.EnumColor; import mekanism.common.Mekanism; +import mekanism.common.util.LangUtils; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import codechicken.lib.vec.BlockCoord; -import codechicken.lib.vec.Vector3; -import codechicken.microblock.HollowMicroblock; -import codechicken.multipart.JItemMultiPart; -import codechicken.multipart.TMultiPart; -import codechicken.multipart.TileMultipart; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class ItemGlowPanel extends JItemMultiPart { @@ -104,6 +106,11 @@ public String getItemStackDisplayName(ItemStack stack) { EnumColor colour = EnumColor.DYES[stack.getItemDamage()]; String colourName; + + if(StatCollector.canTranslate(getUnlocalizedName(stack) + "." + colour.dyeName)) + { + return LangUtils.localize(getUnlocalizedName(stack) + "." + colour.dyeName); + } if(colour == EnumColor.BLACK) {