This repository has been archived on 2024-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
Drew DeVault 6fb8ee7ba5 Many more optimizations and bugfixes
Again, sorry for the huge commit. Just taking on performance issues as I
see them. Changes in this:

- Deadlocks in region code finally fixed
- Chunk packet preparation optimized (saves ~10-20ms per packet, since
  we're sending these like 30 at a time that's pretty important) by
  storing chunks pre-encoded in memory (basically just using a single
  big array for IDs, metadata, and light)
- Move chunk generation and compression to the thread pool
- Move client chunk updates to the scheduler
- Improve profiler coverage
- Add knob to disable scheduling chunk events on chunk load
- Make it possible to disable specific scheduled events in config.yml
2017-05-23 18:17:44 -04:00

38 lines
1.4 KiB
C#

using System;
using fNbt;
using System.Collections.Generic;
namespace TrueCraft.API.World
{
public interface IChunk : IEventSubject, IDisposable
{
int X { get; }
int Z { get; }
int MaxHeight { get; }
Coordinates2D Coordinates { get; set; }
bool IsModified { get; set; }
bool LightPopulated { get; set; }
int[] HeightMap { get; }
byte[] Biomes { get; }
DateTime LastAccessed { get; set; }
byte[] Data { get; }
bool TerrainPopulated { get; set; }
Dictionary<Coordinates3D, NbtCompound> TileEntities { get; set; }
NibbleSlice Metadata { get; }
NibbleSlice BlockLight { get; }
NibbleSlice SkyLight { get; }
IRegion ParentRegion { get; set; }
int GetHeight(byte x, byte z);
void UpdateHeightMap();
byte GetBlockID(Coordinates3D coordinates);
byte GetMetadata(Coordinates3D coordinates);
byte GetSkyLight(Coordinates3D coordinates);
byte GetBlockLight(Coordinates3D coordinates);
void SetBlockID(Coordinates3D coordinates, byte value);
void SetMetadata(Coordinates3D coordinates, byte value);
void SetSkyLight(Coordinates3D coordinates, byte value);
void SetBlockLight(Coordinates3D coordinates, byte value);
NbtCompound GetTileEntity(Coordinates3D coordinates);
void SetTileEntity(Coordinates3D coordinates, NbtCompound value);
}
}