/// <summary> /// Inserts/replaces a new chunk on a specified location. /// </summary> /// <param name="location">The region location of the chunk.</param> /// <param name="chunk">The chunk to be added.</param> public void InsertChunk(MCPoint location, NBTFile chunk) { int offset = location.X + (location.Y * 32); chunks[offset] = chunk; chunkChanged[offset] = true; }
/// <summary> /// Removes a chunk on a specified location. /// </summary> /// <param name="location">The region location of the chunk to be removed.</param> public void RemoveChunk(MCPoint location) { int offset = location.X + (location.Y * 32); chunks[offset] = null; if (chunks[offset] != null) { chunkChanged[offset] = true; } }
/// <summary> /// Gets a chunk from this region. /// </summary> /// <param name="point">The location of the chunk.</param> /// <returns>An NBT file that has the </returns> public NBTFile this[MCPoint point] { get { return(this.chunks[point.X + point.Y * 32]); } set { InsertChunk(point, value); } }
/// <summary> /// Gets a chunk from this region. /// </summary> /// <param name="point">The location of the chunk.</param> /// <returns>An NBT file that has the </returns> public NBTFile this[MCPoint point] { get { return this.chunks[point.X + point.Y * 32]; } set { InsertChunk(point, value); } }
/// <summary> /// Removes a chunk on a specified location. /// </summary> /// <param name="location">The region location of the chunk to be removed.</param> public void RemoveChunk(MCPoint location) { int offset = location.X + (location.Y * 32); chunks[offset] = null; if (chunks[offset] != null) chunkChanged[offset] = true; }