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/browser/index.d.mts +6 -0
- package/dist/browser/index.d.ts +6 -0
- package/dist/browser/index.js +26 -7
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +26 -7
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +26 -7
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +6 -0
- package/dist/node/index.d.ts +6 -0
- package/dist/node/index.js +26 -7
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +26 -7
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.mjs
CHANGED
|
@@ -15336,13 +15336,7 @@ var MineRenderWorld = class {
|
|
|
15336
15336
|
async placeChunk(chunk, executor) {
|
|
15337
15337
|
const changes = /* @__PURE__ */ new Map();
|
|
15338
15338
|
try {
|
|
15339
|
-
|
|
15340
|
-
for (const [key, section] of previous) {
|
|
15341
|
-
this._chunks.delete(key);
|
|
15342
|
-
await section.clear(async (positions) => {
|
|
15343
|
-
for (const pos of positions) changes.set(pos.toArray().join(","), pos);
|
|
15344
|
-
});
|
|
15345
|
-
}
|
|
15339
|
+
await this.clearChunkColumn(chunk.x, chunk.z, changes);
|
|
15346
15340
|
for (const section of chunk.sections) {
|
|
15347
15341
|
const blocks = [];
|
|
15348
15342
|
for (let index = 0; index < 4096; index++) {
|
|
@@ -15362,6 +15356,31 @@ var MineRenderWorld = class {
|
|
|
15362
15356
|
await this.updateCulling([...changes.values()]);
|
|
15363
15357
|
}
|
|
15364
15358
|
}
|
|
15359
|
+
/**
|
|
15360
|
+
* Removes all sections at integer chunk-column coordinates, then refreshes neighboring faces and fluids.
|
|
15361
|
+
* Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
|
|
15362
|
+
*/
|
|
15363
|
+
async unloadChunkColumn(x, z) {
|
|
15364
|
+
if (!Number.isInteger(x) || !Number.isInteger(z)) {
|
|
15365
|
+
throw new RangeError("Chunk column coordinates must be integers");
|
|
15366
|
+
}
|
|
15367
|
+
await this.culling;
|
|
15368
|
+
const changes = /* @__PURE__ */ new Map();
|
|
15369
|
+
try {
|
|
15370
|
+
await this.clearChunkColumn(x, z, changes);
|
|
15371
|
+
} finally {
|
|
15372
|
+
await this.updateCulling([...changes.values()]);
|
|
15373
|
+
}
|
|
15374
|
+
}
|
|
15375
|
+
async clearChunkColumn(x, z, changes) {
|
|
15376
|
+
const previous = [...this._chunks.entries()].filter(([, section]) => section.x === x && section.z === z);
|
|
15377
|
+
for (const [key, section] of previous) {
|
|
15378
|
+
this._chunks.delete(key);
|
|
15379
|
+
await section.clear(async (positions) => {
|
|
15380
|
+
for (const pos of positions) changes.set(pos.toArray().join(","), pos);
|
|
15381
|
+
});
|
|
15382
|
+
}
|
|
15383
|
+
}
|
|
15365
15384
|
async clear() {
|
|
15366
15385
|
await this.culling;
|
|
15367
15386
|
const chunks = [...this._chunks.values()];
|