minerender 2.1.0-alpha.63 → 2.1.0-alpha.64

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
@@ -90112,7 +90112,11 @@ property list uchar int vertex_index
90112
90112
 
90113
90113
  // src/model/multiblock/SchematicParser.ts
90114
90114
  var SchematicParser = class {
90115
- static async parse(nbt) {
90115
+ /**
90116
+ * Parses a legacy schematic using custom mappings before the bundled defaults.
90117
+ * Keys are `id:metadata`; values are block states such as `minecraft:oak_log[axis=x]`.
90118
+ */
90119
+ static async parse(nbt, customMappings = {}) {
90116
90120
  const tags = nbt.value;
90117
90121
  if (tags.Materials?.type !== "string" || tags.Materials.value !== "Alpha") {
90118
90122
  throw new MineRenderError("Schematic Materials must be Alpha");
@@ -90154,15 +90158,16 @@ property list uchar int vertex_index
90154
90158
  const high = packed >> (index & 1) * 4 & 15;
90155
90159
  const id = high << 8 | ids.value[index] & 255;
90156
90160
  const metadata = data.value[index] & 255;
90157
- const mapped = mapping[`${id}:${metadata}`];
90161
+ const key = `${id}:${metadata}`;
90162
+ const mapped = customMappings[key] ?? mapping[key];
90158
90163
  if (!mapped) throw new MineRenderError(`Unsupported legacy block ${id}:${metadata} at schematic index ${index}`);
90159
90164
  const [type, state] = mapped.split("[");
90160
90165
  if (type === "minecraft:air") continue;
90161
90166
  const properties = {};
90162
90167
  if (state) {
90163
90168
  for (const property of state.slice(0, -1).split(",")) {
90164
- const [key, value] = property.split("=");
90165
- properties[key] = value;
90169
+ const [key2, value] = property.split("=");
90170
+ properties[key2] = value;
90166
90171
  }
90167
90172
  }
90168
90173
  blocks.push({