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

The following are Jave code examples for showing how to use wood() of the net.minecraft.block.material.Material class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: BaseClient   File: BlockSign.java   Source Code and License Vote up 5 votes
protected BlockSign()
{
    super(Material.wood);
    float f = 0.25F;
    float f1 = 1.0F;
    this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
}
 
Example 2
Project: BaseClient   File: TileEntityNote.java   Source Code and License Vote up 5 votes
public void triggerNote(World worldIn, BlockPos p_175108_2_)
{
    if (worldIn.getBlockState(p_175108_2_.up()).getBlock().getMaterial() == Material.air)
    {
        Material material = worldIn.getBlockState(p_175108_2_.down()).getBlock().getMaterial();
        int i = 0;

        if (material == Material.rock)
        {
            i = 1;
        }

        if (material == Material.sand)
        {
            i = 2;
        }

        if (material == Material.glass)
        {
            i = 3;
        }

        if (material == Material.wood)
        {
            i = 4;
        }

        worldIn.addBlockEvent(p_175108_2_, Blocks.noteblock, i, this.note);
    }
}
 
Example 3
Project: connor41-etfuturum2   File: NetherWartBlock.java   Source Code and License Vote up 5 votes
public NetherWartBlock() {
	super(Material.wood);
	setBlockName(Utils.getUnlocalisedName("nether_wart_block"));
	setHardness(1F);
	setResistance(1.5F);
	setBlockTextureName("nether_wart_block");
	setStepSound(soundTypeWood);
	setLightOpacity(0);
	setCreativeTab(EtFuturum.enableNetherWartBlock? EtFuturum.creativeTab : null);
}
 
Example 4
Project: BaseClient   File: BlockSign.java   Source Code and License Vote up 5 votes
protected BlockSign()
{
    super(Material.wood);
    float f = 0.25F;
    float f1 = 1.0F;
    this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
}
 
Example 5
Project: BaseClient   File: BlockLog.java   Source Code and License Vote up 5 votes
public BlockLog()
{
    super(Material.wood);
    this.setCreativeTab(CreativeTabs.tabBlock);
    this.setHardness(2.0F);
    this.setStepSound(soundTypeWood);
}
 
Example 6
Project: BaseClient   File: BlockDaylightDetector.java   Source Code and License Vote up 5 votes
public BlockDaylightDetector(boolean inverted)
{
    super(Material.wood);
    this.inverted = inverted;
    this.setDefaultState(this.blockState.getBaseState().withProperty(POWER, Integer.valueOf(0)));
    this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F);
    this.setCreativeTab(CreativeTabs.tabRedstone);
    this.setHardness(0.2F);
    this.setStepSound(soundTypeWood);
    this.setUnlocalizedName("daylightDetector");
}
 
Example 7
Project: DecompiledMinecraft   File: BlockBanner.java   Source Code and License Vote up 5 votes
protected BlockBanner()
{
    super(Material.wood);
    float f = 0.25F;
    float f1 = 1.0F;
    this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
}
 
Example 8
Project: connor41-etfuturum2   File: BlockBanner.java   Source Code and License Vote up 5 votes
public BlockBanner() {
	super(Material.wood);
	disableStats();
	setHardness(1.0F);
	setStepSound(soundTypeWood);
	setBlockName(Utils.getUnlocalisedName("banner"));
	setCreativeTab(EtFuturum.enableBanners ? EtFuturum.creativeTab : null);

	float f = 0.25F;
	float f1 = 1.0F;
	setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
}
 
Example 9
Project: BaseClient   File: TileEntityFurnace.java   Source Code and License Vote up 5 votes
/**
 * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
 * fuel
 */
public static int getItemBurnTime(ItemStack p_145952_0_)
{
    if (p_145952_0_ == null)
    {
        return 0;
    }
    else
    {
        Item item = p_145952_0_.getItem();

        if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air)
        {
            Block block = Block.getBlockFromItem(item);

            if (block == Blocks.wooden_slab)
            {
                return 150;
            }

            if (block.getMaterial() == Material.wood)
            {
                return 300;
            }

            if (block == Blocks.coal_block)
            {
                return 16000;
            }
        }

        return item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemHoe && ((ItemHoe)item).getMaterialName().equals("WOOD") ? 200 : (item == Items.stick ? 100 : (item == Items.coal ? 1600 : (item == Items.lava_bucket ? 20000 : (item == Item.getItemFromBlock(Blocks.sapling) ? 100 : (item == Items.blaze_rod ? 2400 : 0)))))));
    }
}
 
Example 10
Project: BaseClient   File: BlockNote.java   Source Code and License Vote up 4 votes
public BlockNote()
{
    super(Material.wood);
    this.setCreativeTab(CreativeTabs.tabRedstone);
}
 
Example 11
Project: BaseClient   File: ItemAxe.java   Source Code and License Vote up 4 votes
public float getStrVsBlock(ItemStack stack, Block block)
{
    return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? super.getStrVsBlock(stack, block) : this.efficiencyOnProperMaterial;
}
 
Example 12
Project: BaseClient   File: EntityAIDoorInteract.java   Source Code and License Vote up 4 votes
private BlockDoor getBlockDoor(BlockPos pos)
{
    Block block = this.theEntity.worldObj.getBlockState(pos).getBlock();
    return block instanceof BlockDoor && block.getMaterial() == Material.wood ? (BlockDoor)block : null;
}
 
Example 13
Project: BaseClient   File: EntityAIDoorInteract.java   Source Code and License Vote up 4 votes
private BlockDoor getBlockDoor(BlockPos pos)
{
    Block block = this.theEntity.worldObj.getBlockState(pos).getBlock();
    return block instanceof BlockDoor && block.getMaterial() == Material.wood ? (BlockDoor)block : null;
}
 
Example 14
Project: BaseClient   File: BlockBookshelf.java   Source Code and License Vote up 4 votes
public BlockBookshelf()
{
    super(Material.wood);
    this.setCreativeTab(CreativeTabs.tabBlock);
}
 
Example 15
Project: DecompiledMinecraft   File: BlockBookshelf.java   Source Code and License Vote up 4 votes
public BlockBookshelf()
{
    super(Material.wood);
    this.setCreativeTab(CreativeTabs.tabBlock);
}
 
Example 16
Project: BaseClient   File: BlockPlanks.java   Source Code and License Vote up 4 votes
public BlockPlanks()
{
    super(Material.wood);
    this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.OAK));
    this.setCreativeTab(CreativeTabs.tabBlock);
}
 
Example 17
Project: BaseClient   File: VillageCollection.java   Source Code and License Vote up 4 votes
private boolean isWoodDoor(BlockPos doorPos)
{
    Block block = this.worldObj.getBlockState(doorPos).getBlock();
    return block instanceof BlockDoor ? block.getMaterial() == Material.wood : false;
}
 
Example 18
Project: BaseClient   File: BlockJukebox.java   Source Code and License Vote up 4 votes
protected BlockJukebox()
{
    super(Material.wood, MapColor.dirtColor);
    this.setDefaultState(this.blockState.getBaseState().withProperty(HAS_RECORD, Boolean.valueOf(false)));
    this.setCreativeTab(CreativeTabs.tabDecorations);
}
 
Example 19
Project: BaseClient   File: WalkNodeProcessor.java   Source Code and License Vote up 4 votes
public static int func_176170_a(IBlockAccess blockaccessIn, Entity entityIn, int x, int y, int z, int sizeX, int sizeY, int sizeZ, boolean avoidWater, boolean breakDoors, boolean enterDoors)
{
    boolean flag = false;
    BlockPos blockpos = new BlockPos(entityIn);
    BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();

    for (int i = x; i < x + sizeX; ++i)
    {
        for (int j = y; j < y + sizeY; ++j)
        {
            for (int k = z; k < z + sizeZ; ++k)
            {
                blockpos$mutableblockpos.func_181079_c(i, j, k);
                Block block = blockaccessIn.getBlockState(blockpos$mutableblockpos).getBlock();

                if (block.getMaterial() != Material.air)
                {
                    if (block != Blocks.trapdoor && block != Blocks.iron_trapdoor)
                    {
                        if (block != Blocks.flowing_water && block != Blocks.water)
                        {
                            if (!enterDoors && block instanceof BlockDoor && block.getMaterial() == Material.wood)
                            {
                                return 0;
                            }
                        }
                        else
                        {
                            if (avoidWater)
                            {
                                return -1;
                            }

                            flag = true;
                        }
                    }
                    else
                    {
                        flag = true;
                    }

                    if (entityIn.worldObj.getBlockState(blockpos$mutableblockpos).getBlock() instanceof BlockRailBase)
                    {
                        if (!(entityIn.worldObj.getBlockState(blockpos).getBlock() instanceof BlockRailBase) && !(entityIn.worldObj.getBlockState(blockpos.down()).getBlock() instanceof BlockRailBase))
                        {
                            return -3;
                        }
                    }
                    else if (!block.isPassable(blockaccessIn, blockpos$mutableblockpos) && (!breakDoors || !(block instanceof BlockDoor) || block.getMaterial() != Material.wood))
                    {
                        if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof BlockWall)
                        {
                            return -3;
                        }

                        if (block == Blocks.trapdoor || block == Blocks.iron_trapdoor)
                        {
                            return -4;
                        }

                        Material material = block.getMaterial();

                        if (material != Material.lava)
                        {
                            return 0;
                        }

                        if (!entityIn.isInLava())
                        {
                            return -2;
                        }
                    }
                }
            }
        }
    }

    return flag ? 2 : 1;
}
 
Example 20
Project: DecompiledMinecraft   File: WalkNodeProcessor.java   Source Code and License Vote up 4 votes
public static int func_176170_a(IBlockAccess blockaccessIn, Entity entityIn, int x, int y, int z, int sizeX, int sizeY, int sizeZ, boolean avoidWater, boolean breakDoors, boolean enterDoors)
{
    boolean flag = false;
    BlockPos blockpos = new BlockPos(entityIn);
    BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();

    for (int i = x; i < x + sizeX; ++i)
    {
        for (int j = y; j < y + sizeY; ++j)
        {
            for (int k = z; k < z + sizeZ; ++k)
            {
                blockpos$mutableblockpos.func_181079_c(i, j, k);
                Block block = blockaccessIn.getBlockState(blockpos$mutableblockpos).getBlock();

                if (block.getMaterial() != Material.air)
                {
                    if (block != Blocks.trapdoor && block != Blocks.iron_trapdoor)
                    {
                        if (block != Blocks.flowing_water && block != Blocks.water)
                        {
                            if (!enterDoors && block instanceof BlockDoor && block.getMaterial() == Material.wood)
                            {
                                return 0;
                            }
                        }
                        else
                        {
                            if (avoidWater)
                            {
                                return -1;
                            }

                            flag = true;
                        }
                    }
                    else
                    {
                        flag = true;
                    }

                    if (entityIn.worldObj.getBlockState(blockpos$mutableblockpos).getBlock() instanceof BlockRailBase)
                    {
                        if (!(entityIn.worldObj.getBlockState(blockpos).getBlock() instanceof BlockRailBase) && !(entityIn.worldObj.getBlockState(blockpos.down()).getBlock() instanceof BlockRailBase))
                        {
                            return -3;
                        }
                    }
                    else if (!block.isPassable(blockaccessIn, blockpos$mutableblockpos) && (!breakDoors || !(block instanceof BlockDoor) || block.getMaterial() != Material.wood))
                    {
                        if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof BlockWall)
                        {
                            return -3;
                        }

                        if (block == Blocks.trapdoor || block == Blocks.iron_trapdoor)
                        {
                            return -4;
                        }

                        Material material = block.getMaterial();

                        if (material != Material.lava)
                        {
                            return 0;
                        }

                        if (!entityIn.isInLava())
                        {
                            return -2;
                        }
                    }
                }
            }
        }
    }

    return flag ? 2 : 1;
}