You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
2.1 KiB
Java
72 lines
2.1 KiB
Java
package net.minecraft.block;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
import java.util.List;
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.util.IIcon;
|
|
|
|
public class BlockWood extends Block
|
|
{
|
|
public static final String[] field_150096_a = new String[] {"oak", "spruce", "birch", "jungle", "acacia", "big_oak"};
|
|
@SideOnly(Side.CLIENT)
|
|
private IIcon[] field_150095_b;
|
|
private static final String __OBFID = "CL_00000335";
|
|
|
|
public BlockWood()
|
|
{
|
|
super(Material.wood);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
* Gets the block's texture. Args: side, meta
|
|
*/
|
|
@SideOnly(Side.CLIENT)
|
|
public IIcon getIcon(int side, int meta)
|
|
{
|
|
if (meta < 0 || meta >= this.field_150095_b.length)
|
|
{
|
|
meta = 0;
|
|
}
|
|
|
|
return this.field_150095_b[meta];
|
|
}
|
|
|
|
/**
|
|
* Determines the damage on the item the block drops. Used in cloth and wood.
|
|
*/
|
|
public int damageDropped(int meta)
|
|
{
|
|
return meta;
|
|
}
|
|
|
|
/**
|
|
* returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
*/
|
|
@SideOnly(Side.CLIENT)
|
|
public void getSubBlocks(Item itemIn, CreativeTabs tab, List list)
|
|
{
|
|
list.add(new ItemStack(itemIn, 1, 0));
|
|
list.add(new ItemStack(itemIn, 1, 1));
|
|
list.add(new ItemStack(itemIn, 1, 2));
|
|
list.add(new ItemStack(itemIn, 1, 3));
|
|
list.add(new ItemStack(itemIn, 1, 4));
|
|
list.add(new ItemStack(itemIn, 1, 5));
|
|
}
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
public void registerBlockIcons(IIconRegister reg)
|
|
{
|
|
this.field_150095_b = new IIcon[field_150096_a.length];
|
|
|
|
for (int i = 0; i < this.field_150095_b.length; ++i)
|
|
{
|
|
this.field_150095_b[i] = reg.registerIcon(this.getTextureName() + "_" + field_150096_a[i]);
|
|
}
|
|
}
|
|
} |