mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Removed unused imports Add/remove all methods used for arrays Removed manual array copy
66 lines
1.2 KiB
Java
66 lines
1.2 KiB
Java
package mekanism.common.item;
|
|
|
|
import mekanism.common.Mekanism;
|
|
import mekanism.common.base.IMetaItem;
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.util.NonNullList;
|
|
|
|
public class ItemHDPE extends ItemMekanism implements IMetaItem
|
|
{
|
|
public ItemHDPE()
|
|
{
|
|
super();
|
|
setHasSubtypes(true);
|
|
setCreativeTab(Mekanism.tabMekanism);
|
|
}
|
|
|
|
@Override
|
|
public String getTexture(int meta)
|
|
{
|
|
return PlasticItem.values()[meta].getName();
|
|
}
|
|
|
|
@Override
|
|
public int getVariants()
|
|
{
|
|
return PlasticItem.values().length;
|
|
}
|
|
|
|
@Override
|
|
public void getSubItems(CreativeTabs tabs, NonNullList<ItemStack> itemList)
|
|
{
|
|
if(!isInCreativeTab(tabs)) return;
|
|
for(int counter = 0; counter < PlasticItem.values().length; counter++)
|
|
{
|
|
itemList.add(new ItemStack(this, 1, counter));
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public String getUnlocalizedName(ItemStack item)
|
|
{
|
|
return "item." + PlasticItem.values()[item.getItemDamage()].getName();
|
|
}
|
|
|
|
public enum PlasticItem
|
|
{
|
|
PELLET("HDPEPellet"),
|
|
ROD("HDPERod"),
|
|
SHEET("HDPESheet"),
|
|
STICK("PlaStick");
|
|
|
|
private String name;
|
|
|
|
PlasticItem(String itemName)
|
|
{
|
|
name = itemName;
|
|
}
|
|
|
|
public String getName()
|
|
{
|
|
return name;
|
|
}
|
|
}
|
|
}
|