package com.harry9137.ct.item; import com.harry9137.ct.CTTab; import com.harry9137.ct.reference.reference; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ItemCT extends Item { public ItemCT(){ super(); this.setCreativeTab(CreativeTabs.tabMaterials); this.setMaxStackSize(64); this.setCreativeTab(CTTab.CTTab); } @Override public String getUnlocalizedName() { return String.format("item.%s%s", reference.MOD_ID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName())); } @Override public String getUnlocalizedName(ItemStack itemStack) { return String.format("item.%s%s", reference.MOD_ID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName())); } protected String getUnwrappedUnlocalizedName(String unlocalizedName) { return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1); } }