Java Code Examples for net.minecraft.block.material.Material#wood()

The following examples show how to use net.minecraft.block.material.Material#wood() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: TFC2   File: BlockSapling.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void Process(World world, BlockPos blockPos, TreeConfig tc,
		Schematic schem, IBlockState state)
{

	IBlockState block = tc.wood;
	IBlockState leaves = tc.leaves;

	if(state.getBlock().getMaterial(state) == Material.WOOD)
	{
		world.setBlockState(blockPos, block, 2);
	}
	else if(state.getBlock().getMaterial(state) == Material.LEAVES)
	{
		if(world.getBlockState(blockPos).getBlock().isReplaceable(world, blockPos))
		{
			world.setBlockState(blockPos, leaves, 2);
		}
	}
	else
	{
		world.setBlockState(blockPos, state);
	}
}
 
Example 2
Source Project: TofuCraftReload   File: TofuVillage.java    License: MIT License 5 votes vote down vote up
private boolean isWoodDoor(BlockPos pos) {
    IBlockState iblockstate = this.world.getBlockState(pos);
    Block block = iblockstate.getBlock();

    if (block instanceof BlockDoor) {
        return iblockstate.getMaterial() == Material.WOOD;
    } else {
        return false;
    }
}
 
Example 3
public BlockTraverseWoodPlanks(String name) {
    super(Material.WOOD);
    setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name + "_planks"));
    setTranslationKey(getRegistryName().toString());
    setCreativeTab(TraverseTab.TAB);
    setDefaultState(blockState.getBaseState());
    setHarvestLevel("axe", 0);
    setHardness(2.0F);
    setResistance(15);
    setSoundType(SoundType.WOOD);
    ShootingStar.registerModel(new ModelCompound(TraverseConstants.MOD_ID, this, "planks"));
}
 
Example 4
public BlockTraverseWoodDoor(String name) {
    super(Material.WOOD);
    setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name + "_door"));
    setUnlocalizedName(getRegistryName().toString());
    setCreativeTab(TraverseTab.TAB);
    setSoundType(SoundType.WOOD);
    setHardness(3.0F);
    setHarvestLevel("axe", 0);
    ShootingStar.registerModel(new ModelCompound(TraverseConstants.MOD_ID, this, "door", POWERED));
}
 
Example 5
Source Project: ExNihiloAdscensio   File: ENBlocks.java    License: MIT License 5 votes vote down vote up
public static void init()
{
       dust = new BlockBaseFalling(SoundType.CLOTH, "blockDust");
       dust.setCreativeTab(ExNihiloAdscensio.tabExNihilo);
       dust.setHardness(0.7F);
       
       netherrackCrushed = new BlockBaseFalling(SoundType.GROUND, "blockNetherrackCrushed");
       netherrackCrushed.setCreativeTab(ExNihiloAdscensio.tabExNihilo);
       netherrackCrushed.setHardness(0.7F);

       endstoneCrushed = new BlockBaseFalling(SoundType.GROUND, "blockEndstoneCrushed");
       endstoneCrushed.setCreativeTab(ExNihiloAdscensio.tabExNihilo);
       endstoneCrushed.setHardness(0.7F);
       
       barrelWood = new BlockBarrel(0, Material.WOOD);
       barrelWood.setCreativeTab(ExNihiloAdscensio.tabExNihilo);
       GameRegistry.registerTileEntity(TileBarrel.class, "blockBarrel0");
       
       barrelStone = new BlockBarrel(1, Material.ROCK);
       barrelStone.setCreativeTab(ExNihiloAdscensio.tabExNihilo);
       GameRegistry.registerTileEntity(TileBarrel.class, "blockBarrel1");
	
	infestedLeaves = new BlockInfestedLeaves();
	GameRegistry.registerTileEntity(TileInfestedLeaves.class, "blockInfestedLeaves");
	infestedLeaves.setCreativeTab(ExNihiloAdscensio.tabExNihilo);
	
	crucible = new BlockCrucible();
	crucible.setCreativeTab(ExNihiloAdscensio.tabExNihilo);
	GameRegistry.registerTileEntity(TileCrucible.class, "blockCrucible");
	
	sieve = new BlockSieve();
	sieve.setCreativeTab(ExNihiloAdscensio.tabExNihilo);
	GameRegistry.registerTileEntity(TileSieve.class, "blockSieve");
	
	fluidWitchwater = new FluidWitchWater();
	blockWitchwater = new BlockFluidWitchwater();
	FluidRegistry.addBucketForFluid(fluidWitchwater);
}
 
Example 6
public BlockWoodSupport3() 
{
	super(Material.WOOD, META_PROPERTY);
	this.setDefaultState(this.blockState.getBaseState().withProperty(META_PROPERTY, WoodType.Blackwood).
			withProperty(SPAN, Boolean.valueOf(false)).
			withProperty(NORTH_CONNECTION, Boolean.valueOf(false)).
			withProperty(EAST_CONNECTION, Boolean.valueOf(false)).
			withProperty(SOUTH_CONNECTION, Boolean.valueOf(false)).
			withProperty(WEST_CONNECTION, Boolean.valueOf(false)));
}
 
Example 7
public BlockTraverseWoodFence(String name) {
    super(Material.WOOD, MapColor.WOOD);
    setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name + "_fence"));
    setUnlocalizedName(getRegistryName().toString());
    setCreativeTab(TraverseTab.TAB);
    setSoundType(SoundType.WOOD);
    setHardness(2.0F);
    setResistance(5.0F);
    ShootingStar.registerModel(new ModelCompound(TraverseConstants.MOD_ID, this, "fence"));
}
 
Example 8
public BlockTraverseWoodDoor(String name) {
    super(Material.WOOD);
    setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name + "_door"));
    setTranslationKey(getRegistryName().toString());
    setCreativeTab(TraverseTab.TAB);
    setSoundType(SoundType.WOOD);
    setHardness(3.0F);
    setHarvestLevel("axe", 0);
    ShootingStar.registerModel(new ModelCompound(TraverseConstants.MOD_ID, this, "door", POWERED));
}
 
Example 9
@Override
public boolean canMineBlock(IBlockState block, ItemStack stack) {
    String tool = block.getBlock().getHarvestTool(block);
    return (tool != null && (tool.equals("shovel") ||
        tool.equals("axe") ||
        tool.equals("saw") ||
        tool.equals("sword") ||
        tool.equals("crowbar"))) ||
        block.getMaterial() == Material.SAND ||
        block.getMaterial() == Material.GRASS ||
        block.getMaterial() == Material.GROUND ||
        block.getMaterial() == Material.SNOW ||
        block.getMaterial() == Material.CLAY ||
        block.getMaterial() == Material.CRAFTED_SNOW ||
        block.getMaterial() == Material.LEAVES ||
        block.getMaterial() == Material.VINE ||
        block.getMaterial() == Material.WOOD ||
        block.getMaterial() == Material.CACTUS ||
        block.getMaterial() == Material.CIRCUITS ||
        block.getMaterial() == Material.GOURD ||
        block.getMaterial() == Material.WEB ||
        block.getMaterial() == Material.CLOTH ||
        block.getMaterial() == Material.CARPET ||
        block.getMaterial() == Material.PLANTS ||
        block.getMaterial() == Material.CAKE ||
        block.getMaterial() == Material.TNT ||
        block.getMaterial() == Material.SPONGE;
}
 
Example 10
Source Project: Sakura_mod   File: BlockGrapeLeaves.java    License: MIT License 5 votes vote down vote up
public BlockGrapeLeaves() {
	super(Material.WOOD,false);
	this.setDefaultState(this.blockState.getBaseState().withProperty(this.getAgeProperty(), Integer.valueOf(0)));
	this.setTickRandomly(true);
	this.setCreativeTab((CreativeTabs) null);
	this.setHardness(2.0F);
	this.setSoundType(SoundType.WOOD);
}
 
Example 11
@Override
public boolean canMineBlock(IBlockState block, ItemStack stack) {
    String tool = block.getBlock().getHarvestTool(block);
    return (tool != null && (tool.equals("axe") || tool.equals("saw"))) ||
        block.getMaterial() == Material.LEAVES ||
        block.getMaterial() == Material.VINE ||
        block.getMaterial() == Material.WOOD ||
        block.getMaterial() == Material.CACTUS ||
        block.getMaterial() == Material.ICE ||
        block.getMaterial() == Material.PACKED_ICE;
}
 
Example 12
Source Project: Sakura_mod   File: BlockCampfirePot.java    License: MIT License 5 votes vote down vote up
public BlockCampfirePot(boolean isBurning) {
    super(Material.WOOD);
    this.setHardness(0.5F);
    this.setSoundType(SoundType.WOOD);
    this.isBurning = isBurning;

    if (isBurning) {
        this.setLightLevel(0.85F);
    } else {
        this.setCreativeTab(CommonProxy.tab);
    }
}
 
Example 13
Source Project: Sakura_mod   File: BlockWindBell.java    License: MIT License 4 votes vote down vote up
public BlockWindBell() {
	super(Material.WOOD, false);
	this.setSoundType(SoundType.CLOTH);
}
 
Example 14
Source Project: TofuCraftReload   File: BlockSaltPan.java    License: MIT License 4 votes vote down vote up
public BlockSaltPan()
{
    super(Material.WOOD);
    this.setTickRandomly(true);
    this.setSoundType(SoundType.WOOD);
}
 
Example 15
public BlockManaMagnet() {
	super("mana_magnet", Material.WOOD);
	setHardness(2.0f);
	setResistance(15.0f);
	setSoundType(SoundType.WOOD);
}
 
Example 16
Source Project: Sakura_mod   File: BlockGrapeSplint.java    License: MIT License 4 votes vote down vote up
public BlockGrapeSplint() {
	super(Material.WOOD);
       this.setHardness(2.0F);
       this.setSoundType(SoundType.WOOD);
}
 
Example 17
Source Project: Sakura_mod   File: BlockVanillaSplint.java    License: MIT License 4 votes vote down vote up
public BlockVanillaSplint() {
	super(Material.WOOD);
       this.setTickRandomly(true);
       this.setHardness(2.0F);
       this.setSoundType(SoundType.WOOD);
}
 
Example 18
public BlockTraverseWoodSlab(String name) {
    super(name, Material.WOOD, SoundType.WOOD);
    setHarvestLevel("axe", 0);
    setHardness(2.0F);
    setResistance(15);
}
 
Example 19
public BlockPlankNoOredict(String name) {
	super(name, Material.WOOD);
	setSoundType(SoundType.WOOD);
	setHardness(2);
	setResistance(5);
}
 
Example 20
Source Project: AdvancedRocketry   File: BlockAlienPlank.java    License: MIT License 4 votes vote down vote up
public BlockAlienPlank()
{
    super(Material.WOOD);
    this.setLightLevel(4);
    this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockAlienPlank.EnumType.ALIEN));
}