/// <inheritdoc/>
        public bool ChunkExists(int cx, int cz)
        {
            IRegion r = GetRegion(cx, cz);

            if (r == null)
            {
                return(false);
            }

            return(r.ChunkExists(cx & REGION_XMASK, cz & REGION_ZMASK));
        }
Exemple #2
0
        /// <summary>
        /// Checks if a chunk exists at the given local coordinates relative to this region.
        /// </summary>
        /// <param name="lcx">The local X-coordinate of a chunk relative to this region.</param>
        /// <param name="lcz">The local Z-coordinate of a chunk relative to this region.</param>
        /// <returns>True if there is a chunk at the given coordinates; false otherwise.</returns>
        /// <remarks>If the local coordinates are out of bounds for this region, the action will be forwarded to the correct region
        /// transparently.</remarks>
        public bool ChunkExists(int lcx, int lcz)
        {
            if (!LocalBoundsCheck(lcx, lcz))
            {
                IRegion alt = GetForeignRegion(lcx, lcz);
                return((alt == null) ? false : alt.ChunkExists(ForeignX(lcx), ForeignZ(lcz)));
            }

            RegionFile rf = GetRegionFile();

            return(rf.HasChunk(lcx, lcz));
        }
            protected bool MoveNextInRegion()
            {
                for (; _x < RegionChunkManager.REGION_XLEN; _x++)
                {
                    for (_z++; _z < RegionChunkManager.REGION_ZLEN; _z++)
                    {
                        if (_region.ChunkExists(_x, _z))
                        {
                            goto FoundNext;
                        }
                    }
                    _z = -1;
                }

FoundNext:

                return(_x < RegionChunkManager.REGION_XLEN);
            }