public static bool IsTransparent(BlockCoordinates blockCoordinates, SubChunk section) { if (section == null) { return(true); } int bx = blockCoordinates.X & 0x0f; int by = blockCoordinates.Y & 0xff; int bz = blockCoordinates.Z & 0x0f; int bid = section.GetBlockId(bx, by - 16 * (by >> 4), bz); return(bid == 0 || BlockFactory.TransparentBlocks[bid] == 1); }
public static int GetDiffuseLevel(BlockCoordinates blockCoordinates, SubChunk section) { //TODO: Figure out if this is really correct. Perhaps should be zero. if (section == null) { return(15); } int bx = blockCoordinates.X & 0x0f; int by = blockCoordinates.Y & 0xff; int bz = blockCoordinates.Z & 0x0f; int bid = section.GetBlockId(bx, by - 16 * (by >> 4), bz); return(bid == 8 || bid == 9 ? 3 : bid == 18 || bid == 161 || bid == 30 ? 2 : 1); }