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.
@@ -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
- Properties: {
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;
@@ -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
- Properties: {
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;
@@ -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
- if (["minecraft:air", "minecraft:cave_air", "minecraft:void_air"].includes(state.Name.value)) return void 0;
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
- for (let k in state.Properties?.value) {
13980
- props[k] = state.Properties.value[k].value;
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: state.Name.value,
13986
+ type: name,
13984
13987
  properties: props,
13985
13988
  position: block.pos.value.value,
13986
13989
  nbt: block.nbt