minerender 2.1.0-alpha.74 → 2.1.0-alpha.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2518,6 +2518,12 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
2518
2518
  private placeBlocks;
2519
2519
  /** Replaces one chunk column's blocks. Entity NBT remains available on the parsed chunk. */
2520
2520
  placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
2521
+ /**
2522
+ * Removes all sections at integer chunk-column coordinates, then refreshes neighboring faces and fluids.
2523
+ * Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
2524
+ */
2525
+ unloadChunkColumn(x: number, z: number): Promise<void>;
2526
+ private clearChunkColumn;
2521
2527
  clear(): Promise<void>;
2522
2528
  private updateCulling;
2523
2529
  private getOrCreateChunkAt;
@@ -2518,6 +2518,12 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
2518
2518
  private placeBlocks;
2519
2519
  /** Replaces one chunk column's blocks. Entity NBT remains available on the parsed chunk. */
2520
2520
  placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
2521
+ /**
2522
+ * Removes all sections at integer chunk-column coordinates, then refreshes neighboring faces and fluids.
2523
+ * Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
2524
+ */
2525
+ unloadChunkColumn(x: number, z: number): Promise<void>;
2526
+ private clearChunkColumn;
2521
2527
  clear(): Promise<void>;
2522
2528
  private updateCulling;
2523
2529
  private getOrCreateChunkAt;
@@ -15463,13 +15463,7 @@ var MineRenderWorld = class {
15463
15463
  async placeChunk(chunk, executor) {
15464
15464
  const changes = /* @__PURE__ */ new Map();
15465
15465
  try {
15466
- const previous = [...this._chunks.entries()].filter(([, section]) => section.x === chunk.x && section.z === chunk.z);
15467
- for (const [key, section] of previous) {
15468
- this._chunks.delete(key);
15469
- await section.clear(async (positions) => {
15470
- for (const pos of positions) changes.set(pos.toArray().join(","), pos);
15471
- });
15472
- }
15466
+ await this.clearChunkColumn(chunk.x, chunk.z, changes);
15473
15467
  for (const section of chunk.sections) {
15474
15468
  const blocks = [];
15475
15469
  for (let index = 0; index < 4096; index++) {
@@ -15489,6 +15483,31 @@ var MineRenderWorld = class {
15489
15483
  await this.updateCulling([...changes.values()]);
15490
15484
  }
15491
15485
  }
15486
+ /**
15487
+ * Removes all sections at integer chunk-column coordinates, then refreshes neighboring faces and fluids.
15488
+ * Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
15489
+ */
15490
+ async unloadChunkColumn(x, z) {
15491
+ if (!Number.isInteger(x) || !Number.isInteger(z)) {
15492
+ throw new RangeError("Chunk column coordinates must be integers");
15493
+ }
15494
+ await this.culling;
15495
+ const changes = /* @__PURE__ */ new Map();
15496
+ try {
15497
+ await this.clearChunkColumn(x, z, changes);
15498
+ } finally {
15499
+ await this.updateCulling([...changes.values()]);
15500
+ }
15501
+ }
15502
+ async clearChunkColumn(x, z, changes) {
15503
+ const previous = [...this._chunks.entries()].filter(([, section]) => section.x === x && section.z === z);
15504
+ for (const [key, section] of previous) {
15505
+ this._chunks.delete(key);
15506
+ await section.clear(async (positions) => {
15507
+ for (const pos of positions) changes.set(pos.toArray().join(","), pos);
15508
+ });
15509
+ }
15510
+ }
15492
15511
  async clear() {
15493
15512
  await this.culling;
15494
15513
  const chunks = [...this._chunks.values()];