Example #1
0
 /**
  * Called when the block is right clicked by the player. This modified version detects electric
  * items and wrench actions on your machine block. Do not override this function. Use
  * machineActivated instead! (It does the same thing)
  */
 @Override
 public boolean onBlockActivated(
     World worldIn,
     BlockPos pos,
     IBlockState state,
     EntityPlayer playerIn,
     EnumFacing side,
     float hitX,
     float hitY,
     float hitZ) {
   TileEntityMulti tileEntity = (TileEntityMulti) worldIn.getTileEntity(pos);
   return tileEntity.onBlockActivated(worldIn, pos, playerIn);
 }
Example #2
0
  @Override
  public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
    TileEntity tileEntity = worldIn.getTileEntity(pos);

    if (tileEntity instanceof TileEntityMulti) {
      ((TileEntityMulti) tileEntity).onBlockRemoval();
    }

    super.breakBlock(worldIn, pos, state);
  }