@nodecraft/rendermite 1.7.1 → 1.7.3

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 (87) hide show
  1. package/dist/atlas/registry.d.ts +2 -2
  2. package/dist/atlas/sources.d.ts +1 -1
  3. package/dist/{atlas-pack-D8745_wo.d.ts → atlas-pack-C56gzqAg.d.ts} +1 -1
  4. package/dist/{blend-eT64Z6qm.d.ts → blend-C5UYzink.d.ts} +1 -1
  5. package/dist/{block-entities-CPQeb5dV.js → block-entities-C807EY2I.js} +25 -8
  6. package/dist/blocks/atlas-pack.d.ts +1 -1
  7. package/dist/blocks/block-entities.d.ts +1 -1
  8. package/dist/blocks/block-entities.js +1 -1
  9. package/dist/blocks/cli.js +1 -1
  10. package/dist/blocks/ender-storage.d.ts +1 -1
  11. package/dist/blocks/ender-storage.js +1 -1
  12. package/dist/blocks/entities.d.ts +2 -2
  13. package/dist/blocks/entities.js +1 -1
  14. package/dist/blocks/entity-models.d.ts +1 -1
  15. package/dist/blocks/export.js +1 -1
  16. package/dist/blocks/geo-blocks.d.ts +1 -1
  17. package/dist/blocks/geo-blocks.js +1 -1
  18. package/dist/blocks/item-sprites.d.ts +2 -2
  19. package/dist/blocks/item-sprites.js +1 -1
  20. package/dist/blocks/obj-mesh.js +1 -1
  21. package/dist/blocks/pack-format.d.ts +1 -1
  22. package/dist/blocks/sprite-sheet.d.ts +3 -3
  23. package/dist/blocks/tints.d.ts +1 -1
  24. package/dist/{cache-Cr2ON3RQ.js → cache-D-_gSxhp.js} +6 -0
  25. package/dist/{cli-CpTNd7pv.js → cli-BuKutEzb.js} +1 -1
  26. package/dist/cli.js +2 -2
  27. package/dist/{encode-Cf8hI5OY.d.ts → encode-Br_vPrd8.d.ts} +1 -1
  28. package/dist/{ender-storage-C8i6Rxlq.js → ender-storage-Dgomp6r2.js} +1 -1
  29. package/dist/entities/geo-model.d.ts +1 -1
  30. package/dist/{entities-DubtdM11.js → entities-rQ4TZjEo.js} +1 -1
  31. package/dist/{entity-fallback-BRMFKPlM.js → entity-fallback-BucEf6WB.js} +4 -4
  32. package/dist/{entity-textures-4XXT8jVI.js → entity-textures-DG6NUNyp.js} +67 -2
  33. package/dist/{export-RUcb-TdF.js → export-CVXvPLv8.js} +12 -12
  34. package/dist/{face-1cIObOfs.d.ts → face-DqEd9G_U.d.ts} +2 -2
  35. package/dist/{geo-BjvgFB90.d.ts → geo-C9QYeLVN.d.ts} +3 -3
  36. package/dist/{geo-blocks-BcSEBhko.js → geo-blocks-W79q5A0f.js} +3 -3
  37. package/dist/index.d.ts +9 -9
  38. package/dist/index.js +6 -6
  39. package/dist/{item-sprites-CnCH8YFv.js → item-sprites-CwiEBEAJ.js} +1 -1
  40. package/dist/{loader-DUlx29PC.d.ts → loader-59_eMa8e.d.ts} +10 -0
  41. package/dist/{loader-C18GpurU.js → loader-CsgtBuBo.js} +22 -1
  42. package/dist/{loader-C-NuJaEi.js → loader-qOH0Jynq.js} +1 -1
  43. package/dist/models/loader.js +1 -1
  44. package/dist/{obj-LWuJIAIM.js → obj-DPEK_xee.js} +1 -1
  45. package/dist/{obj-mesh-CZsmCk-p.js → obj-mesh-BFhtTBXX.js} +1 -1
  46. package/dist/output/encode.d.ts +1 -1
  47. package/dist/overlay-BdHHd5WR.js +49 -0
  48. package/dist/{pack-format-D5IgQjcD.d.ts → pack-format-Baoc_aSZ.d.ts} +1 -1
  49. package/dist/pack.d.ts +2 -2
  50. package/dist/{pipeline-CWRQQ9DM.js → pipeline-Cci24Kb4.js} +4 -4
  51. package/dist/{pipeline-C7pN0yko.d.ts → pipeline-DFuQa8ZT.d.ts} +2 -2
  52. package/dist/{rasterizer-BFAHGtdT.d.ts → rasterizer-C2wgJZ6J.d.ts} +1 -1
  53. package/dist/render/blend.d.ts +1 -1
  54. package/dist/render/compose.d.ts +2 -2
  55. package/dist/render/entity-fallback.d.ts +4 -4
  56. package/dist/render/entity-fallback.js +1 -1
  57. package/dist/render/face.d.ts +1 -1
  58. package/dist/render/fluid-bucket.d.ts +1 -1
  59. package/dist/render/geo.d.ts +1 -1
  60. package/dist/render/legacy-tints.d.ts +2 -2
  61. package/dist/render/obj.d.ts +3 -3
  62. package/dist/render/obj.js +1 -1
  63. package/dist/render/pipeline.d.ts +1 -1
  64. package/dist/render/pipeline.js +1 -1
  65. package/dist/render/rasterizer.d.ts +1 -1
  66. package/dist/render/renderer.d.ts +1 -1
  67. package/dist/render/renderer.js +1 -1
  68. package/dist/render/tints.d.ts +1 -1
  69. package/dist/{renderer-CjreM6tk.d.ts → renderer-DbUmTFDb.d.ts} +3 -3
  70. package/dist/resources/cache.d.ts +1 -0
  71. package/dist/resources/cache.js +1 -1
  72. package/dist/resources/entity-textures.d.ts +39 -2
  73. package/dist/resources/entity-textures.js +2 -2
  74. package/dist/{run-CQXJCo8u.js → run--oW_h01E.js} +1 -1
  75. package/dist/{run-BgXZp8VQ.d.ts → run-CLjF0N2d.d.ts} +1 -1
  76. package/dist/run.d.ts +1 -1
  77. package/dist/run.js +1 -1
  78. package/dist/{sources-BFuYpSSD.d.ts → sources-DYYiyvRW.d.ts} +1 -1
  79. package/dist/textures/loader.d.ts +1 -1
  80. package/dist/textures/loader.js +1 -1
  81. package/dist/textures/overlay.d.ts +12 -0
  82. package/dist/textures/overlay.js +2 -0
  83. package/dist/{tints-DoBv5S9v.d.ts → tints-CQX8a1F0.d.ts} +1 -1
  84. package/dist/{tints-iPf8hSKX.d.ts → tints-uLl1CIkC.d.ts} +2 -2
  85. package/dist/workers/render-worker.d.ts +1 -1
  86. package/dist/workers/render-worker.js +1 -1
  87. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { i as resolveTexture } from "./loader-C-NuJaEi.js";
1
+ import { i as resolveTexture } from "./loader-qOH0Jynq.js";
2
2
  import { i as resolveItem, r as langRegistry } from "./discovery-CD0QqxSF.js";
3
3
  import { a as resolveTints } from "./tints-B3WQcPtx.js";
4
4
  //#region src/blocks/item-sprites.ts
@@ -67,6 +67,7 @@ declare class AnimatedTexture {
67
67
  declare class TextureLoader {
68
68
  private readonly resources;
69
69
  private readonly cache;
70
+ private readonly generated;
70
71
  private atlas;
71
72
  constructor(resources: ResourceManager, maxCacheBytes?: number);
72
73
  private decode;
@@ -78,6 +79,15 @@ declare class TextureLoader {
78
79
  * direct file lookup already.
79
80
  */
80
81
  setAtlasResolver(atlas: AtlasResolverLike): void;
82
+ /**
83
+ * Hold a texture this run composed itself, resolvable by locator like any file.
84
+ * A sheet a mod only ever draws by layering two files (a chest's wood plus its
85
+ * tier trim) exists nowhere on disk, and every consumer downstream — the
86
+ * rasterizer, the atlas packer — addresses textures by locator alone.
87
+ */
88
+ register(locator: ResourceLocator | string, texture: Texture): void;
89
+ /** Whether a locator resolves to pixels, including ones this run composed. */
90
+ has(locator: ResourceLocator): Promise<boolean>;
81
91
  /**
82
92
  * Load a texture with its animation metadata for multi-frame rendering.
83
93
  * Returns null when the texture does not exist.
@@ -1,5 +1,5 @@
1
1
  import { n as ResourceLocator } from "./locator-COMEtEn9.js";
2
- import { t as LruCache } from "./cache-Cr2ON3RQ.js";
2
+ import { t as LruCache } from "./cache-D-_gSxhp.js";
3
3
  import sharp from "sharp";
4
4
  //#region src/textures/loader.ts
5
5
  var TextureResolutionError = class extends Error {};
@@ -137,6 +137,7 @@ var AnimatedTexture = class {
137
137
  var TextureLoader = class {
138
138
  resources;
139
139
  cache;
140
+ generated = /* @__PURE__ */ new Map();
140
141
  atlas = null;
141
142
  constructor(resources, maxCacheBytes = MAX_TEXTURE_CACHE_BYTES) {
142
143
  this.resources = resources;
@@ -146,6 +147,8 @@ var TextureLoader = class {
146
147
  });
147
148
  }
148
149
  async decode(locator) {
150
+ const generated = this.generated.get(locator.toString());
151
+ if (generated) return generated;
149
152
  let raw = await this.resources.getResource("texture", locator);
150
153
  if (raw === null && this.atlas) {
151
154
  const sprite = await this.atlas.resolve(locator);
@@ -190,10 +193,28 @@ var TextureLoader = class {
190
193
  this.cache.clear();
191
194
  }
192
195
  /**
196
+ * Hold a texture this run composed itself, resolvable by locator like any file.
197
+ * A sheet a mod only ever draws by layering two files (a chest's wood plus its
198
+ * tier trim) exists nowhere on disk, and every consumer downstream — the
199
+ * rasterizer, the atlas packer — addresses textures by locator alone.
200
+ */
201
+ register(locator, texture) {
202
+ const key = locator.toString();
203
+ this.generated.set(key, texture);
204
+ this.cache.delete(key);
205
+ }
206
+ /** Whether a locator resolves to pixels, including ones this run composed. */
207
+ async has(locator) {
208
+ if (this.generated.has(locator.toString())) return true;
209
+ return await this.load(locator).catch(() => null) !== null;
210
+ }
211
+ /**
193
212
  * Load a texture with its animation metadata for multi-frame rendering.
194
213
  * Returns null when the texture does not exist.
195
214
  */
196
215
  async loadAnimated(locator) {
216
+ const generated = this.generated.get(locator.toString());
217
+ if (generated) return new AnimatedTexture(generated, null);
197
218
  const raw = await this.resources.getResource("texture", locator);
198
219
  let full = null;
199
220
  if (raw !== null) {
@@ -1,5 +1,5 @@
1
1
  import { n as ResourceLocator } from "./locator-COMEtEn9.js";
2
- import { t as LruCache } from "./cache-Cr2ON3RQ.js";
2
+ import { t as LruCache } from "./cache-D-_gSxhp.js";
3
3
  //#region src/models/loader.ts
4
4
  var ModelResolutionError = class extends Error {};
5
5
  /** Override redirects to follow before giving up; cycles are the reason. */
@@ -1,2 +1,2 @@
1
- import { a as salvageJson, i as resolveTexture, n as ModelResolutionError, r as flattenLoaderModel, t as ModelLoader } from "../loader-C-NuJaEi.js";
1
+ import { a as salvageJson, i as resolveTexture, n as ModelResolutionError, r as flattenLoaderModel, t as ModelLoader } from "../loader-qOH0Jynq.js";
2
2
  export { ModelLoader, ModelResolutionError, flattenLoaderModel, resolveTexture, salvageJson };
@@ -7,7 +7,7 @@ import { t as combineFaceBuffers } from "./compose-BGsNFR12.js";
7
7
  import { n as faceMaxZ, r as renderFace, t as createShadeCache } from "./face-DbyyYmzp.js";
8
8
  import { t as paintBucketFluid } from "./fluid-bucket-B-I4ZYHl.js";
9
9
  import { r as buildElementFaces } from "./geometry-bUDBhncX.js";
10
- import { i as resolveTexture } from "./loader-C-NuJaEi.js";
10
+ import { i as resolveTexture } from "./loader-qOH0Jynq.js";
11
11
  //#region src/render/renderer.ts
12
12
  /**
13
13
  * Item rendering entry: flat generated items (2D layer compositing) and 3D
@@ -1,5 +1,5 @@
1
1
  import { n as ResourceLocator } from "./locator-COMEtEn9.js";
2
- import { n as parseMtl, r as parseObj, t as materialTexture } from "./obj-LWuJIAIM.js";
2
+ import { n as parseMtl, r as parseObj, t as materialTexture } from "./obj-DPEK_xee.js";
3
3
  //#region src/blocks/obj-mesh.ts
4
4
  /**
5
5
  * OBJ geometry as pack data.
@@ -1,2 +1,2 @@
1
- import { a as RasterAssetFormat, c as encodeRasterAsset, i as EncodedIcon, n as EncodeOptions, o as encodeAnimatedIcon, r as EncodedAnimatedIcon, s as encodeIcon, t as AnimatedEncodeOptions } from "../encode-Cf8hI5OY.js";
1
+ import { a as RasterAssetFormat, c as encodeRasterAsset, i as EncodedIcon, n as EncodeOptions, o as encodeAnimatedIcon, r as EncodedAnimatedIcon, s as encodeIcon, t as AnimatedEncodeOptions } from "../encode-Br_vPrd8.js";
2
2
  export { AnimatedEncodeOptions, EncodeOptions, EncodedAnimatedIcon, EncodedIcon, RasterAssetFormat, encodeAnimatedIcon, encodeIcon, encodeRasterAsset };
@@ -0,0 +1,49 @@
1
+ import { n as ResourceLocator } from "./locator-COMEtEn9.js";
2
+ //#region src/textures/overlay.ts
3
+ /**
4
+ * Laying an accent sheet over the sheet it decorates.
5
+ *
6
+ * Some mods draw one thing from two textures: Sophisticated Storage's gold
7
+ * chest is `entity/chest/oak` with `entity/chest/gold_tier` composited on top,
8
+ * and its block entity renderer does that at draw time. A pipeline that reads
9
+ * assets only ever picks one of the two, and picking the trim leaves a chest
10
+ * that is 95% transparent — the tier sheet covers 5% of its pixels.
11
+ *
12
+ * The composed sheet is registered with the texture loader rather than written
13
+ * anywhere: both consumers address textures by locator, and the accent pairing
14
+ * is a property of this run's asset tree, not of any jar.
15
+ */
16
+ /** Where a composed sheet is addressed from; never a path a jar can ship. */
17
+ const OVERLAY_NAMESPACE = "rendermite";
18
+ /** Source-over composite, in place on a copy of the base. */
19
+ function sourceOver(base, accent) {
20
+ const data = new Uint8ClampedArray(base.data);
21
+ for (let offset = 0; offset < data.length; offset += 4) {
22
+ const alpha = accent.data[offset + 3] / 255;
23
+ if (alpha === 0) continue;
24
+ for (let channel = 0; channel < 3; channel++) data[offset + channel] = accent.data[offset + channel] * alpha + data[offset + channel] * (1 - alpha);
25
+ data[offset + 3] = (alpha + data[offset + 3] / 255 * (1 - alpha)) * 255;
26
+ }
27
+ return {
28
+ width: base.width,
29
+ height: base.height,
30
+ data
31
+ };
32
+ }
33
+ /**
34
+ * Compose `accent` over `base` and return the locator the result is registered
35
+ * under, or null when either sheet is missing or they are different sizes —
36
+ * two layouts cannot be layered pixel for pixel, and stretching one would
37
+ * smear a trim across faces it does not belong to.
38
+ */
39
+ async function overlaySheets(textures, base, accent) {
40
+ const composed = new ResourceLocator(OVERLAY_NAMESPACE, `overlay/${base.namespace}/${accent.path.replaceAll("/", "_")}_over_${base.path.replaceAll("/", "_")}`);
41
+ if (await textures.has(composed)) return composed;
42
+ const [baseTexture, accentTexture] = await Promise.all([textures.load(base).catch(() => null), textures.load(accent).catch(() => null)]);
43
+ if (!baseTexture || !accentTexture) return null;
44
+ if (baseTexture.width !== accentTexture.width || baseTexture.height !== accentTexture.height) return null;
45
+ textures.register(composed, sourceOver(baseTexture, accentTexture));
46
+ return composed;
47
+ }
48
+ //#endregion
49
+ export { overlaySheets as t };
@@ -2,7 +2,7 @@ import { n as BiomeClimatePack } from "./biomes-CJDJQqJb.js";
2
2
  import { a as FaceDirectionName, l as Vec3, o as ModelElementJson, u as Vec4 } from "./types-qlp3I8_-.js";
3
3
  import { a as BlockStateMultipartCase, o as BlockStateVariantCase } from "./blockstate-eval-BzznRcVY.js";
4
4
  import { t as MeshGroup } from "./obj-mesh-ydhVfLKs.js";
5
- import { n as BlockTintPack } from "./tints-DoBv5S9v.js";
5
+ import { n as BlockTintPack } from "./tints-CQX8a1F0.js";
6
6
  //#region src/blocks/pack-format.d.ts
7
7
  /** How a sprite's alpha classifies it, inferred because assets rarely say. */
8
8
  type BlockPackRenderLayer = 'solid' | 'cutout' | 'translucent';
package/dist/pack.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as BiomeClimatePack, t as BiomeClimate } from "./biomes-CJDJQqJb.js";
2
2
  import { a as BlockStateMultipartCase, d as matchesCondition, n as BlockProperties, o as BlockStateVariantCase, p as weightedVariantIndex, r as BlockStateDefinition, s as MultipartCondition, t as BlockModelVariant, u as evaluateBlockState } from "./blockstate-eval-BzznRcVY.js";
3
3
  import { n as ObjMesh, t as MeshGroup } from "./obj-mesh-ydhVfLKs.js";
4
- import { n as BlockTintPack, t as BlockTint } from "./tints-DoBv5S9v.js";
5
- import { _ as BlockPackTintsFile, a as BlockPackBlockStatesFile, d as BlockPackMetaFile, f as BlockPackModel, g as BlockPackSpriteFrame, h as BlockPackSprite, i as BlockPackBlockState, l as BlockPackFace, m as BlockPackRenderLayer, n as BlockPackAtlasPage, o as BlockPackElement, p as BlockPackModelsFile, r as BlockPackBiomesFile, t as BlockPackAtlasFile, v as BlockPackVariant } from "./pack-format-D5IgQjcD.js";
4
+ import { n as BlockTintPack, t as BlockTint } from "./tints-CQX8a1F0.js";
5
+ import { _ as BlockPackTintsFile, a as BlockPackBlockStatesFile, d as BlockPackMetaFile, f as BlockPackModel, g as BlockPackSpriteFrame, h as BlockPackSprite, i as BlockPackBlockState, l as BlockPackFace, m as BlockPackRenderLayer, n as BlockPackAtlasPage, o as BlockPackElement, p as BlockPackModelsFile, r as BlockPackBiomesFile, t as BlockPackAtlasFile, v as BlockPackVariant } from "./pack-format-Baoc_aSZ.js";
6
6
  export { type BiomeClimate, type BiomeClimatePack, type BlockModelVariant, type BlockPackAtlasFile, type BlockPackAtlasPage, type BlockPackBiomesFile, type BlockPackBlockState, type BlockPackBlockStatesFile, type BlockPackElement, type BlockPackFace, type BlockPackMetaFile, type BlockPackModel, type BlockPackModelsFile, type BlockPackRenderLayer, type BlockPackSprite, type BlockPackSpriteFrame, type BlockPackTintsFile, type BlockPackVariant, type BlockProperties, type BlockStateDefinition, type BlockStateMultipartCase, type BlockStateVariantCase, type BlockTint, type BlockTintPack, type MeshGroup, type MultipartCondition, type ObjMesh, evaluateBlockState, matchesCondition, weightedVariantIndex };
@@ -1,17 +1,17 @@
1
1
  import { n as ResourceLocator } from "./locator-COMEtEn9.js";
2
2
  import { l as toFloatTexture, t as blendPixel } from "./blend-KXMclcHk.js";
3
- import { t as ModelLoader } from "./loader-C-NuJaEi.js";
4
- import { c as renderModel, l as renderModelFrames, o as boxDownscale, s as pointResize } from "./obj-LWuJIAIM.js";
3
+ import { t as ModelLoader } from "./loader-qOH0Jynq.js";
4
+ import { c as renderModel, l as renderModelFrames, o as boxDownscale, s as pointResize } from "./obj-DPEK_xee.js";
5
5
  import { a as renderGeo, t as findGeoForItem } from "./geo-BoDxwvz5.js";
6
6
  import { a as defaultProperties } from "./definition-ColsvWrH.js";
7
7
  import { i as resolveItem } from "./discovery-CD0QqxSF.js";
8
8
  import { a as resolveTints } from "./tints-B3WQcPtx.js";
9
9
  import { t as loadAtlasResolver } from "./registry-DlduyjtM.js";
10
10
  import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
11
- import { n as TextureLoader } from "./loader-C18GpurU.js";
11
+ import { n as TextureLoader } from "./loader-CsgtBuBo.js";
12
12
  import { t as encodeAnimatedIcon } from "./encode-LR9wxigC.js";
13
13
  import { a as builtinDynamicResources } from "./generators-D6giKoab.js";
14
- import { a as spawnEggTints, i as renderEntityFallback, n as dyedVariantTint, r as renderDyedVariantFallback, t as dyeVariantName } from "./entity-fallback-BRMFKPlM.js";
14
+ import { a as spawnEggTints, i as renderEntityFallback, n as dyedVariantTint, r as renderDyedVariantFallback, t as dyeVariantName } from "./entity-fallback-BucEf6WB.js";
15
15
  import { t as legacyTintsForChain } from "./legacy-tints-l-541wgI.js";
16
16
  import { n as defaultBlockStateModel, t as blockStateTransform } from "./blockstate-DVb8Mhxc.js";
17
17
  import path from "node:path";
@@ -1,7 +1,7 @@
1
1
  import { a as ResourceManager } from "./manager-exOIcdyx.js";
2
- import { n as FloatTexture } from "./blend-eT64Z6qm.js";
2
+ import { n as FloatTexture } from "./blend-C5UYzink.js";
3
3
  import { a as LightingProfileName } from "./lighting-3FGRC3Af.js";
4
- import { n as AnimationLimits } from "./renderer-CjreM6tk.js";
4
+ import { n as AnimationLimits } from "./renderer-DbUmTFDb.js";
5
5
  //#region src/render/pipeline.d.ts
6
6
  interface PipelineSettings {
7
7
  builtin?: string;
@@ -1,4 +1,4 @@
1
- import { n as FloatTexture, t as FaceShading } from "./blend-eT64Z6qm.js";
1
+ import { n as FloatTexture, t as FaceShading } from "./blend-C5UYzink.js";
2
2
  //#region src/render/rasterizer.d.ts
3
3
  /** The rectangle of a buffer written since it was last cleared. */
4
4
  interface DirtyRect {
@@ -1,2 +1,2 @@
1
- import { a as darkenTexture, c as shadeTexel, d as toFloatTexture, f as uvWindow, i as cloneFloatTexture, l as tintTexture, n as FloatTexture, o as q16, r as blendPixel, s as scaleTextureAlpha, t as FaceShading, u as toByteTexture } from "../blend-eT64Z6qm.js";
1
+ import { a as darkenTexture, c as shadeTexel, d as toFloatTexture, f as uvWindow, i as cloneFloatTexture, l as tintTexture, n as FloatTexture, o as q16, r as blendPixel, s as scaleTextureAlpha, t as FaceShading, u as toByteTexture } from "../blend-C5UYzink.js";
2
2
  export { FaceShading, FloatTexture, blendPixel, cloneFloatTexture, darkenTexture, q16, scaleTextureAlpha, shadeTexel, tintTexture, toByteTexture, toFloatTexture, uvWindow };
@@ -1,5 +1,5 @@
1
- import { n as FloatTexture } from "../blend-eT64Z6qm.js";
2
- import { n as FaceBuffer } from "../rasterizer-BFAHGtdT.js";
1
+ import { n as FloatTexture } from "../blend-C5UYzink.js";
2
+ import { n as FaceBuffer } from "../rasterizer-C2wgJZ6J.js";
3
3
  //#region src/render/compose.d.ts
4
4
  declare function combineFaceBuffers(width: number, height: number, faces: FaceBuffer[]): FloatTexture;
5
5
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
- import { i as TextureLoader } from "../loader-DUlx29PC.js";
2
+ import { i as TextureLoader } from "../loader-59_eMa8e.js";
3
3
  import { t as ModelLoader } from "../loader-DSir1-P0.js";
4
- import { n as FloatTexture } from "../blend-eT64Z6qm.js";
5
- import { r as TintColor } from "../face-1cIObOfs.js";
6
- import { i as RenderOptions } from "../renderer-CjreM6tk.js";
4
+ import { n as FloatTexture } from "../blend-C5UYzink.js";
5
+ import { r as TintColor } from "../face-DqEd9G_U.js";
6
+ import { i as RenderOptions } from "../renderer-DbUmTFDb.js";
7
7
  //#region src/render/entity-fallback.d.ts
8
8
  /** The dye name a `<dye>_<thing>` mod item is prefixed with, or null. */
9
9
  declare function dyeVariantName(id: string): string | null;
@@ -1,2 +1,2 @@
1
- import { a as spawnEggTints, i as renderEntityFallback, n as dyedVariantTint, r as renderDyedVariantFallback, t as dyeVariantName } from "../entity-fallback-BRMFKPlM.js";
1
+ import { a as spawnEggTints, i as renderEntityFallback, n as dyedVariantTint, r as renderDyedVariantFallback, t as dyeVariantName } from "../entity-fallback-BucEf6WB.js";
2
2
  export { dyeVariantName, dyedVariantTint, renderDyedVariantFallback, renderEntityFallback, spawnEggTints };
@@ -1,2 +1,2 @@
1
- import { a as faceMaxZ, i as createShadeCache, n as RenderableFace, o as renderFace, r as TintColor, t as FaceShadeCache } from "../face-1cIObOfs.js";
1
+ import { a as faceMaxZ, i as createShadeCache, n as RenderableFace, o as renderFace, r as TintColor, t as FaceShadeCache } from "../face-DqEd9G_U.js";
2
2
  export { FaceShadeCache, RenderableFace, TintColor, createShadeCache, faceMaxZ, renderFace };
@@ -1,5 +1,5 @@
1
1
  import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
- import { i as TextureLoader, r as Texture } from "../loader-DUlx29PC.js";
2
+ import { i as TextureLoader, r as Texture } from "../loader-59_eMa8e.js";
3
3
  //#region src/render/fluid-bucket.d.ts
4
4
  /**
5
5
  * Paint the fluid into a bucket sprite IN PLACE (pass a copy, never a cached
@@ -1,2 +1,2 @@
1
- import { a as parseGeo, i as nameTokens, n as findGeoForItem, o as renderGeo, r as geoToFaces, t as ParsedGeo } from "../geo-BjvgFB90.js";
1
+ import { a as parseGeo, i as nameTokens, n as findGeoForItem, o as renderGeo, r as geoToFaces, t as ParsedGeo } from "../geo-C9QYeLVN.js";
2
2
  export { ParsedGeo, findGeoForItem, geoToFaces, nameTokens, parseGeo, renderGeo };
@@ -1,5 +1,5 @@
1
- import { i as TextureLoader } from "../loader-DUlx29PC.js";
2
- import { r as TintColor } from "../face-1cIObOfs.js";
1
+ import { i as TextureLoader } from "../loader-59_eMa8e.js";
2
+ import { r as TintColor } from "../face-DqEd9G_U.js";
3
3
  //#region src/render/legacy-tints.d.ts
4
4
  /**
5
5
  * Tints for a model rendered without an item definition (pre-1.21.4 eras and
@@ -1,10 +1,10 @@
1
1
  import { n as ResourceLocator } from "../locator-jDbdUeTd.js";
2
2
  import { a as ResourceManager } from "../manager-exOIcdyx.js";
3
- import { i as TextureLoader } from "../loader-DUlx29PC.js";
3
+ import { i as TextureLoader } from "../loader-59_eMa8e.js";
4
4
  import { r as ResolvedModel } from "../loader-DSir1-P0.js";
5
- import { n as FloatTexture } from "../blend-eT64Z6qm.js";
5
+ import { n as FloatTexture } from "../blend-C5UYzink.js";
6
6
  import { n as Vec3 } from "../vector-DRKRi4--.js";
7
- import { i as RenderOptions } from "../renderer-CjreM6tk.js";
7
+ import { i as RenderOptions } from "../renderer-DbUmTFDb.js";
8
8
  //#region src/render/obj.d.ts
9
9
  interface ObjTriangle {
10
10
  positions: [Vec3, Vec3, Vec3];
@@ -1,2 +1,2 @@
1
- import { i as renderObjModel, n as parseMtl, r as parseObj, t as materialTexture } from "../obj-LWuJIAIM.js";
1
+ import { i as renderObjModel, n as parseMtl, r as parseObj, t as materialTexture } from "../obj-DPEK_xee.js";
2
2
  export { materialTexture, parseMtl, parseObj, renderObjModel };
@@ -1,2 +1,2 @@
1
- import { i as RenderedFrames, n as ItemRenderOutcome, r as PipelineSettings, t as ItemPipeline } from "../pipeline-C7pN0yko.js";
1
+ import { i as RenderedFrames, n as ItemRenderOutcome, r as PipelineSettings, t as ItemPipeline } from "../pipeline-DFuQa8ZT.js";
2
2
  export { ItemPipeline, ItemRenderOutcome, PipelineSettings, RenderedFrames };
@@ -1,2 +1,2 @@
1
- import { t as ItemPipeline } from "../pipeline-CWRQQ9DM.js";
1
+ import { t as ItemPipeline } from "../pipeline-Cci24Kb4.js";
2
2
  export { ItemPipeline };
@@ -1,2 +1,2 @@
1
- import { a as clearFaceBuffer, c as drawTexturedTriangle, i as RowCursor, l as phpRound, n as FaceBuffer, o as compactFaceBuffer, r as RasterPoint, s as createFaceBuffer, t as DirtyRect } from "../rasterizer-BFAHGtdT.js";
1
+ import { a as clearFaceBuffer, c as drawTexturedTriangle, i as RowCursor, l as phpRound, n as FaceBuffer, o as compactFaceBuffer, r as RasterPoint, s as createFaceBuffer, t as DirtyRect } from "../rasterizer-C2wgJZ6J.js";
2
2
  export { DirtyRect, FaceBuffer, RasterPoint, RowCursor, clearFaceBuffer, compactFaceBuffer, createFaceBuffer, drawTexturedTriangle, phpRound };
@@ -1,2 +1,2 @@
1
- import { a as RenderedFrames, c as renderModel, i as RenderOptions, l as renderModelFrames, n as AnimationLimits, o as boxDownscale, r as ItemRenderError, s as pointResize, t as AnimationDiagnostics } from "../renderer-CjreM6tk.js";
1
+ import { a as RenderedFrames, c as renderModel, i as RenderOptions, l as renderModelFrames, n as AnimationLimits, o as boxDownscale, r as ItemRenderError, s as pointResize, t as AnimationDiagnostics } from "../renderer-DbUmTFDb.js";
2
2
  export { AnimationDiagnostics, AnimationLimits, ItemRenderError, RenderOptions, RenderedFrames, boxDownscale, pointResize, renderModel, renderModelFrames };
@@ -1,2 +1,2 @@
1
- import { a as ItemRenderError, c as renderModel, l as renderModelFrames, o as boxDownscale, s as pointResize } from "../obj-LWuJIAIM.js";
1
+ import { a as ItemRenderError, c as renderModel, l as renderModelFrames, o as boxDownscale, s as pointResize } from "../obj-DPEK_xee.js";
2
2
  export { ItemRenderError, boxDownscale, pointResize, renderModel, renderModelFrames };
@@ -1,2 +1,2 @@
1
- import { a as resolveTint, i as parseTintValue, n as InvalidTinterDefinitionError, o as resolveTints, r as TintContext, t as DYE_COLORS } from "../tints-iPf8hSKX.js";
1
+ import { a as resolveTint, i as parseTintValue, n as InvalidTinterDefinitionError, o as resolveTints, r as TintContext, t as DYE_COLORS } from "../tints-uLl1CIkC.js";
2
2
  export { DYE_COLORS, InvalidTinterDefinitionError, TintContext, parseTintValue, resolveTint, resolveTints };
@@ -1,10 +1,10 @@
1
1
  import { a as ResourceManager } from "./manager-exOIcdyx.js";
2
- import { i as TextureLoader } from "./loader-DUlx29PC.js";
2
+ import { i as TextureLoader } from "./loader-59_eMa8e.js";
3
3
  import { r as ResolvedModel } from "./loader-DSir1-P0.js";
4
- import { n as FloatTexture } from "./blend-eT64Z6qm.js";
4
+ import { n as FloatTexture } from "./blend-C5UYzink.js";
5
5
  import { t as Mat4 } from "./vector-DRKRi4--.js";
6
6
  import { a as LightingProfileName } from "./lighting-3FGRC3Af.js";
7
- import { r as TintColor } from "./face-1cIObOfs.js";
7
+ import { r as TintColor } from "./face-DqEd9G_U.js";
8
8
  //#region src/render/renderer.d.ts
9
9
  interface AnimationLimits {
10
10
  /** Emitted frames per icon (default 128). */
@@ -24,6 +24,7 @@ declare class LruCache<K, V> {
24
24
  * weight of a decoded texture only exists after it resolves.
25
25
  */
26
26
  settle(key: K, value: V): void;
27
+ delete(key: K): void;
27
28
  clear(): void;
28
29
  }
29
30
  //#endregion
@@ -1,2 +1,2 @@
1
- import { t as LruCache } from "../cache-Cr2ON3RQ.js";
1
+ import { t as LruCache } from "../cache-D-_gSxhp.js";
2
2
  export { LruCache };
@@ -1,6 +1,6 @@
1
1
  import { n as ResourceLocator } from "../locator-jDbdUeTd.js";
2
2
  import { a as ResourceManager } from "../manager-exOIcdyx.js";
3
- import { i as TextureLoader } from "../loader-DUlx29PC.js";
3
+ import { i as TextureLoader } from "../loader-59_eMa8e.js";
4
4
  //#region src/resources/entity-textures.d.ts
5
5
  declare function tokens(name: string): string[];
6
6
  /** Vanilla DyeColor diffuse colors, keyed by the dye name mods prefix with. */
@@ -33,6 +33,43 @@ declare function findMobTexture(resources: ResourceManager, namespace: string, m
33
33
  declare function findChestTexture(resources: ResourceManager, namespace: string, itemName: string): Promise<ResourceLocator | null>;
34
34
  /** Find a full modded bed entity sheet, preferring every distinguishing item-name token. */
35
35
  declare function findBedTexture(resources: ResourceManager, namespace: string, itemName: string): Promise<ResourceLocator | null>;
36
+ /** A sheet to draw with, plus the two layers it was composed from where it was. */
37
+ interface LayeredSheet {
38
+ /** What to bind, with any accent already laid over the sheet it decorates. */
39
+ sheet: ResourceLocator;
40
+ /** The covering sheet underneath, only when the match was an accent. */
41
+ base: ResourceLocator | null;
42
+ /** The accent laid over it, only when the match was one. */
43
+ accent: ResourceLocator | null;
44
+ }
45
+ /**
46
+ * The sheet to draw with, given the best match for a name. One that covers its
47
+ * own sheet is the thing itself; one that does not is a trim the game
48
+ * composites over a base at draw time — Sophisticated Storage's gold chest is
49
+ * `entity/chest/oak` with `entity/chest/gold_tier` over it — and binding the
50
+ * trim alone leaves floating corners where the block should be.
51
+ *
52
+ * Null when the match is a trim with nothing to lay it over, which leaves the
53
+ * caller's own fallback (vanilla's sheet, or the match unchanged) to decide.
54
+ */
55
+ declare function layerAccentSheet(resources: ResourceManager, textures: TextureLoader, found: ResourceLocator): Promise<LayeredSheet | null>;
56
+ /**
57
+ * The sheet to draw a mod's chest with. A trim with no covering sibling is
58
+ * still returned: it is what the search found, and a faint chest beats
59
+ * reporting the block as having no geometry at all.
60
+ */
61
+ declare function resolveChestSheets(resources: ResourceManager, textures: TextureLoader, namespace: string, itemName: string): Promise<LayeredSheet | null>;
62
+ /**
63
+ * The sheet an accent decorates: a covering sibling in the accent's own
64
+ * directory, which is where a mod keeps the two halves of one chest
65
+ * (`entity/chest/gold_tier` beside `entity/chest/oak`).
66
+ *
67
+ * Oak wins a tie because the wood is block entity data a static export cannot
68
+ * read — twelve wood sheets are pixel-identical in coverage, so without a
69
+ * stated preference the choice fell to listing order and a plain chest came
70
+ * out acacia.
71
+ */
72
+ declare function findAccentBaseSheet(resources: ResourceManager, textures: TextureLoader, accent: ResourceLocator): Promise<ResourceLocator | null>;
36
73
  /**
37
74
  * Whether a sheet is a whole skin rather than an overlay. Vanilla's shulker
38
75
  * covers 44% of its sheet; a tier trim covers under 5%.
@@ -60,4 +97,4 @@ declare function findFluidStill(resources: ResourceManager, namespace: string, b
60
97
  */
61
98
  declare function findFluidSibling(resources: ResourceManager, still: ResourceLocator, suffixes: string[]): Promise<ResourceLocator | null>;
62
99
  //#endregion
63
- export { DYE_COLORS, HEAD_LAYOUTS, OVERLAY_DIRECTORIES, coversSheet, findBedTexture, findChestTexture, findEntityTexture, findFluidSibling, findFluidStill, findMobTexture, isOverlayPath, tokens };
100
+ export { DYE_COLORS, HEAD_LAYOUTS, LayeredSheet, OVERLAY_DIRECTORIES, coversSheet, findAccentBaseSheet, findBedTexture, findChestTexture, findEntityTexture, findFluidSibling, findFluidStill, findMobTexture, isOverlayPath, layerAccentSheet, resolveChestSheets, tokens };
@@ -1,2 +1,2 @@
1
- import { a as findBedTexture, c as findFluidSibling, d as isOverlayPath, f as tokens, i as coversSheet, l as findFluidStill, n as HEAD_LAYOUTS, o as findChestTexture, r as OVERLAY_DIRECTORIES, s as findEntityTexture, t as DYE_COLORS, u as findMobTexture } from "../entity-textures-4XXT8jVI.js";
2
- export { DYE_COLORS, HEAD_LAYOUTS, OVERLAY_DIRECTORIES, coversSheet, findBedTexture, findChestTexture, findEntityTexture, findFluidSibling, findFluidStill, findMobTexture, isOverlayPath, tokens };
1
+ import { a as findAccentBaseSheet, c as findEntityTexture, d as findMobTexture, f as isOverlayPath, h as tokens, i as coversSheet, l as findFluidSibling, m as resolveChestSheets, n as HEAD_LAYOUTS, o as findBedTexture, p as layerAccentSheet, r as OVERLAY_DIRECTORIES, s as findChestTexture, t as DYE_COLORS, u as findFluidStill } from "../entity-textures-DG6NUNyp.js";
2
+ export { DYE_COLORS, HEAD_LAYOUTS, OVERLAY_DIRECTORIES, coversSheet, findAccentBaseSheet, findBedTexture, findChestTexture, findEntityTexture, findFluidSibling, findFluidStill, findMobTexture, isOverlayPath, layerAccentSheet, resolveChestSheets, tokens };
@@ -6,7 +6,7 @@ import { r as encodeRasterAsset } from "./encode-LR9wxigC.js";
6
6
  import { t as classifyItemStyle } from "./item-styles-BAeneY1R.js";
7
7
  import { t as minifyStylesheet } from "./minify-bjMRmr5J.js";
8
8
  import { t as generateStylesheet } from "./stylesheet-CovT3B2S.js";
9
- import { t as ItemPipeline } from "./pipeline-CWRQQ9DM.js";
9
+ import { t as ItemPipeline } from "./pipeline-Cci24Kb4.js";
10
10
  import { t as describeResources } from "./descriptor-JyXhfd-c.js";
11
11
  import { t as WorkerRenderPool } from "./pool-CKGp1qup.js";
12
12
  import path from "node:path";
@@ -1,6 +1,6 @@
1
1
  import { a as ResourceManager } from "./manager-exOIcdyx.js";
2
2
  import { a as LightingProfileName } from "./lighting-3FGRC3Af.js";
3
- import { n as AnimationLimits } from "./renderer-CjreM6tk.js";
3
+ import { n as AnimationLimits } from "./renderer-DbUmTFDb.js";
4
4
  //#region src/run.d.ts
5
5
  interface RunOptions {
6
6
  resources: ResourceManager;
package/dist/run.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { l as evaluateItemModel } from "./definition-ricL7Jqf.js";
2
- import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-BgXZp8VQ.js";
2
+ import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-CLjF0N2d.js";
3
3
  export { ItemFailure, RunOptions, RunResult, evaluateItemModel, run };
package/dist/run.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { o as evaluateItemModel } from "./definition-ColsvWrH.js";
2
- import { t as run } from "./run-CQXJCo8u.js";
2
+ import { t as run } from "./run--oW_h01E.js";
3
3
  export { evaluateItemModel, run };
@@ -1,5 +1,5 @@
1
1
  import { n as ResourceLocator } from "./locator-jDbdUeTd.js";
2
- import { r as Texture } from "./loader-DUlx29PC.js";
2
+ import { r as Texture } from "./loader-59_eMa8e.js";
3
3
  //#region src/atlas/sources.d.ts
4
4
  declare class AtlasSourceError extends Error {}
5
5
  interface AtlasSource {
@@ -1,2 +1,2 @@
1
- import { a as TextureMeta, i as TextureLoader, n as AtlasResolverLike, o as TextureResolutionError, r as Texture, t as AnimatedTexture } from "../loader-DUlx29PC.js";
1
+ import { a as TextureMeta, i as TextureLoader, n as AtlasResolverLike, o as TextureResolutionError, r as Texture, t as AnimatedTexture } from "../loader-59_eMa8e.js";
2
2
  export { AnimatedTexture, AtlasResolverLike, Texture, TextureLoader, TextureMeta, TextureResolutionError };
@@ -1,2 +1,2 @@
1
- import { n as TextureLoader, r as TextureResolutionError, t as AnimatedTexture } from "../loader-C18GpurU.js";
1
+ import { n as TextureLoader, r as TextureResolutionError, t as AnimatedTexture } from "../loader-CsgtBuBo.js";
2
2
  export { AnimatedTexture, TextureLoader, TextureResolutionError };
@@ -0,0 +1,12 @@
1
+ import { n as ResourceLocator } from "../locator-jDbdUeTd.js";
2
+ import { i as TextureLoader } from "../loader-59_eMa8e.js";
3
+ //#region src/textures/overlay.d.ts
4
+ /**
5
+ * Compose `accent` over `base` and return the locator the result is registered
6
+ * under, or null when either sheet is missing or they are different sizes —
7
+ * two layouts cannot be layered pixel for pixel, and stretching one would
8
+ * smear a trim across faces it does not belong to.
9
+ */
10
+ declare function overlaySheets(textures: TextureLoader, base: ResourceLocator, accent: ResourceLocator): Promise<ResourceLocator | null>;
11
+ //#endregion
12
+ export { overlaySheets };
@@ -0,0 +1,2 @@
1
+ import { t as overlaySheets } from "../overlay-BdHHd5WR.js";
2
+ export { overlaySheets };
@@ -1,5 +1,5 @@
1
1
  import { a as ResourceManager } from "./manager-exOIcdyx.js";
2
- import { i as TextureLoader } from "./loader-DUlx29PC.js";
2
+ import { i as TextureLoader } from "./loader-59_eMa8e.js";
3
3
  //#region src/blocks/tints.d.ts
4
4
  type BlockTint =
5
5
  /** Sample the named colormap at the block's biome climate. */
@@ -1,5 +1,5 @@
1
- import { i as TextureLoader } from "./loader-DUlx29PC.js";
2
- import { r as TintColor } from "./face-1cIObOfs.js";
1
+ import { i as TextureLoader } from "./loader-59_eMa8e.js";
2
+ import { r as TintColor } from "./face-DqEd9G_U.js";
3
3
  import { o as TintDefinition } from "./definition-ricL7Jqf.js";
4
4
  //#region src/render/tints.d.ts
5
5
  declare class InvalidTinterDefinitionError extends Error {}
@@ -1,5 +1,5 @@
1
1
  import { s as ResourceDescriptor } from "../manager-exOIcdyx.js";
2
- import { n as ItemRenderOutcome, r as PipelineSettings } from "../pipeline-C7pN0yko.js";
2
+ import { n as ItemRenderOutcome, r as PipelineSettings } from "../pipeline-DFuQa8ZT.js";
3
3
  //#region src/workers/render-worker.d.ts
4
4
  interface RenderWorkerData {
5
5
  resources: ResourceDescriptor;
@@ -1,4 +1,4 @@
1
- import { t as ItemPipeline } from "../pipeline-CWRQQ9DM.js";
1
+ import { t as ItemPipeline } from "../pipeline-Cci24Kb4.js";
2
2
  import { n as restoreResources } from "../descriptor-JyXhfd-c.js";
3
3
  import sharp from "sharp";
4
4
  import { parentPort, workerData } from "node:worker_threads";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodecraft/rendermite",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "description": "Minecraft item icon renderer: renders inventory-identical item icons from vanilla and modded assets across game versions, outputting optimized PNG/WebP/AVIF plus CSS and a JSON item library.",
5
5
  "type": "module",
6
6
  "license": "MIT",