Search in sources :

Example 1 with IYetaAwareBlock

use of crazypants.enderio.base.machine.interfaces.IYetaAwareBlock in project EnderIO by SleepyTrousers.

the class ItemYetaWrench method onBlockStartBreak.

@Override
public boolean onBlockStartBreak(@Nonnull ItemStack itemstack, @Nonnull BlockPos pos, @Nonnull EntityPlayer player) {
    IBlockState bs = player.world.getBlockState(pos);
    Block block = bs.getBlock();
    if (player.isSneaking() && block instanceof IYetaAwareBlock && player.capabilities.isCreativeMode) {
        block.onBlockClicked(player.world, pos, player);
        return true;
    }
    return false;
}
Also used : IYetaAwareBlock(crazypants.enderio.base.machine.interfaces.IYetaAwareBlock) IBlockState(net.minecraft.block.state.IBlockState) RightClickBlock(net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickBlock) IBlockPaintableBlock(crazypants.enderio.base.paint.IPaintable.IBlockPaintableBlock) IYetaAwareBlock(crazypants.enderio.base.machine.interfaces.IYetaAwareBlock) Block(net.minecraft.block.Block)

Aggregations

IYetaAwareBlock (crazypants.enderio.base.machine.interfaces.IYetaAwareBlock)1 IBlockPaintableBlock (crazypants.enderio.base.paint.IPaintable.IBlockPaintableBlock)1 Block (net.minecraft.block.Block)1 IBlockState (net.minecraft.block.state.IBlockState)1 RightClickBlock (net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickBlock)1