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.
@@ -15279,13 +15279,7 @@ var MineRenderWorld = class {
15279
15279
  async placeChunk(chunk, executor) {
15280
15280
  const changes = /* @__PURE__ */ new Map();
15281
15281
  try {
15282
- const previous = [...this._chunks.entries()].filter(([, section]) => section.x === chunk.x && section.z === chunk.z);
15283
- for (const [key, section] of previous) {
15284
- this._chunks.delete(key);
15285
- await section.clear(async (positions) => {
15286
- for (const pos of positions) changes.set(pos.toArray().join(","), pos);
15287
- });
15288
- }
15282
+ await this.clearChunkColumn(chunk.x, chunk.z, changes);
15289
15283
  for (const section of chunk.sections) {
15290
15284
  const blocks = [];
15291
15285
  for (let index = 0; index < 4096; index++) {
@@ -15305,6 +15299,31 @@ var MineRenderWorld = class {
15305
15299
  await this.updateCulling([...changes.values()]);
15306
15300
  }
15307
15301
  }
15302
+ /**
15303
+ * Removes all sections at integer chunk-column coordinates, then refreshes neighboring faces and fluids.
15304
+ * Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
15305
+ */
15306
+ async unloadChunkColumn(x, z) {
15307
+ if (!Number.isInteger(x) || !Number.isInteger(z)) {
15308
+ throw new RangeError("Chunk column coordinates must be integers");
15309
+ }
15310
+ await this.culling;
15311
+ const changes = /* @__PURE__ */ new Map();
15312
+ try {
15313
+ await this.clearChunkColumn(x, z, changes);
15314
+ } finally {
15315
+ await this.updateCulling([...changes.values()]);
15316
+ }
15317
+ }
15318
+ async clearChunkColumn(x, z, changes) {
15319
+ const previous = [...this._chunks.entries()].filter(([, section]) => section.x === x && section.z === z);
15320
+ for (const [key, section] of previous) {
15321
+ this._chunks.delete(key);
15322
+ await section.clear(async (positions) => {
15323
+ for (const pos of positions) changes.set(pos.toArray().join(","), pos);
15324
+ });
15325
+ }
15326
+ }
15308
15327
  async clear() {
15309
15328
  await this.culling;
15310
15329
  const chunks = [...this._chunks.values()];