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

The following examples show how to use net.minecraft.block.material.Material#cloth() . 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: ToolSword.java    From GregTech with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public boolean canMineBlock(IBlockState block, ItemStack stack) {
    String tool = block.getBlock().getHarvestTool(block);
    return (tool != null && tool.equals("sword")) ||
        block.getMaterial() == Material.LEAVES ||
        block.getMaterial() == Material.GOURD ||
        block.getMaterial() == Material.VINE ||
        block.getMaterial() == Material.WEB ||
        block.getMaterial() == Material.CLOTH ||
        block.getMaterial() == Material.CARPET ||
        block.getMaterial() == Material.PLANTS ||
        block.getMaterial() == Material.CACTUS ||
        block.getMaterial() == Material.CAKE ||
        block.getMaterial() == Material.TNT ||
        block.getMaterial() == Material.SPONGE;
}
 
Example 2
Source File: BlockHalfTatami.java    From Sakura_mod with MIT License 5 votes vote down vote up
public BlockHalfTatami(boolean ns) {
	super(Material.CLOTH);
	this.setTickRandomly(true);
	this.setSoundType(SoundType.PLANT);
	setHardness(0.25F).setResistance(0.5F);
	isNS = ns;
}
 
Example 3
Source File: BlockCarpetTatami.java    From Sakura_mod with MIT License 5 votes vote down vote up
public BlockCarpetTatami(boolean ns) {
	super(Material.CLOTH);
	this.setTickRandomly(true);
	this.setSoundType(SoundType.PLANT);
	setHardness(0.15F).setResistance(0.5F);
	isNS = ns;
}
 
Example 4
Source File: BlockNoren.java    From Sakura_mod with MIT License 5 votes vote down vote up
public BlockNoren() {
	super(Material.CLOTH, false);
	this.setCreativeTab(CommonProxy.tab);

	this.setSoundType(SoundType.CLOTH);
	this.setTickRandomly(true);

	this.setResistance(0.5f);
	this.setHardness(0.5f);
}
 
Example 5
Source File: BlockFuton.java    From Sakura_mod with MIT License 5 votes vote down vote up
public BlockFuton() {
	super(Material.CLOTH, false);
	this.setSoundType(SoundType.CLOTH);
	this.setHardness(0.2F);
	this.disableStats();
	this.setDefaultState(this.blockState.getBaseState().withProperty(PART, EnumPartType.FOOT).withProperty(OCCUPIED,false));
}
 
Example 6
Source File: BlockTatami.java    From Sakura_mod with MIT License 5 votes vote down vote up
public BlockTatami(boolean ns) {
	super(Material.CLOTH,true);
	this.setTickRandomly(true);
	this.setSoundType(SoundType.PLANT);
	setHardness(0.5F).setResistance(0.5F);
	isNS = ns;
}
 
Example 7
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 8
Source File: BlockCloud.java    From Wizardry with GNU Lesser General Public License v3.0 5 votes vote down vote up
public BlockCloud() {
	super("cloud", Material.CLOTH);
	setHardness(0.5f);
	setSoundType(SoundType.CLOTH);
	setDefaultState(blockState.getBaseState().withProperty(HAS_LIGHT_VALUE, false));
	setLightOpacity(0);
}
 
Example 9
Source File: BlockYuba.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public BlockYuba() {
	super(Material.CLOTH);
	this.setSoundType(SoundType.CLOTH);
}
 
Example 10
Source File: BlockLight.java    From Wizardry with GNU Lesser General Public License v3.0 4 votes vote down vote up
public BlockLight() {
	super("light", Material.CLOTH);
	setSoundType(SoundType.CLOTH);
	setHardness(0f);
}
 
Example 11
Source File: ItemEnderTool.java    From enderutilities with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public boolean canHarvestBlock(IBlockState state, ItemStack stack)
{
    if (this.isToolBroken(stack))
    {
        return false;
    }

    ToolType tool = ToolType.fromStack(stack);

    if (tool.equals(ToolType.PICKAXE)) // Ender Pickaxe
    {
        if (state.getMaterial() == Material.ROCK
            || state.getMaterial() == Material.GLASS
            || state.getMaterial() == Material.ICE
            || state.getMaterial() == Material.PACKED_ICE
            || state.getMaterial() == Material.REDSTONE_LIGHT
            || state.getMaterial() == Material.PISTON
            || state.getMaterial() == Material.IRON
            || state.getMaterial() == Material.ANVIL)
        {
            //System.out.println("canHarvestBlock(): true; Pickaxe");
            return true;
        }
    }
    else if (tool.equals(ToolType.AXE)) // Ender Axe
    {
        if (state.getMaterial() == Material.WOOD
            || state.getMaterial() == Material.LEAVES
            || state.getMaterial() == Material.GOURD
            || state.getMaterial() == Material.CARPET
            || state.getMaterial() == Material.CLOTH
            || state.getMaterial() == Material.PLANTS
            || state.getMaterial() == Material.VINE)
        {
            //System.out.println("canHarvestBlock(): true; Axe");
            return true;
        }
    }
    else if (tool.equals(ToolType.SHOVEL)) // Ender Shovel
    {
        if (state.getMaterial() == Material.GROUND
            || state.getMaterial() == Material.GRASS
            || state.getMaterial() == Material.SAND
            || state.getMaterial() == Material.SNOW
            || state.getMaterial() == Material.CRAFTED_SNOW
            || state.getMaterial() == Material.CLAY)
        {
            //System.out.println("canHarvestBlock(): true; Shovel");
            return true;
        }
    }

    //System.out.println("canHarvestBlock(): false");
    return false;
}
 
Example 12
Source File: BlockBackpack.java    From WearableBackpacks with MIT License 4 votes vote down vote up
public BlockBackpack() {
	super(Material.CLOTH);
	setSoundType(SoundType.SNOW);
	setHardness(1.5F);
	initBlockBounds();
}