2013-05-23 21:07:28 -07:00
|
|
|
package magicbees.item;
|
2012-12-27 00:27:23 -08:00
|
|
|
|
2012-12-27 22:40:24 -08:00
|
|
|
import java.util.List;
|
|
|
|
|
|
2013-05-13 13:11:34 -07:00
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
2012-12-27 22:40:24 -08:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2013-01-26 13:42:39 -08:00
|
|
|
import forestry.api.core.Tabs;
|
2013-05-23 21:07:28 -07:00
|
|
|
import magicbees.item.types.PropolisType;
|
|
|
|
|
import magicbees.main.CommonProxy;
|
|
|
|
|
import magicbees.main.utils.compat.ForestryHelper;
|
2013-04-15 00:17:50 -07:00
|
|
|
import net.minecraft.client.renderer.texture.IconRegister;
|
2012-12-27 22:40:24 -08:00
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
2012-12-27 00:27:23 -08:00
|
|
|
import net.minecraft.item.Item;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
2013-04-15 00:17:50 -07:00
|
|
|
import net.minecraft.util.Icon;
|
2012-12-27 00:27:23 -08:00
|
|
|
|
|
|
|
|
public class ItemPropolis extends Item
|
|
|
|
|
{
|
|
|
|
|
public ItemPropolis(int id)
|
|
|
|
|
{
|
|
|
|
|
super(id);
|
2013-01-26 13:42:39 -08:00
|
|
|
this.setCreativeTab(Tabs.tabApiculture);
|
2012-12-27 22:40:24 -08:00
|
|
|
this.setHasSubtypes(true);
|
2013-05-29 11:15:25 -07:00
|
|
|
this.setUnlocalizedName("propolis");
|
|
|
|
|
GameRegistry.registerItem(this, "propolis");
|
2012-12-27 22:40:24 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ItemStack getStackForType(PropolisType type)
|
|
|
|
|
{
|
|
|
|
|
return new ItemStack(this, 1, type.ordinal());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ItemStack getStackForType(PropolisType type, int count)
|
|
|
|
|
{
|
|
|
|
|
return new ItemStack(this, count, type.ordinal());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
|
public void getSubItems(int id, CreativeTabs tabs, List list)
|
|
|
|
|
{
|
|
|
|
|
for (PropolisType type : PropolisType.values())
|
|
|
|
|
{
|
|
|
|
|
list.add(this.getStackForType(type));
|
|
|
|
|
}
|
2012-12-27 00:27:23 -08:00
|
|
|
}
|
|
|
|
|
|
2013-04-15 00:17:50 -07:00
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
|
public void registerIcons(IconRegister par1IconRegister)
|
|
|
|
|
{
|
|
|
|
|
this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":propolis.0");
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-27 00:27:23 -08:00
|
|
|
@Override
|
|
|
|
|
public int getColorFromItemStack(ItemStack stack, int pass)
|
|
|
|
|
{
|
|
|
|
|
int colour = 0xffffff;
|
|
|
|
|
int meta = stack.getItemDamage();
|
|
|
|
|
if (meta >= 0 && meta < PropolisType.values().length)
|
|
|
|
|
{
|
|
|
|
|
colour = PropolisType.values()[meta].colour;
|
|
|
|
|
}
|
|
|
|
|
return colour;
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-27 22:40:24 -08:00
|
|
|
@Override
|
|
|
|
|
public String getItemDisplayName(ItemStack stack)
|
|
|
|
|
{
|
2013-03-06 19:33:09 -08:00
|
|
|
return PropolisType.values()[stack.getItemDamage()].getName();
|
2012-12-27 22:40:24 -08:00
|
|
|
}
|
|
|
|
|
|
2012-12-27 00:27:23 -08:00
|
|
|
}
|