Java Code Examples for net.minecraft.block.material.Material#WOOD

The following examples show how to use net.minecraft.block.material.Material#WOOD . 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 check out the related API usage on the sidebar.
Example 1
Source File: BlockSapling.java    From TFC2 with 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 File: BlockCampfirePot.java    From Sakura_mod with 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 3
Source File: BlockTraverseWoodPlanks.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
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
Source File: BlockTraverseWoodDoor.java    From Traverse-Legacy-1-12-2 with MIT License 5 votes vote down vote up
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 File: ENBlocks.java    From ExNihiloAdscensio with 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
Source File: ToolSaw.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@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 7
Source File: BlockWoodSupport3.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
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 8
Source File: BlockTraverseWoodFence.java    From Traverse-Legacy-1-12-2 with MIT License 5 votes vote down vote up
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 9
Source File: BlockGrapeLeaves.java    From Sakura_mod with 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 10
Source File: TofuVillage.java    From TofuCraftReload with 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 11
Source File: ToolUniversalSpade.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@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 12
Source File: BlockTraverseWoodDoor.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
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 13
Source File: BlockVanillaSplint.java    From Sakura_mod with 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 14
Source File: BlockAlienPlank.java    From AdvancedRocketry with 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));
}
 
Example 15
Source File: BlockPlankNoOredict.java    From Wizardry with GNU Lesser General Public License v3.0 4 votes vote down vote up
public BlockPlankNoOredict(String name) {
	super(name, Material.WOOD);
	setSoundType(SoundType.WOOD);
	setHardness(2);
	setResistance(5);
}
 
Example 16
Source File: BlockTraverseWoodSlab.java    From Traverse-Legacy-1-12-2 with MIT License 4 votes vote down vote up
public BlockTraverseWoodSlab(String name) {
    super(name, Material.WOOD, SoundType.WOOD);
    setHarvestLevel("axe", 0);
    setHardness(2.0F);
    setResistance(15);
}
 
Example 17
Source File: BlockGrapeSplint.java    From Sakura_mod with MIT License 4 votes vote down vote up
public BlockGrapeSplint() {
	super(Material.WOOD);
       this.setHardness(2.0F);
       this.setSoundType(SoundType.WOOD);
}
 
Example 18
Source File: BlockManaMagnet.java    From Wizardry with GNU Lesser General Public License v3.0 4 votes vote down vote up
public BlockManaMagnet() {
	super("mana_magnet", Material.WOOD);
	setHardness(2.0f);
	setResistance(15.0f);
	setSoundType(SoundType.WOOD);
}
 
Example 19
Source File: BlockSaltPan.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public BlockSaltPan()
{
    super(Material.WOOD);
    this.setTickRandomly(true);
    this.setSoundType(SoundType.WOOD);
}
 
Example 20
Source File: BlockWindBell.java    From Sakura_mod with MIT License 4 votes vote down vote up
public BlockWindBell() {
	super(Material.WOOD, false);
	this.setSoundType(SoundType.CLOTH);
}