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.
@@ -11246,7 +11246,11 @@ var legacyBlocks_default = {
11246
11246
 
11247
11247
  // src/model/multiblock/SchematicParser.ts
11248
11248
  var SchematicParser = class {
11249
- static async parse(nbt) {
11249
+ /**
11250
+ * Parses a legacy schematic using custom mappings before the bundled defaults.
11251
+ * Keys are `id:metadata`; values are block states such as `minecraft:oak_log[axis=x]`.
11252
+ */
11253
+ static async parse(nbt, customMappings = {}) {
11250
11254
  const tags = nbt.value;
11251
11255
  if (tags.Materials?.type !== "string" || tags.Materials.value !== "Alpha") {
11252
11256
  throw new MineRenderError("Schematic Materials must be Alpha");
@@ -11288,15 +11292,16 @@ var SchematicParser = class {
11288
11292
  const high = packed >> (index & 1) * 4 & 15;
11289
11293
  const id = high << 8 | ids.value[index] & 255;
11290
11294
  const metadata = data.value[index] & 255;
11291
- const mapped = mapping[`${id}:${metadata}`];
11295
+ const key = `${id}:${metadata}`;
11296
+ const mapped = customMappings[key] ?? mapping[key];
11292
11297
  if (!mapped) throw new MineRenderError(`Unsupported legacy block ${id}:${metadata} at schematic index ${index}`);
11293
11298
  const [type, state] = mapped.split("[");
11294
11299
  if (type === "minecraft:air") continue;
11295
11300
  const properties = {};
11296
11301
  if (state) {
11297
11302
  for (const property of state.slice(0, -1).split(",")) {
11298
- const [key, value] = property.split("=");
11299
- properties[key] = value;
11303
+ const [key2, value] = property.split("=");
11304
+ properties[key2] = value;
11300
11305
  }
11301
11306
  }
11302
11307
  blocks.push({