package com.flansmod.common.driveables.mechas;
import java.util.Collections;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import com.flansmod.common.FlansMod;
import com.flansmod.common.types.IFlanItem;
import com.flansmod.common.types.InfoType;
public class ItemMechaAddon extends Item implements IFlanItem
{
public MechaItemType type;
public ItemMechaAddon(MechaItemType type1)
{
type = type1;
setMaxStackSize(1);
type.item = this;
setCreativeTab(FlansMod.tabFlanMechas);
GameRegistry.registerItem(this, type.shortName, FlansMod.MODID);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean b)
{
if(type.description != null)
{
Collections.addAll(list, type.description.split("_"));
}
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
{
return type.colour;
}
@Override
public InfoType getInfoType()
{
return type;
}
}