minerender 2.1.0-alpha.138 → 2.1.0-alpha.139
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/esm/index.browser.d.mts +12 -2
- package/dist/browser/esm/model/multiblock/StructureParser.mjs +7 -4
- package/dist/browser/esm/model/multiblock/StructureParser.mjs.map +1 -1
- package/dist/browser/index.d.ts +12 -2
- package/dist/browser/index.js +7 -4
- package/dist/browser/index.js.map +1 -1
- package/dist/bundle.js +7 -4
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +12 -2
- package/dist/node/index.d.ts +12 -2
- package/dist/node/index.js +7 -4
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +7 -4
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.d.mts
CHANGED
|
@@ -2493,11 +2493,21 @@ interface Palette {
|
|
|
2493
2493
|
};
|
|
2494
2494
|
}
|
|
2495
2495
|
interface PaletteEntry {
|
|
2496
|
-
Name
|
|
2496
|
+
Name?: {
|
|
2497
2497
|
type: "string";
|
|
2498
2498
|
value: string;
|
|
2499
2499
|
};
|
|
2500
|
-
|
|
2500
|
+
id?: {
|
|
2501
|
+
type: "string";
|
|
2502
|
+
value: string;
|
|
2503
|
+
};
|
|
2504
|
+
Properties?: {
|
|
2505
|
+
type: "compound";
|
|
2506
|
+
value: {
|
|
2507
|
+
[property: string]: PalettePropertyValue;
|
|
2508
|
+
};
|
|
2509
|
+
};
|
|
2510
|
+
properties?: {
|
|
2501
2511
|
type: "compound";
|
|
2502
2512
|
value: {
|
|
2503
2513
|
[property: string]: PalettePropertyValue;
|
package/dist/node/index.d.ts
CHANGED
|
@@ -2493,11 +2493,21 @@ interface Palette {
|
|
|
2493
2493
|
};
|
|
2494
2494
|
}
|
|
2495
2495
|
interface PaletteEntry {
|
|
2496
|
-
Name
|
|
2496
|
+
Name?: {
|
|
2497
2497
|
type: "string";
|
|
2498
2498
|
value: string;
|
|
2499
2499
|
};
|
|
2500
|
-
|
|
2500
|
+
id?: {
|
|
2501
|
+
type: "string";
|
|
2502
|
+
value: string;
|
|
2503
|
+
};
|
|
2504
|
+
Properties?: {
|
|
2505
|
+
type: "compound";
|
|
2506
|
+
value: {
|
|
2507
|
+
[property: string]: PalettePropertyValue;
|
|
2508
|
+
};
|
|
2509
|
+
};
|
|
2510
|
+
properties?: {
|
|
2501
2511
|
type: "compound";
|
|
2502
2512
|
value: {
|
|
2503
2513
|
[property: string]: PalettePropertyValue;
|
package/dist/node/index.js
CHANGED
|
@@ -13974,13 +13974,16 @@ var StructureParser = class {
|
|
|
13974
13974
|
const blocks = nbt.blocks.value.value.map((block) => {
|
|
13975
13975
|
const state = palette.value.value[block.state.value];
|
|
13976
13976
|
if (!state) throw new MineRenderError(`Structure palette index ${block.state.value} does not exist`);
|
|
13977
|
-
|
|
13977
|
+
const name = (state.Name ?? state.id)?.value;
|
|
13978
|
+
if (!name) throw new MineRenderError(`Structure palette entry ${block.state.value} has no block name`);
|
|
13979
|
+
if (["minecraft:air", "minecraft:cave_air", "minecraft:void_air"].includes(name)) return void 0;
|
|
13978
13980
|
const props = {};
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
+
const properties = (state.Properties ?? state.properties)?.value;
|
|
13982
|
+
for (let k in properties) {
|
|
13983
|
+
props[k] = properties[k].value;
|
|
13981
13984
|
}
|
|
13982
13985
|
return {
|
|
13983
|
-
type:
|
|
13986
|
+
type: name,
|
|
13984
13987
|
properties: props,
|
|
13985
13988
|
position: block.pos.value.value,
|
|
13986
13989
|
nbt: block.nbt
|