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/browser/index.d.mts
CHANGED
|
@@ -2517,6 +2517,12 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
|
|
|
2517
2517
|
private placeBlocks;
|
|
2518
2518
|
/** Replaces one chunk column's blocks. Entity NBT remains available on the parsed chunk. */
|
|
2519
2519
|
placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
|
|
2520
|
+
/**
|
|
2521
|
+
* Removes all sections at integer chunk-column coordinates, then refreshes neighboring faces and fluids.
|
|
2522
|
+
* Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
|
|
2523
|
+
*/
|
|
2524
|
+
unloadChunkColumn(x: number, z: number): Promise<void>;
|
|
2525
|
+
private clearChunkColumn;
|
|
2520
2526
|
clear(): Promise<void>;
|
|
2521
2527
|
private updateCulling;
|
|
2522
2528
|
private getOrCreateChunkAt;
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -2517,6 +2517,12 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
|
|
|
2517
2517
|
private placeBlocks;
|
|
2518
2518
|
/** Replaces one chunk column's blocks. Entity NBT remains available on the parsed chunk. */
|
|
2519
2519
|
placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
|
|
2520
|
+
/**
|
|
2521
|
+
* Removes all sections at integer chunk-column coordinates, then refreshes neighboring faces and fluids.
|
|
2522
|
+
* Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
|
|
2523
|
+
*/
|
|
2524
|
+
unloadChunkColumn(x: number, z: number): Promise<void>;
|
|
2525
|
+
private clearChunkColumn;
|
|
2520
2526
|
clear(): Promise<void>;
|
|
2521
2527
|
private updateCulling;
|
|
2522
2528
|
private getOrCreateChunkAt;
|
package/dist/browser/index.js
CHANGED
|
@@ -15407,13 +15407,7 @@ var MineRenderWorld = class {
|
|
|
15407
15407
|
async placeChunk(chunk, executor) {
|
|
15408
15408
|
const changes = /* @__PURE__ */ new Map();
|
|
15409
15409
|
try {
|
|
15410
|
-
|
|
15411
|
-
for (const [key, section] of previous) {
|
|
15412
|
-
this._chunks.delete(key);
|
|
15413
|
-
await section.clear(async (positions) => {
|
|
15414
|
-
for (const pos of positions) changes.set(pos.toArray().join(","), pos);
|
|
15415
|
-
});
|
|
15416
|
-
}
|
|
15410
|
+
await this.clearChunkColumn(chunk.x, chunk.z, changes);
|
|
15417
15411
|
for (const section of chunk.sections) {
|
|
15418
15412
|
const blocks = [];
|
|
15419
15413
|
for (let index = 0; index < 4096; index++) {
|
|
@@ -15433,6 +15427,31 @@ var MineRenderWorld = class {
|
|
|
15433
15427
|
await this.updateCulling([...changes.values()]);
|
|
15434
15428
|
}
|
|
15435
15429
|
}
|
|
15430
|
+
/**
|
|
15431
|
+
* Removes all sections at integer chunk-column coordinates, then refreshes neighboring faces and fluids.
|
|
15432
|
+
* Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
|
|
15433
|
+
*/
|
|
15434
|
+
async unloadChunkColumn(x, z) {
|
|
15435
|
+
if (!Number.isInteger(x) || !Number.isInteger(z)) {
|
|
15436
|
+
throw new RangeError("Chunk column coordinates must be integers");
|
|
15437
|
+
}
|
|
15438
|
+
await this.culling;
|
|
15439
|
+
const changes = /* @__PURE__ */ new Map();
|
|
15440
|
+
try {
|
|
15441
|
+
await this.clearChunkColumn(x, z, changes);
|
|
15442
|
+
} finally {
|
|
15443
|
+
await this.updateCulling([...changes.values()]);
|
|
15444
|
+
}
|
|
15445
|
+
}
|
|
15446
|
+
async clearChunkColumn(x, z, changes) {
|
|
15447
|
+
const previous = [...this._chunks.entries()].filter(([, section]) => section.x === x && section.z === z);
|
|
15448
|
+
for (const [key, section] of previous) {
|
|
15449
|
+
this._chunks.delete(key);
|
|
15450
|
+
await section.clear(async (positions) => {
|
|
15451
|
+
for (const pos of positions) changes.set(pos.toArray().join(","), pos);
|
|
15452
|
+
});
|
|
15453
|
+
}
|
|
15454
|
+
}
|
|
15436
15455
|
async clear() {
|
|
15437
15456
|
await this.culling;
|
|
15438
15457
|
const chunks = [...this._chunks.values()];
|