Example #1
0
        public Chunk Get(int chunkX, int chunkZ)
        {
            int x = chunkX + _centerX;
            int z = chunkZ + _centerZ;

            return(_chunks[CraftMath.FloorMod(x, _sideLength), CraftMath.FloorMod(z, _sideLength)]);
        }
    public void MarkForRerender(int sectionX, int sectionY, int sectionZ, bool rerenderOnMainThread)
    {
        int x = CraftMath.FloorMod(sectionX, CountChunksX);
        int y = CraftMath.FloorMod(sectionY, CountChunksY);
        int z = CraftMath.FloorMod(sectionZ, CountChunksZ);

        _renderChunks[x, y, z].SetNeedsUpdate(rerenderOnMainThread);
    }
Example #3
0
        public Chunk Set(int chunkX, int chunkZ, Chunk chunk)
        {
            int x = chunkX + _centerX;
            int z = chunkZ + _centerZ;

            _chunks[CraftMath.FloorMod(x, _sideLength), CraftMath.FloorMod(z, _sideLength)] = chunk;
            return(chunk);
        }