Java Code Examples for net.minecraft.init.Blocks.WOOL

The following are Jave code examples for showing how to use WOOL of the net.minecraft.init.Blocks class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Backmemed   File: ItemShears.java   View Source Code Vote up 5 votes
/**
 * Called when a Block is destroyed using this Item. Return true to trigger the "Use Item" statistic.
 */
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
    if (!worldIn.isRemote)
    {
        stack.damageItem(1, entityLiving);
    }

    Block block = state.getBlock();
    return state.getMaterial() != Material.LEAVES && block != Blocks.WEB && block != Blocks.TALLGRASS && block != Blocks.VINE && block != Blocks.TRIPWIRE && block != Blocks.WOOL ? super.onBlockDestroyed(stack, worldIn, state, pos, entityLiving) : true;
}
 
Example 2
Project: CustomWorldGen   File: ItemShears.java   View Source Code Vote up 5 votes
/**
 * Called when a Block is destroyed using this Item. Return true to trigger the "Use Item" statistic.
 */
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
    stack.damageItem(1, entityLiving);
    Block block = state.getBlock();
    return state.getMaterial() != Material.LEAVES && block != Blocks.WEB && block != Blocks.TALLGRASS && block != Blocks.VINE && block != Blocks.TRIPWIRE && block != Blocks.WOOL && !(state instanceof net.minecraftforge.common.IShearable) ? super.onBlockDestroyed(stack, worldIn, state, pos, entityLiving) : true;
}
 
Example 3
Project: Backmemed   File: ItemShears.java   View Source Code Vote up 4 votes
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
    Block block = state.getBlock();
    return block != Blocks.WEB && state.getMaterial() != Material.LEAVES ? (block == Blocks.WOOL ? 5.0F : super.getStrVsBlock(stack, state)) : 15.0F;
}
 
Example 4
Project: CustomWorldGen   File: ItemShears.java   View Source Code Vote up 4 votes
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
    Block block = state.getBlock();
    return block != Blocks.WEB && state.getMaterial() != Material.LEAVES ? (block == Blocks.WOOL ? 5.0F : super.getStrVsBlock(stack, state)) : 15.0F;
}