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.
package/dist/bundle.js CHANGED
@@ -105523,13 +105523,7 @@ gl_FragDepth=readDepth(vUv);
105523
105523
  async placeChunk(chunk, executor) {
105524
105524
  const changes = /* @__PURE__ */ new Map();
105525
105525
  try {
105526
- const previous = [...this._chunks.entries()].filter(([, section]) => section.x === chunk.x && section.z === chunk.z);
105527
- for (const [key, section] of previous) {
105528
- this._chunks.delete(key);
105529
- await section.clear(async (positions) => {
105530
- for (const pos of positions) changes.set(pos.toArray().join(","), pos);
105531
- });
105532
- }
105526
+ await this.clearChunkColumn(chunk.x, chunk.z, changes);
105533
105527
  for (const section of chunk.sections) {
105534
105528
  const blocks = [];
105535
105529
  for (let index = 0; index < 4096; index++) {
@@ -105549,6 +105543,31 @@ gl_FragDepth=readDepth(vUv);
105549
105543
  await this.updateCulling([...changes.values()]);
105550
105544
  }
105551
105545
  }
105546
+ /**
105547
+ * Removes all sections at integer chunk-column coordinates, then refreshes neighboring faces and fluids.
105548
+ * Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
105549
+ */
105550
+ async unloadChunkColumn(x4, z4) {
105551
+ if (!Number.isInteger(x4) || !Number.isInteger(z4)) {
105552
+ throw new RangeError("Chunk column coordinates must be integers");
105553
+ }
105554
+ await this.culling;
105555
+ const changes = /* @__PURE__ */ new Map();
105556
+ try {
105557
+ await this.clearChunkColumn(x4, z4, changes);
105558
+ } finally {
105559
+ await this.updateCulling([...changes.values()]);
105560
+ }
105561
+ }
105562
+ async clearChunkColumn(x4, z4, changes) {
105563
+ const previous = [...this._chunks.entries()].filter(([, section]) => section.x === x4 && section.z === z4);
105564
+ for (const [key, section] of previous) {
105565
+ this._chunks.delete(key);
105566
+ await section.clear(async (positions) => {
105567
+ for (const pos of positions) changes.set(pos.toArray().join(","), pos);
105568
+ });
105569
+ }
105570
+ }
105552
105571
  async clear() {
105553
105572
  await this.culling;
105554
105573
  const chunks = [...this._chunks.values()];