Esempio n. 1
0
        /*
         * @return wether or not the block has anyVisible faces
         * @return false if block b is null or b is Air
         */
        private bool updateBlock(int absX, int absY, int absZ, Block b, Chunk c)
        {
            if (b == null || b.getName() == "Air") {
                return false;
            }

            bool used = false;
            MultiBlock val;
            for (int i = 0; i < 6; i++) {
                if (!this.mIsland.hasVisibleFaceAt(absX, absY, absZ, (BlockFace)i)) {
                    continue;
                }
                used = true;
                string face = b.getFace(i);
                if (c.multiList.TryGetValue(face, out val)) {
                    c.dirtyMultiListInsert(face, c.multiList[face]);
                    c.multiList.Remove(face);
                }
                else if (!c.dirtyMultiListName.Contains(face)) {
                    c.addBlockType(b.getMeshType(), face);
                    c.dirtyMultiListInsert(face, c.multiList[face]);
                    c.multiList.Remove(face);
                }
            }
            return used;
        }
Esempio n. 2
0
 public bool hasVisiblefaceAt(Chunk c, int x, int y, int z, BlockFace i)
 {
     return c.hasVisibleFaceAt(x, y, z, i);
 }