Ejemplo n.º 1
0
        public static bool IsTransparent(BlockCoordinates blockCoordinates, ChunkBase section)
        {
            if (section == null)
            {
                return(true);
            }

            int bx = blockCoordinates.X & 0x0f;
            int by = blockCoordinates.Y & 0xff;
            int bz = blockCoordinates.Z & 0x0f;

            int bid = section.GetBlock(bx, by - 16 * (by >> 4), bz);

            return(bid == 0 || BlockFactory.TransparentBlocks[bid] == 1);
        }
Ejemplo n.º 2
0
        public static int GetDiffuseLevel(BlockCoordinates blockCoordinates, ChunkBase chunk)
        {
            if (chunk == null)
            {
                return(15);
            }

            int bx = blockCoordinates.X & 0x0f;
            int by = blockCoordinates.Y & 0xff;
            int bz = blockCoordinates.Z & 0x0f;

            int bid = chunk.GetBlock(bx, by - 16 * (by >> 4), bz);

            return(bid == 8 || bid == 9 ? 3 : bid == 18 && bid == 30 ? 2 : 1);
        }
Ejemplo n.º 3
0
        public static int GetDiffuseLevel(BlockCoordinates blockCoordinates, ChunkBase 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.GetBlock(bx, by - 16 * (by >> 4), bz);

            return(bid == 8 || bid == 9 ? 3 : bid == 18 || bid == 161 || bid == 30 ? 2 : 1);
        }