示例#1
0
        public bool HasAirFront()
        {
            if (globalPosition.z + 1 < worldBuilder().Size.x *Chunk.size - 1)
            {
                Block blockAbove = worldBuilder().GetBlockAtGlobalPosition(new Vector3(
                                                                               globalPosition.x,
                                                                               globalPosition.y,
                                                                               globalPosition.z + 1
                                                                               ));

                return(blockAbove.GetType() == typeof(Air));
            }

            return(true);
        }
示例#2
0
        public bool HasAirBack()
        {
            if (globalPosition.z - 1 >= 0)
            {
                Block blockAbove = worldBuilder().GetBlockAtGlobalPosition(new Vector3(
                                                                               globalPosition.x,
                                                                               globalPosition.y,
                                                                               globalPosition.z - 1
                                                                               ));

                return(blockAbove.GetType() == typeof(Air));
            }

            return(true);
        }
示例#3
0
        public bool HasAirAbove()
        {
            int maxHeight = ChunkColumn.chunksPerColumn * Chunk.size;

            if (globalPosition.y + 1 > maxHeight - 1)
            {
                return(true);
            }

            Block blockAbove = worldBuilder().GetBlockAtGlobalPosition(new Vector3(
                                                                           globalPosition.x,
                                                                           globalPosition.y + 1,
                                                                           globalPosition.z
                                                                           ));

            return(blockAbove.GetType() == typeof(Air));
        }