@Override public boolean onBlockActivated( World world, int i, int j, int k, EntityPlayer entityplayer, int something1, float something2, float something3, float something4) { if (world.isRemote) { return true; } TileEntityCamoFull entity = (TileEntityCamoFull) world.getBlockTileEntity(i, j, k); System.out.println("ACTIVATED: " + entity.getCopyID()); int l = world.getBlockMetadata(i, j, k); int i1 = l & 7; int j1 = 8 - (l & 8); world.setBlockMetadataWithNotify(i, j, k, i1 + j1); world.markBlocksDirty(i, j, k, i, j, k); world.playSoundEffect( (double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, j1 <= 0 ? 0.5F : 0.6F); world.notifyBlocksOfNeighborChange(i, j, k, blockID); world.markBlockNeedsUpdate(i, j, k); if (i1 == 1) { world.notifyBlocksOfNeighborChange(i - 1, j, k, blockID); } else if (i1 == 2) { world.notifyBlocksOfNeighborChange(i + 1, j, k, blockID); } else if (i1 == 3) { world.notifyBlocksOfNeighborChange(i, j, k - 1, blockID); } else if (i1 == 4) { world.notifyBlocksOfNeighborChange(i, j, k + 1, blockID); } else { world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID); } return true; }
/** Updates the flow for the BlockFlowing object. */ private void updateFlow(final World par1World, final int par2, final int par3, final int par4) { final int var5 = par1World.getBlockMetadata(par2, par3, par4); par1World.setBlockAndMetadata(par2, par3, par4, this.blockID + 1, var5); par1World.markBlocksDirty(par2, par3, par4, par2, par3, par4); }