2013-07-03 07:51:39 +00:00
|
|
|
package biomesoplenty.itemblocks;
|
2013-06-07 21:36:52 +00:00
|
|
|
|
|
|
|
import net.minecraft.item.ItemBlock;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
2013-07-03 07:51:39 +00:00
|
|
|
public class ItemBlockGlass extends ItemBlock
|
2013-06-07 21:36:52 +00:00
|
|
|
{
|
2013-07-03 06:01:28 +00:00
|
|
|
private static final String[] glassTypes = new String[] {"celestialLens", "sacrificialfocus_empty", "sacrificialfocus_active", "sacrificialfocus_villager"};
|
2013-06-07 21:36:52 +00:00
|
|
|
|
2013-07-03 07:51:39 +00:00
|
|
|
public ItemBlockGlass(int par1)
|
2013-06-07 21:36:52 +00:00
|
|
|
{
|
|
|
|
super(par1);
|
|
|
|
setMaxDamage(0);
|
|
|
|
setHasSubtypes(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getMetadata(int meta)
|
|
|
|
{
|
|
|
|
return meta & 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getUnlocalizedName(ItemStack itemStack)
|
|
|
|
{
|
|
|
|
int meta = itemStack.getItemDamage();
|
|
|
|
if (meta < 0 || meta >= glassTypes.length) {
|
|
|
|
meta = 0;
|
|
|
|
}
|
|
|
|
|
2013-06-09 00:39:12 +00:00
|
|
|
return super.getUnlocalizedName() + "." + glassTypes[meta];
|
2013-06-07 21:36:52 +00:00
|
|
|
}
|
|
|
|
}
|