BiomesOPlenty/common/biomesoplenty/blocks/BlockBOPPlank.java

60 lines
1.5 KiB
Java
Raw Normal View History

2013-05-03 13:00:44 +00:00
package biomesoplenty.blocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import biomesoplenty.BiomesOPlenty;
public class BlockBOPPlank extends Block
{
2013-05-31 10:34:02 +00:00
private static final String[] woodTypes = new String[] {"plank_acacia", "plank_cherry", "plank_dark", "plank_fir", "plank_holy", "plank_magic", "plank_mangrove", "plank_palm", "plank_redwood", "plank_willow", "bamboothatching", "plank_pine", "plank_hell_bark", "plank_jacaranda"};
private Icon[] textures;
public BlockBOPPlank(int blockID)
{
super(blockID, Material.wood);
setBurnProperties(this.blockID, 5, 20);
setHardness(2.0F);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
@Override
public void registerIcons(IconRegister iconRegister)
{
textures = new Icon[woodTypes.length];
for (int i = 0; i < woodTypes.length; ++i) {
textures[i] = iconRegister.registerIcon("biomesoplenty:"+woodTypes[i]);
2013-05-31 10:34:02 +00:00
}
}
@Override
public Icon getIcon(int side, int meta)
{
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {
for (int i = 0; i < woodTypes.length; ++i) {
list.add(new ItemStack(blockID, 1, i));
}
}
@Override
public int damageDropped(int meta)
{
return meta;
}
2013-05-03 13:00:44 +00:00
}