@nodecraft/rendermite 1.0.7 → 1.1.1

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.
Files changed (171) hide show
  1. package/assets/README.md +6 -2
  2. package/assets/builtin/renderchest/models/item/trident.json +372 -0
  3. package/assets/builtin-legacy/renderchest/models/item/trident.json +372 -0
  4. package/assets/mod-models/README.md +130 -0
  5. package/assets/mod-models/ad_astra/models/item/tier_1_rocket.json +4559 -0
  6. package/assets/mod-models/ad_astra/models/item/tier_1_rover.json +6021 -0
  7. package/assets/mod-models/ad_astra/models/item/tier_2_rocket.json +6832 -0
  8. package/assets/mod-models/ad_astra/models/item/tier_3_rocket.json +8522 -0
  9. package/assets/mod-models/ad_astra/models/item/tier_4_rocket.json +7498 -0
  10. package/assets/mod-models/botania/models/item/avatar.json +574 -0
  11. package/assets/mod-models/botania/models/item/bellows.json +423 -0
  12. package/assets/mod-models/botania/models/item/brewery.json +894 -0
  13. package/assets/mod-models/botania/models/item/corporea_index.json +349 -0
  14. package/assets/mod-models/botania/models/item/gaia_pylon.json +1057 -0
  15. package/assets/mod-models/botania/models/item/hourglass.json +502 -0
  16. package/assets/mod-models/botania/models/item/mana_pylon.json +741 -0
  17. package/assets/mod-models/botania/models/item/natura_pylon.json +1057 -0
  18. package/assets/mod-models/botania/models/item/teru_teru_bozu.json +347 -0
  19. package/assets/mod-models/mekanism/models/item/atomic_disassembler.json +1391 -0
  20. package/assets/mod-models/mekanism/models/item/flamethrower.json +1926 -0
  21. package/assets/mod-models/mekanism/models/item/free_runners.json +595 -0
  22. package/assets/mod-models/mekanism/models/item/jetpack.json +1767 -0
  23. package/assets/mod-models/mekanism/models/item/scuba_mask.json +2305 -0
  24. package/assets/mod-models/mekanism/models/item/scuba_tank.json +833 -0
  25. package/assets/mod-tints/README.md +19 -0
  26. package/assets/mod-tints/mysticalagriculture/items/absorption_i_augment.json +16 -0
  27. package/assets/mod-tints/mysticalagriculture/items/absorption_ii_augment.json +16 -0
  28. package/assets/mod-tints/mysticalagriculture/items/absorption_iii_augment.json +16 -0
  29. package/assets/mod-tints/mysticalagriculture/items/absorption_iv_augment.json +16 -0
  30. package/assets/mod-tints/mysticalagriculture/items/absorption_v_augment.json +16 -0
  31. package/assets/mod-tints/mysticalagriculture/items/attack_aoe_i_augment.json +16 -0
  32. package/assets/mod-tints/mysticalagriculture/items/attack_aoe_ii_augment.json +16 -0
  33. package/assets/mod-tints/mysticalagriculture/items/attack_aoe_iii_augment.json +16 -0
  34. package/assets/mod-tints/mysticalagriculture/items/blindness_resistance_augment.json +16 -0
  35. package/assets/mod-tints/mysticalagriculture/items/fire_resistance_augment.json +16 -0
  36. package/assets/mod-tints/mysticalagriculture/items/flight_augment.json +16 -0
  37. package/assets/mod-tints/mysticalagriculture/items/haste_i_augment.json +16 -0
  38. package/assets/mod-tints/mysticalagriculture/items/haste_ii_augment.json +16 -0
  39. package/assets/mod-tints/mysticalagriculture/items/haste_iii_augment.json +16 -0
  40. package/assets/mod-tints/mysticalagriculture/items/health_boost_i_augment.json +16 -0
  41. package/assets/mod-tints/mysticalagriculture/items/health_boost_ii_augment.json +16 -0
  42. package/assets/mod-tints/mysticalagriculture/items/health_boost_iii_augment.json +16 -0
  43. package/assets/mod-tints/mysticalagriculture/items/health_boost_iv_augment.json +16 -0
  44. package/assets/mod-tints/mysticalagriculture/items/health_boost_v_augment.json +16 -0
  45. package/assets/mod-tints/mysticalagriculture/items/hunger_resistance_augment.json +16 -0
  46. package/assets/mod-tints/mysticalagriculture/items/jump_boost_i_augment.json +16 -0
  47. package/assets/mod-tints/mysticalagriculture/items/jump_boost_ii_augment.json +16 -0
  48. package/assets/mod-tints/mysticalagriculture/items/jump_boost_iii_augment.json +16 -0
  49. package/assets/mod-tints/mysticalagriculture/items/luck_i_augment.json +16 -0
  50. package/assets/mod-tints/mysticalagriculture/items/luck_ii_augment.json +16 -0
  51. package/assets/mod-tints/mysticalagriculture/items/luck_iii_augment.json +16 -0
  52. package/assets/mod-tints/mysticalagriculture/items/mining_aoe_i_augment.json +16 -0
  53. package/assets/mod-tints/mysticalagriculture/items/mining_aoe_ii_augment.json +16 -0
  54. package/assets/mod-tints/mysticalagriculture/items/mining_aoe_iii_augment.json +16 -0
  55. package/assets/mod-tints/mysticalagriculture/items/mining_aoe_iv_augment.json +16 -0
  56. package/assets/mod-tints/mysticalagriculture/items/mining_fatigue_resistance_augment.json +16 -0
  57. package/assets/mod-tints/mysticalagriculture/items/nausea_resistance_augment.json +16 -0
  58. package/assets/mod-tints/mysticalagriculture/items/night_vision_augment.json +16 -0
  59. package/assets/mod-tints/mysticalagriculture/items/pathing_aoe_i_augment.json +16 -0
  60. package/assets/mod-tints/mysticalagriculture/items/pathing_aoe_ii_augment.json +16 -0
  61. package/assets/mod-tints/mysticalagriculture/items/pathing_aoe_iii_augment.json +16 -0
  62. package/assets/mod-tints/mysticalagriculture/items/pathing_aoe_iv_augment.json +16 -0
  63. package/assets/mod-tints/mysticalagriculture/items/poison_resistance_augment.json +16 -0
  64. package/assets/mod-tints/mysticalagriculture/items/slow_falling_augment.json +16 -0
  65. package/assets/mod-tints/mysticalagriculture/items/slowness_resistance_augment.json +16 -0
  66. package/assets/mod-tints/mysticalagriculture/items/speed_i_augment.json +16 -0
  67. package/assets/mod-tints/mysticalagriculture/items/speed_ii_augment.json +16 -0
  68. package/assets/mod-tints/mysticalagriculture/items/speed_iii_augment.json +16 -0
  69. package/assets/mod-tints/mysticalagriculture/items/step_assist_augment.json +16 -0
  70. package/assets/mod-tints/mysticalagriculture/items/strength_i_augment.json +16 -0
  71. package/assets/mod-tints/mysticalagriculture/items/strength_ii_augment.json +16 -0
  72. package/assets/mod-tints/mysticalagriculture/items/strength_iii_augment.json +16 -0
  73. package/assets/mod-tints/mysticalagriculture/items/tilling_aoe_i_augment.json +16 -0
  74. package/assets/mod-tints/mysticalagriculture/items/tilling_aoe_ii_augment.json +16 -0
  75. package/assets/mod-tints/mysticalagriculture/items/tilling_aoe_iii_augment.json +16 -0
  76. package/assets/mod-tints/mysticalagriculture/items/tilling_aoe_iv_augment.json +16 -0
  77. package/assets/mod-tints/mysticalagriculture/items/water_breathing_augment.json +16 -0
  78. package/assets/mod-tints/mysticalagriculture/items/weakness_resistance_augment.json +16 -0
  79. package/assets/mod-tints/mysticalagriculture/items/wither_resistance_augment.json +16 -0
  80. package/dist/atlas/registry.js +1 -1
  81. package/dist/blend-8lnfxtLe.d.ts +79 -0
  82. package/dist/blend-KXMclcHk.js +199 -0
  83. package/dist/blockstate-CdstnW2-.js +104 -0
  84. package/dist/{builtin-caYjESh0.js → builtin-WkWjATeh.js} +5 -1
  85. package/dist/builtin.d.ts +3 -1
  86. package/dist/builtin.js +2 -2
  87. package/dist/cli.js +5 -3
  88. package/dist/{compose-lWPrB7wh.js → compose-BGsNFR12.js} +1 -1
  89. package/dist/{definition-3MBm8ar_.js → definition-ColsvWrH.js} +20 -1
  90. package/dist/{definition-BwX6Xxv0.d.ts → definition-ricL7Jqf.d.ts} +2 -0
  91. package/dist/{discovery-0SM0cTLw.js → discovery-B9aqV_Rz.js} +13 -3
  92. package/dist/{discovery-wiJBGryo.d.ts → discovery-BPSUtdm4.d.ts} +1 -1
  93. package/dist/{encode-CaSK8-mi.d.ts → encode-DNcXXvYe.d.ts} +1 -1
  94. package/dist/{encode-Df_tWzkl.js → encode-LR9wxigC.js} +1 -1
  95. package/dist/{entity-fallback-D9QTGU9X.js → entity-fallback-BnFMSHS6.js} +180 -10
  96. package/dist/{face-Cl1O4m2i.js → face-CMJ3b3Ae.js} +44 -18
  97. package/dist/face-cQ-pVHoe.d.ts +44 -0
  98. package/dist/{fluid-bucket-D-GpUQjg.js → fluid-bucket-BzoLofB_.js} +7 -2
  99. package/dist/{geo-DHiWBa-C.js → geo-w9HHIrb5.js} +87 -13
  100. package/dist/{geometry-uIDha8S4.js → geometry-Bi-Bf5rb.js} +7 -1
  101. package/dist/{geometry-BSVmKx5b.d.ts → geometry-w0yQbzDZ.d.ts} +5 -1
  102. package/dist/index.d.ts +9 -9
  103. package/dist/index.js +10 -10
  104. package/dist/items/blockstate.d.ts +23 -0
  105. package/dist/items/blockstate.js +2 -0
  106. package/dist/items/definition.d.ts +1 -1
  107. package/dist/items/definition.js +1 -1
  108. package/dist/items/discovery.d.ts +1 -1
  109. package/dist/items/discovery.js +1 -1
  110. package/dist/{loader-D22zZME7.d.ts → loader-DD83d80u.d.ts} +2 -1
  111. package/dist/{loader-B8NJO7pR.js → loader-DwkA9LR5.js} +267 -15
  112. package/dist/{loader-CfXMxcEV.js → loader-Lb0ZeILz.js} +19 -7
  113. package/dist/models/loader.d.ts +1 -1
  114. package/dist/models/loader.js +1 -1
  115. package/dist/models/types.d.ts +1 -1
  116. package/dist/models-BKxGkPS7.js +18 -0
  117. package/dist/mods/models.d.ts +5 -0
  118. package/dist/mods/models.js +2 -0
  119. package/dist/mods/prepare.d.ts +1 -1
  120. package/dist/mods/prepare.js +1 -1
  121. package/dist/mods/tints.js +1 -1
  122. package/dist/output/encode.d.ts +1 -1
  123. package/dist/output/encode.js +1 -1
  124. package/dist/{pipeline-HiA3DC71.d.ts → pipeline-Bp6amYz_.d.ts} +17 -5
  125. package/dist/{pipeline-Da2Kavba.js → pipeline-zu_ZjnNc.js} +85 -21
  126. package/dist/{prepare-BESRrh6K.js → prepare-D56Z-9cg.js} +7 -2
  127. package/dist/{prepare-CPxO0kKz.d.ts → prepare-Dce7-HAe.d.ts} +8 -0
  128. package/dist/{rasterizer-B9ZGJI3-.d.ts → rasterizer-BSQHEhJ-.d.ts} +4 -2
  129. package/dist/{rasterizer-76qO8TDh.js → rasterizer-DcVJzkxz.js} +13 -5
  130. package/dist/{registry-B9TcjVbs.js → registry-DS5PZ57l.js} +8 -1
  131. package/dist/render/blend.d.ts +2 -2
  132. package/dist/render/blend.js +2 -2
  133. package/dist/render/compose.d.ts +2 -2
  134. package/dist/render/compose.js +1 -1
  135. package/dist/render/entity-fallback.d.ts +19 -5
  136. package/dist/render/entity-fallback.js +2 -2
  137. package/dist/render/face.d.ts +2 -2
  138. package/dist/render/face.js +2 -2
  139. package/dist/render/fluid-bucket.js +1 -1
  140. package/dist/render/geo.d.ts +3 -3
  141. package/dist/render/geo.js +1 -1
  142. package/dist/render/geometry.d.ts +1 -1
  143. package/dist/render/geometry.js +1 -1
  144. package/dist/render/legacy-tints.d.ts +1 -1
  145. package/dist/render/obj.d.ts +5 -3
  146. package/dist/render/obj.js +1 -1
  147. package/dist/render/pipeline.d.ts +1 -1
  148. package/dist/render/pipeline.js +1 -1
  149. package/dist/render/rasterizer.d.ts +1 -1
  150. package/dist/render/rasterizer.js +1 -1
  151. package/dist/render/renderer.d.ts +1 -1
  152. package/dist/render/renderer.js +1 -1
  153. package/dist/render/tints.d.ts +1 -1
  154. package/dist/render/tints.js +1 -1
  155. package/dist/{renderer-B20ssjRm.d.ts → renderer-C79EQDSn.d.ts} +3 -3
  156. package/dist/{renderer-gQW_I7YG.js → renderer-oi1MSF3Y.js} +21 -10
  157. package/dist/{run-B0qPw3zf.js → run-D87zIGfr.js} +3 -3
  158. package/dist/{run-CT3VtFqg.d.ts → run-uq8_hUx9.d.ts} +1 -1
  159. package/dist/run.d.ts +2 -2
  160. package/dist/run.js +2 -2
  161. package/dist/textures/loader.js +1 -1
  162. package/dist/{tints-BtbHegpI.js → tints-3VI_2SNy.js} +107 -1
  163. package/dist/{tints-B8UJmZMu.js → tints-CebmvjmP.js} +2 -2
  164. package/dist/{tints-BH9l0ND0.d.ts → tints-Do9Sh3dg.d.ts} +2 -2
  165. package/dist/{types-COGbtA1t.d.ts → types-DpRSF9Vj.d.ts} +8 -0
  166. package/dist/workers/render-worker.d.ts +1 -1
  167. package/dist/workers/render-worker.js +1 -1
  168. package/package.json +1 -1
  169. package/dist/blend-CEHoJ7tM.d.ts +0 -37
  170. package/dist/blend-D0XWgVQr.js +0 -102
  171. package/dist/face-C49L66sQ.d.ts +0 -30
@@ -1,9 +1,9 @@
1
- import { n as displayMatrix } from "./vector-CCxLae_T.js";
2
1
  import { n as ResourceLocator } from "./locator-ycZzh_6z.js";
3
- import { s as toFloatTexture } from "./blend-D0XWgVQr.js";
4
- import { t as combineFaceBuffers } from "./compose-lWPrB7wh.js";
5
- import { i as createFaceBuffer } from "./rasterizer-76qO8TDh.js";
6
- import { n as renderFace, t as faceMaxZ } from "./face-Cl1O4m2i.js";
2
+ import { n as displayMatrix } from "./vector-CCxLae_T.js";
3
+ import { l as toFloatTexture } from "./blend-KXMclcHk.js";
4
+ import { t as combineFaceBuffers } from "./compose-BGsNFR12.js";
5
+ import { i as createFaceBuffer } from "./rasterizer-DcVJzkxz.js";
6
+ import { n as faceMaxZ, r as renderFace, t as createShadeCache } from "./face-CMJ3b3Ae.js";
7
7
  import { c as lightsForProfile } from "./lighting--5myudVu.js";
8
8
  //#region src/render/geo.ts
9
9
  /**
@@ -222,6 +222,12 @@ function geoToFaces(geo) {
222
222
  point[1],
223
223
  point[2]
224
224
  ]);
225
+ corners = [
226
+ corners[0],
227
+ corners[3],
228
+ corners[2],
229
+ corners[1]
230
+ ];
225
231
  for (const point of corners) for (let axis = 0; axis < 3; axis++) {
226
232
  min[axis] = Math.min(min[axis], point[axis]);
227
233
  max[axis] = Math.max(max[axis], point[axis]);
@@ -234,7 +240,9 @@ function geoToFaces(geo) {
234
240
  textureRef: "#geo",
235
241
  rotation: 0,
236
242
  tintIndex: null,
237
- shadeDirectionOverride: null
243
+ shadeDirectionOverride: null,
244
+ emissive: false,
245
+ alpha: 1
238
246
  });
239
247
  }
240
248
  }
@@ -259,10 +267,22 @@ async function findGeoForItem(resources, id) {
259
267
  `geckolib/geo/${locator.path}.geo.json`,
260
268
  `models/geo/${locator.path}.geo.json`
261
269
  ];
262
- if (!(await Promise.all(geoPaths.map((path) => resources.hasResource("raw", new ResourceLocator(locator.namespace, path))))).includes(true)) {
263
- const name = locator.path.split("/").pop();
264
- const matches = (await resources.listResources("raw", locator.namespace)).map((candidate) => candidate.path).filter((path) => path.endsWith(`/${name}.geo.json`) && /(?:^|\/)(?:geo|geckolib)\//.test(path)).toSorted((a, b) => a.length - b.length);
270
+ const geoPathHits = await Promise.all(geoPaths.map((path) => resources.hasResource("raw", new ResourceLocator(locator.namespace, path))));
271
+ const name = locator.path.split("/").pop() ?? locator.path;
272
+ if (!geoPathHits.includes(true)) {
273
+ const geoFiles = (await resources.listResources("raw", locator.namespace)).map((candidate) => candidate.path).filter((path) => path.endsWith(".geo.json") && /(?:^|\/)(?:geo|geckolib)\//.test(path));
274
+ const matches = geoFiles.filter((path) => path.endsWith(`/${name}.geo.json`)).toSorted((left, right) => left.length - right.length);
265
275
  geoPaths.push(...matches);
276
+ if (matches.length === 0) {
277
+ const wanted = new Set(nameTokens(name));
278
+ const scored = geoFiles.map((path) => {
279
+ return {
280
+ path,
281
+ tokens: nameTokens(path.split("/").pop()?.replace(/\.geo\.json$/, "") ?? "")
282
+ };
283
+ }).filter((entry) => entry.tokens.length > 0 && entry.tokens.every((token) => wanted.has(token))).toSorted((left, right) => right.tokens.length - left.tokens.length || left.path.length - right.path.length);
284
+ geoPaths.push(...scored.map((entry) => entry.path));
285
+ }
266
286
  }
267
287
  for (const geoPath of geoPaths) {
268
288
  const raw = await resources.getResource("raw", new ResourceLocator(locator.namespace, geoPath));
@@ -287,9 +307,63 @@ async function findGeoForItem(resources, id) {
287
307
  texture
288
308
  };
289
309
  }
310
+ const geoName = geoPath.split("/").pop()?.replace(/\.geo\.json$/, "") ?? "";
311
+ const named = await findTextureByName(resources, locator.namespace, name) ?? await findVariantTexture(resources, locator.namespace, name) ?? await findTextureByName(resources, locator.namespace, geoName);
312
+ if (named) return {
313
+ geo,
314
+ texture: named
315
+ };
290
316
  }
291
317
  return null;
292
318
  }
319
+ /** Name tokens, dropping the numeric suffixes mods use for shape variants. */
320
+ function nameTokens(name) {
321
+ return name.split(/[/_]/).filter((token) => token.length > 0 && !/^\d+$/.test(token));
322
+ }
323
+ /**
324
+ * A skin whose name carries every token of the item's, in any order and with
325
+ * decoration allowed. pokeblocks writes `pokedoll_shiny_absol` as
326
+ * `pokedoll_absol_shiny_texture.png`, so neither an exact nor a suffix match
327
+ * finds it. Requiring the item's tokens to all be present keeps this from
328
+ * wandering onto a sibling variant's skin.
329
+ */
330
+ async function findVariantTexture(resources, namespace, itemName) {
331
+ const wanted = nameTokens(itemName);
332
+ if (wanted.length === 0) return null;
333
+ let best = null;
334
+ let bestExtra = Infinity;
335
+ for (const locator of await resources.listResources("texture", namespace)) {
336
+ const tokens = nameTokens(locator.path.split("/").pop() ?? "").filter((token) => token !== "texture");
337
+ if (!wanted.every((token) => tokens.includes(token))) continue;
338
+ const extra = tokens.length - wanted.length;
339
+ if (extra < bestExtra || extra === bestExtra && best !== null && locator.path.length < best.path.length) {
340
+ best = locator;
341
+ bestExtra = extra;
342
+ }
343
+ }
344
+ return best;
345
+ }
346
+ /**
347
+ * The shortest-path texture named after `name`. GeckoLib binds the skin in Java
348
+ * rather than in the geo file, so the only link is the shared name — and a mod
349
+ * may decorate it (pokeblocks files 344 figurines as `<name>_texture.png`).
350
+ * An exact match always wins over a decorated one.
351
+ */
352
+ async function findTextureByName(resources, namespace, name) {
353
+ if (name === "") return null;
354
+ let best = null;
355
+ let bestExact = false;
356
+ for (const locator of await resources.listResources("texture", namespace)) {
357
+ const leaf = locator.path.split("/").pop() ?? "";
358
+ const exact = leaf === name;
359
+ if (!exact && leaf !== `${name}_texture`) continue;
360
+ if (best === null || exact && !bestExact || exact === bestExact && locator.path.length < best.path.length) {
361
+ best = locator;
362
+ bestExact = exact;
363
+ }
364
+ }
365
+ return best;
366
+ }
293
367
  /** Render a parsed geo with the standard block gui pose. */
294
368
  async function renderGeo(geo, texture, textures, options) {
295
369
  const faces = geoToFaces(geo);
@@ -308,9 +382,9 @@ async function renderGeo(geo, texture, textures, options) {
308
382
  0,
309
383
  0
310
384
  ], [
311
- .9,
312
- .9,
313
- .9
385
+ .625,
386
+ .625,
387
+ .625
314
388
  ]);
315
389
  const renderable = faces.map((geometry) => {
316
390
  return {
@@ -324,7 +398,7 @@ async function renderGeo(geo, texture, textures, options) {
324
398
  renderable.sort((a, b) => a.maxZ - b.maxZ);
325
399
  const buffers = [];
326
400
  const scratch = createFaceBuffer(renderSize, renderSize);
327
- const shadeCache = /* @__PURE__ */ new WeakMap();
401
+ const shadeCache = createShadeCache();
328
402
  for (const face of renderable) {
329
403
  const buffer = renderFace(face, renderSize, renderSize, transformation, scratch, shadeCache);
330
404
  if (buffer) buffers.push(buffer);
@@ -151,7 +151,9 @@ function buildElementFaces(element) {
151
151
  textureRef: faceJson.texture,
152
152
  rotation: faceJson.rotation ?? 0,
153
153
  tintIndex: faceJson.tintindex ?? null,
154
- shadeDirectionOverride: override
154
+ shadeDirectionOverride: override,
155
+ emissive: element.emissive_rc === true,
156
+ alpha: clampAlpha(element.alpha_rc)
155
157
  });
156
158
  }
157
159
  applyElementRotation(element.rotation_rc ?? element.rotation, [
@@ -166,6 +168,10 @@ function buildElementFaces(element) {
166
168
  ]);
167
169
  return faces;
168
170
  }
171
+ function clampAlpha(alpha) {
172
+ if (typeof alpha !== "number" || !Number.isFinite(alpha)) return 1;
173
+ return Math.min(1, Math.max(0, alpha));
174
+ }
169
175
  function parseShadeOverride(element) {
170
176
  const override = element.shade_direction_override;
171
177
  if (override && override in FACE_NORMALS) return FACE_NORMALS[override];
@@ -1,4 +1,4 @@
1
- import { a as FaceDirectionName, o as ModelElementJson, r as ElementRotationJson } from "./types-COGbtA1t.js";
1
+ import { a as FaceDirectionName, o as ModelElementJson, r as ElementRotationJson } from "./types-DpRSF9Vj.js";
2
2
  import { n as Vec3 } from "./vector-DRKRi4--.js";
3
3
  //#region src/render/geometry.d.ts
4
4
  interface FaceGeometry {
@@ -13,6 +13,10 @@ interface FaceGeometry {
13
13
  rotation: number;
14
14
  tintIndex: number | null;
15
15
  shadeDirectionOverride: Vec3 | null;
16
+ /** Skip directional shading — the element is drawn fullbright. */
17
+ emissive: boolean;
18
+ /** Constant opacity multiplier in [0,1]; 1 leaves the texture untouched. */
19
+ alpha: number;
16
20
  }
17
21
  declare const FACE_NORMALS: Record<FaceDirectionName, Vec3>;
18
22
  declare function buildElementFaces(element: ModelElementJson): FaceGeometry[];
package/dist/index.d.ts CHANGED
@@ -3,18 +3,18 @@ import { a as ResourceManager, i as ResourceKindName, n as LayeredResourceManage
3
3
  import { a as TextureMeta, i as TextureLoader, o as TextureResolutionError, r as Texture, t as AnimatedTexture } from "./loader-Myy22TDL.js";
4
4
  import { d as parseAtlasSources, n as AtlasSource, r as AtlasSourceError, s as ResolvedSprite, t as AtlasResolver, u as createAtlasResolver } from "./sources-B9X9w3qP.js";
5
5
  import { s as builtinDynamicResources } from "./generators-DhRov4RB.js";
6
- import { a as resolveTexture, n as ModelResolutionError, o as salvageJson, r as ResolvedModel, t as ModelLoader } from "./loader-D22zZME7.js";
7
- import { c as toFloatTexture, s as toByteTexture, t as FloatTexture } from "./blend-CEHoJ7tM.js";
6
+ import { a as resolveTexture, n as ModelResolutionError, o as salvageJson, r as ResolvedModel, t as ModelLoader } from "./loader-DD83d80u.js";
7
+ import { d as toFloatTexture, n as FloatTexture, u as toByteTexture } from "./blend-8lnfxtLe.js";
8
8
  import { a as LightingProfileName, i as LightingProfile, r as LightSource, u as lightsForProfile } from "./lighting-3FGRC3Af.js";
9
- import { a as RenderedFrames, c as renderModel, i as RenderOptions, l as renderModelFrames, o as boxDownscale, r as ItemRenderError, s as pointResize } from "./renderer-B20ssjRm.js";
10
- import { c as defaultProperties, i as ItemRenderInstruction, l as evaluateItemModel, n as InvalidItemDefinitionError, o as TintDefinition, r as ItemProperties, s as UNKNOWN_MODEL } from "./definition-BwX6Xxv0.js";
11
- import { a as resolveItem, i as discoverItems, n as ItemDiscoveryOptions, r as ItemResolutionError, t as DiscoveredItem } from "./discovery-wiJBGryo.js";
12
- import { a as resolveTint, i as parseTintValue, n as InvalidTinterDefinitionError, o as resolveTints, t as DYE_COLORS } from "./tints-BH9l0ND0.js";
13
- import { i as EncodedIcon, n as EncodeOptions, o as encodeAnimatedIcon, r as EncodedAnimatedIcon, s as encodeIcon, t as AnimatedEncodeOptions } from "./encode-CaSK8-mi.js";
9
+ import { a as RenderedFrames, c as renderModel, i as RenderOptions, l as renderModelFrames, o as boxDownscale, r as ItemRenderError, s as pointResize } from "./renderer-C79EQDSn.js";
10
+ import { c as defaultProperties, i as ItemRenderInstruction, l as evaluateItemModel, n as InvalidItemDefinitionError, o as TintDefinition, r as ItemProperties, s as UNKNOWN_MODEL } from "./definition-ricL7Jqf.js";
11
+ import { a as resolveItem, i as discoverItems, n as ItemDiscoveryOptions, r as ItemResolutionError, t as DiscoveredItem } from "./discovery-BPSUtdm4.js";
12
+ import { a as resolveTint, i as parseTintValue, n as InvalidTinterDefinitionError, o as resolveTints, t as DYE_COLORS } from "./tints-Do9Sh3dg.js";
13
+ import { i as EncodedIcon, n as EncodeOptions, o as encodeAnimatedIcon, r as EncodedAnimatedIcon, s as encodeIcon, t as AnimatedEncodeOptions } from "./encode-DNcXXvYe.js";
14
14
  import { t as minifyStylesheet } from "./minify-CIV6enbr.js";
15
15
  import { a as compareVersions, o as eraForVersion, s as prepareVersionResources } from "./prepare-Cs6QDqie.js";
16
- import { i as prepareModResources } from "./prepare-CPxO0kKz.js";
16
+ import { i as prepareModResources } from "./prepare-Dce7-HAe.js";
17
17
  import { i as itemClass, n as StylesheetOptions, r as generateStylesheet, t as ItemStyle } from "./stylesheet-i-t_7sZ7.js";
18
- import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-CT3VtFqg.js";
18
+ import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-uq8_hUx9.js";
19
19
  import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-CFkA-VgT.js";
20
20
  export { type AnimatedEncodeOptions, AnimatedTexture, type AtlasResolver, type AtlasSource, AtlasSourceError, DYE_COLORS, type DiscoveredItem, type EncodeOptions, type EncodedAnimatedIcon, type EncodedIcon, type FloatTexture, FolderResourceManager, InvalidItemDefinitionError, InvalidResourceLocatorError, InvalidTinterDefinitionError, type ItemDiscoveryOptions, type ItemFailure, type ItemProperties, ItemRenderError, type ItemRenderInstruction, ItemResolutionError, type ItemStyle, JarResourceManager, LayeredResourceManager, type LightSource, LightingProfile, type LightingProfileName, ModelLoader, ModelResolutionError, type RenderOptions, type RenderedFrames, type ResolvedModel, type ResolvedSprite, ResourceKind, type ResourceKindName, ResourceLocator, type ResourceManager, type RunOptions, type RunResult, type StylesheetOptions, type Texture, TextureLoader, type TextureMeta, TextureResolutionError, type TintDefinition, UNKNOWN_MODEL, UnsafeJarError, boxDownscale, builtinDynamicResources, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateItemModel, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, minifyStylesheet, parseAtlasSources, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture };
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
- import { a as defaultProperties, i as UNKNOWN_MODEL, n as InvalidItemDefinitionError, o as evaluateItemModel } from "./definition-3MBm8ar_.js";
2
1
  import { n as ResourceLocator, t as InvalidResourceLocatorError } from "./locator-ycZzh_6z.js";
3
2
  import { n as LayeredResourceManager, r as ResourceKind, t as FolderResourceManager } from "./manager-CkletR5K.js";
3
+ import { a as defaultProperties, i as UNKNOWN_MODEL, n as InvalidItemDefinitionError, o as evaluateItemModel } from "./definition-ColsvWrH.js";
4
4
  import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-D9z-X7tA.js";
5
- import { n as discoverItems, r as resolveItem, t as ItemResolutionError } from "./discovery-0SM0cTLw.js";
6
- import { o as toByteTexture, s as toFloatTexture } from "./blend-D0XWgVQr.js";
7
- import { n as encodeIcon, t as encodeAnimatedIcon } from "./encode-Df_tWzkl.js";
5
+ import { n as discoverItems, r as resolveItem, t as ItemResolutionError } from "./discovery-B9aqV_Rz.js";
6
+ import { c as toByteTexture, l as toFloatTexture } from "./blend-KXMclcHk.js";
7
+ import { n as encodeIcon, t as encodeAnimatedIcon } from "./encode-LR9wxigC.js";
8
8
  import { a as builtinDynamicResources } from "./generators-BlG4KmtP.js";
9
9
  import { t as minifyStylesheet } from "./minify-bjMRmr5J.js";
10
10
  import { n as itemClass, t as generateStylesheet } from "./stylesheet-CovT3B2S.js";
11
11
  import { c as lightsForProfile, r as LightingProfile } from "./lighting--5myudVu.js";
12
- import { a as salvageJson, i as resolveTexture, n as ModelResolutionError, t as ModelLoader } from "./loader-B8NJO7pR.js";
13
- import { a as renderModelFrames, i as renderModel, n as boxDownscale, r as pointResize, t as ItemRenderError } from "./renderer-gQW_I7YG.js";
14
- import { a as resolveTints, i as resolveTint, n as InvalidTinterDefinitionError, r as parseTintValue, t as DYE_COLORS } from "./tints-BtbHegpI.js";
12
+ import { a as salvageJson, i as resolveTexture, n as ModelResolutionError, t as ModelLoader } from "./loader-DwkA9LR5.js";
13
+ import { a as renderModelFrames, i as renderModel, n as boxDownscale, r as pointResize, t as ItemRenderError } from "./renderer-oi1MSF3Y.js";
14
+ import { a as resolveTints, i as resolveTint, n as InvalidTinterDefinitionError, r as parseTintValue, t as DYE_COLORS } from "./tints-3VI_2SNy.js";
15
15
  import { o as createAtlasResolver, s as parseAtlasSources, t as AtlasSourceError } from "./sources-Bxk-WOzH.js";
16
- import { n as TextureLoader, r as TextureResolutionError, t as AnimatedTexture } from "./loader-CfXMxcEV.js";
17
- import { t as run } from "./run-B0qPw3zf.js";
16
+ import { n as TextureLoader, r as TextureResolutionError, t as AnimatedTexture } from "./loader-Lb0ZeILz.js";
17
+ import { t as run } from "./run-D87zIGfr.js";
18
18
  import { a as prepareVersionResources, i as eraForVersion, r as compareVersions } from "./prepare-Cc8QZ3j0.js";
19
- import { n as prepareModResources } from "./prepare-BESRrh6K.js";
19
+ import { n as prepareModResources } from "./prepare-D56Z-9cg.js";
20
20
  export { AnimatedTexture, AtlasSourceError, DYE_COLORS, FolderResourceManager, InvalidItemDefinitionError, InvalidResourceLocatorError, InvalidTinterDefinitionError, ItemRenderError, ItemResolutionError, JarResourceManager, LayeredResourceManager, LightingProfile, ModelLoader, ModelResolutionError, ResourceKind, ResourceLocator, TextureLoader, TextureResolutionError, UNKNOWN_MODEL, UnsafeJarError, boxDownscale, builtinDynamicResources, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateItemModel, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, minifyStylesheet, parseAtlasSources, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture };
@@ -0,0 +1,23 @@
1
+ import { n as ResourceLocator } from "../locator-jDbdUeTd.js";
2
+ import { a as ResourceManager } from "../manager-Cv1NeFyF.js";
3
+ import { t as Mat4 } from "../vector-DRKRi4--.js";
4
+ //#region src/items/blockstate.d.ts
5
+ interface ResolvedBlockState {
6
+ model: ResourceLocator;
7
+ /** Blockstate rotations, in degrees; the item transform has to replay them. */
8
+ xRotation: number;
9
+ yRotation: number;
10
+ }
11
+ /**
12
+ * The block model an item's blockstate names for its default state, or null
13
+ * when the item has no blockstate or it states nothing usable.
14
+ */
15
+ declare function defaultBlockStateModel(resources: ResourceManager, id: string): Promise<ResolvedBlockState | null>;
16
+ /**
17
+ * The blockstate's own x/y rotation as an item transform. Vanilla applies these
18
+ * about the block's centre, and the game bakes them into the model before the
19
+ * display transform, so they compose the same way here.
20
+ */
21
+ declare function blockStateTransform(state: ResolvedBlockState): Mat4;
22
+ //#endregion
23
+ export { ResolvedBlockState, blockStateTransform, defaultBlockStateModel };
@@ -0,0 +1,2 @@
1
+ import { n as defaultBlockStateModel, t as blockStateTransform } from "../blockstate-CdstnW2-.js";
2
+ export { blockStateTransform, defaultBlockStateModel };
@@ -1,2 +1,2 @@
1
- import { a as STRING_DEFAULTS, c as defaultProperties, i as ItemRenderInstruction, l as evaluateItemModel, n as InvalidItemDefinitionError, o as TintDefinition, r as ItemProperties, s as UNKNOWN_MODEL, t as CONDITION_DEFAULTS } from "../definition-BwX6Xxv0.js";
1
+ import { a as STRING_DEFAULTS, c as defaultProperties, i as ItemRenderInstruction, l as evaluateItemModel, n as InvalidItemDefinitionError, o as TintDefinition, r as ItemProperties, s as UNKNOWN_MODEL, t as CONDITION_DEFAULTS } from "../definition-ricL7Jqf.js";
2
2
  export { CONDITION_DEFAULTS, InvalidItemDefinitionError, ItemProperties, ItemRenderInstruction, STRING_DEFAULTS, TintDefinition, UNKNOWN_MODEL, defaultProperties, evaluateItemModel };
@@ -1,2 +1,2 @@
1
- import { a as defaultProperties, i as UNKNOWN_MODEL, n as InvalidItemDefinitionError, o as evaluateItemModel, r as STRING_DEFAULTS, t as CONDITION_DEFAULTS } from "../definition-3MBm8ar_.js";
1
+ import { a as defaultProperties, i as UNKNOWN_MODEL, n as InvalidItemDefinitionError, o as evaluateItemModel, r as STRING_DEFAULTS, t as CONDITION_DEFAULTS } from "../definition-ColsvWrH.js";
2
2
  export { CONDITION_DEFAULTS, InvalidItemDefinitionError, STRING_DEFAULTS, UNKNOWN_MODEL, defaultProperties, evaluateItemModel };
@@ -1,2 +1,2 @@
1
- import { a as resolveItem, i as discoverItems, n as ItemDiscoveryOptions, r as ItemResolutionError, t as DiscoveredItem } from "../discovery-wiJBGryo.js";
1
+ import { a as resolveItem, i as discoverItems, n as ItemDiscoveryOptions, r as ItemResolutionError, t as DiscoveredItem } from "../discovery-BPSUtdm4.js";
2
2
  export { DiscoveredItem, ItemDiscoveryOptions, ItemResolutionError, discoverItems, resolveItem };
@@ -1,2 +1,2 @@
1
- import { n as discoverItems, r as resolveItem, t as ItemResolutionError } from "../discovery-0SM0cTLw.js";
1
+ import { n as discoverItems, r as resolveItem, t as ItemResolutionError } from "../discovery-B9aqV_Rz.js";
2
2
  export { ItemResolutionError, discoverItems, resolveItem };
@@ -1,6 +1,6 @@
1
1
  import { n as ResourceLocator } from "./locator-jDbdUeTd.js";
2
2
  import { a as ResourceManager } from "./manager-Cv1NeFyF.js";
3
- import { c as ModelJson, n as DisplayTransformJson, o as ModelElementJson, t as DisplayPosition } from "./types-COGbtA1t.js";
3
+ import { c as ModelJson, n as DisplayTransformJson, o as ModelElementJson, t as DisplayPosition } from "./types-DpRSF9Vj.js";
4
4
  //#region src/models/loader.d.ts
5
5
  /**
6
6
  * A model with its parent chain flattened: textures merged child-over-parent,
@@ -28,6 +28,7 @@ interface ResolvedModel {
28
28
  obj?: {
29
29
  model: string;
30
30
  flipV: boolean;
31
+ objects?: string[];
31
32
  };
32
33
  /** Fluid id from a fluid_container loader, for painting bucket contents. */
33
34
  fluid?: string;