@nodecraft/rendermite 1.3.1 → 1.4.0

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 (96) hide show
  1. package/dist/atlas/registry.d.ts +3 -3
  2. package/dist/atlas/sources.d.ts +1 -1
  3. package/dist/{atlas-pack-DRTrWcSU.d.ts → atlas-pack-D8745_wo.d.ts} +1 -1
  4. package/dist/biomes-5ZwYxMYe.js +384 -0
  5. package/dist/biomes-CJDJQqJb.d.ts +38 -0
  6. package/dist/{blend-8lnfxtLe.d.ts → blend-eT64Z6qm.d.ts} +1 -1
  7. package/dist/blocks/atlas-pack.d.ts +1 -1
  8. package/dist/blocks/biomes.d.ts +2 -0
  9. package/dist/blocks/biomes.js +2 -0
  10. package/dist/blocks/block-entities.d.ts +3 -3
  11. package/dist/blocks/cli.js +1 -1
  12. package/dist/blocks/export.d.ts +1 -1
  13. package/dist/blocks/export.js +1 -1
  14. package/dist/blocks/obj-mesh.d.ts +1 -1
  15. package/dist/blocks/pack-format.d.ts +2 -2
  16. package/dist/blocks/tints.d.ts +2 -2
  17. package/dist/blocks/tints.js +2 -2
  18. package/dist/{cli-BaoVzDGo.js → cli-DqJtT-Ms.js} +5 -4
  19. package/dist/cli.js +7 -7
  20. package/dist/{descriptor-BVIoEpPO.js → descriptor-D7VKgeGT.js} +2 -2
  21. package/dist/{discovery-BPSUtdm4.d.ts → discovery-C5ZR4aoG.d.ts} +1 -1
  22. package/dist/dynamic/generators.d.ts +1 -1
  23. package/dist/{encode-DNcXXvYe.d.ts → encode-Cf8hI5OY.d.ts} +1 -1
  24. package/dist/{export-BIpqNU3H.d.ts → export-Bllg8Fw7.d.ts} +4 -2
  25. package/dist/{export-BNvYiw6i.js → export-kMoMes_a.js} +39 -8
  26. package/dist/{face-BKwkeTps.d.ts → face-CuC_Wnx9.d.ts} +2 -2
  27. package/dist/{generators-DhRov4RB.d.ts → generators-BnIzAftW.d.ts} +1 -1
  28. package/dist/index.d.ts +20 -19
  29. package/dist/index.js +9 -8
  30. package/dist/items/blockstate.d.ts +1 -1
  31. package/dist/items/discovery.d.ts +1 -1
  32. package/dist/{jar-CFkA-VgT.d.ts → jar-B5iRZQeL.d.ts} +1 -1
  33. package/dist/{jar-5aLDI0nT.js → jar-W2cV2ZVO.js} +7 -7
  34. package/dist/{loader-C_1_amsq.d.ts → loader-DSir1-P0.d.ts} +1 -1
  35. package/dist/{loader-Myy22TDL.d.ts → loader-DUlx29PC.d.ts} +1 -1
  36. package/dist/{manager-CYbAkWuT.js → manager-BNibYkmI.js} +32 -5
  37. package/dist/{manager-Cv1NeFyF.d.ts → manager-exOIcdyx.d.ts} +23 -1
  38. package/dist/models/loader.d.ts +1 -1
  39. package/dist/{models-CQwcTZcg.js → models-CZjCOjs4.js} +1 -1
  40. package/dist/mods/models.d.ts +1 -1
  41. package/dist/mods/models.js +1 -1
  42. package/dist/mods/prepare.d.ts +1 -1
  43. package/dist/mods/prepare.js +1 -1
  44. package/dist/mods/synthesize.d.ts +2 -2
  45. package/dist/mods/tints.d.ts +2 -2
  46. package/dist/mods/tints.js +1 -1
  47. package/dist/{obj-mesh-C6Sp4Ysc.d.ts → obj-mesh-ydhVfLKs.d.ts} +2 -2
  48. package/dist/output/encode.d.ts +1 -1
  49. package/dist/{pack-format-CfCP4kzy.d.ts → pack-format-BVC_B-ZW.d.ts} +12 -3
  50. package/dist/pack.d.ts +5 -4
  51. package/dist/{pipeline-DeGRR0CP.js → pipeline-B8e6x8Hh.js} +1 -1
  52. package/dist/{pipeline-BDvXcw20.d.ts → pipeline-BwToOnuZ.d.ts} +3 -3
  53. package/dist/{prepare-Cs6QDqie.d.ts → prepare-6pH3CNpg.d.ts} +1 -1
  54. package/dist/{prepare-C95vjt_o.js → prepare-8LswFoS-.js} +2 -2
  55. package/dist/{prepare-B8oPdGYz.js → prepare-C9gjqQTt.js} +4 -4
  56. package/dist/{prepare-Dce7-HAe.d.ts → prepare-OS7wL3jv.d.ts} +1 -1
  57. package/dist/{rasterizer-BSQHEhJ-.d.ts → rasterizer-BFAHGtdT.d.ts} +1 -1
  58. package/dist/render/blend.d.ts +1 -1
  59. package/dist/render/compose.d.ts +2 -2
  60. package/dist/render/entity-fallback.d.ts +6 -6
  61. package/dist/render/face.d.ts +1 -1
  62. package/dist/render/fluid-bucket.d.ts +2 -2
  63. package/dist/render/geo.d.ts +4 -4
  64. package/dist/render/legacy-tints.d.ts +2 -2
  65. package/dist/render/obj.d.ts +5 -5
  66. package/dist/render/pipeline.d.ts +1 -1
  67. package/dist/render/pipeline.js +1 -1
  68. package/dist/render/rasterizer.d.ts +1 -1
  69. package/dist/render/renderer.d.ts +1 -1
  70. package/dist/render/tints.d.ts +1 -1
  71. package/dist/{renderer-U20hnhbi.d.ts → renderer-C_DFi8DF.d.ts} +5 -5
  72. package/dist/resources/descriptor.d.ts +1 -1
  73. package/dist/resources/descriptor.js +1 -1
  74. package/dist/resources/entity-textures.d.ts +2 -2
  75. package/dist/resources/jar.d.ts +1 -1
  76. package/dist/resources/jar.js +1 -1
  77. package/dist/resources/manager.d.ts +1 -1
  78. package/dist/resources/manager.js +1 -1
  79. package/dist/resources/synthetic.d.ts +1 -1
  80. package/dist/{run-Diql5y56.js → run-B_JAUbXe.js} +4 -4
  81. package/dist/{run-CvIqiZ6T.d.ts → run-Bblci_CC.d.ts} +2 -2
  82. package/dist/run.d.ts +1 -1
  83. package/dist/run.js +1 -1
  84. package/dist/{sources-B9X9w3qP.d.ts → sources-BFuYpSSD.d.ts} +1 -1
  85. package/dist/{synthetic-Qk-BSUXO.d.ts → synthetic-B3R7mW9k.d.ts} +1 -1
  86. package/dist/textures/loader.d.ts +1 -1
  87. package/dist/{tints-DqhgFi8a.d.ts → tints-6z6ysGUs.d.ts} +2 -2
  88. package/dist/{tints-nxtGrqv5.js → tints-C1tT6pKk.js} +1 -1
  89. package/dist/{tints-a9FWZLma.js → tints-Cl0r-Ol3.js} +44 -9
  90. package/dist/{tints-2k3ZhkY3.d.ts → tints-DoBv5S9v.d.ts} +11 -4
  91. package/dist/versions/legacy-reshape.d.ts +1 -1
  92. package/dist/versions/prepare.d.ts +1 -1
  93. package/dist/versions/prepare.js +1 -1
  94. package/dist/workers/render-worker.d.ts +2 -2
  95. package/dist/workers/render-worker.js +2 -2
  96. package/package.json +2 -2
@@ -1,12 +1,13 @@
1
1
  import { t as packAtlas } from "./atlas-pack-CoOih7By.js";
2
+ import { r as buildBiomeClimates } from "./biomes-5ZwYxMYe.js";
2
3
  import { n as ResourceLocator } from "./locator-COMEtEn9.js";
3
4
  import { n as blockEntityGeometry, r as synthesizeVariants, t as INVISIBLE_BLOCKS } from "./block-entities-xv3bQpEX.js";
4
5
  import { a as parseBlockState, n as collectModels } from "./blockstate-eval-BRQ3NWY2.js";
5
6
  import { a as salvageJson, i as resolveTexture, t as ModelLoader } from "./loader-C-NuJaEi.js";
6
7
  import { n as buildObjMesh } from "./obj-mesh-rnYbSbpv.js";
7
- import { t as buildBlockTints } from "./tints-a9FWZLma.js";
8
+ import { n as buildBlockTints, t as UNREGISTERED_TINTS } from "./tints-Cl0r-Ol3.js";
8
9
  import { t as loadAtlasResolver } from "./registry-DlduyjtM.js";
9
- import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-CYbAkWuT.js";
10
+ import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
10
11
  import { n as TextureLoader } from "./loader-C18GpurU.js";
11
12
  import path from "node:path";
12
13
  import { createHash } from "node:crypto";
@@ -558,10 +559,24 @@ async function exportBlockPack(options) {
558
559
  return model === void 0 || model.elements.length === 0 && !model.mesh?.length;
559
560
  });
560
561
  if (empty.length === 0) continue;
562
+ const definition = definitions.get(id);
563
+ if (definition?.kind === "multipart") {
564
+ const drawable = definition.cases.filter((part) => part.apply.some((variant) => !empty.includes(variant.model)));
565
+ if (drawable.length > 0) {
566
+ definition.cases = drawable;
567
+ blockModels.set(id, references.filter((reference) => !empty.includes(reference)));
568
+ failures.push({
569
+ id,
570
+ kind: "geometry",
571
+ reason: `the game draws ${empty.join(", ")} in code; the pack drops those parts and keeps the ${drawable.length} that do draw, since a multipart part laid over them would draw as well as them rather than instead`
572
+ });
573
+ continue;
574
+ }
575
+ }
561
576
  const substitute = await itemModelSubstitute(id, resources, models);
562
577
  if (substitute === null) continue;
563
578
  const stood = adoptSubstitute(substitute);
564
- for (const part of definitions.get(id)?.cases ?? []) for (const variant of part.apply) if (empty.includes(variant.model)) variant.model = stood;
579
+ for (const part of definition?.cases ?? []) for (const variant of part.apply) if (empty.includes(variant.model)) variant.model = stood;
565
580
  blockModels.set(id, [...references.filter((reference) => !empty.includes(reference)), stood]);
566
581
  const drawnInCode = empty.length === references.length ? "this block" : empty.join(", ");
567
582
  failures.push({
@@ -732,12 +747,21 @@ async function exportBlockPack(options) {
732
747
  for (const [block, references] of blockModels) {
733
748
  const used = /* @__PURE__ */ new Set();
734
749
  for (const reference of references) for (const index of modelTintIndices.get(reference) ?? []) used.add(index);
735
- for (const index of used) if (tints.pack.blocks[block]?.[String(index)] === void 0) failures.push({
736
- id: block,
737
- kind: "tint",
738
- reason: `tintindex ${index} is not in the tint table; exported untinted`
739
- });
750
+ for (const index of used) {
751
+ if (tints.pack.blocks[block]?.[String(index)] !== void 0) continue;
752
+ const expected = block.startsWith("minecraft:") ? UNREGISTERED_TINTS[block.slice(10)] : void 0;
753
+ failures.push(expected === void 0 ? {
754
+ id: block,
755
+ kind: "tint",
756
+ reason: `tintindex ${index} is not in the tint table; exported untinted`
757
+ } : {
758
+ id: block,
759
+ kind: "intentional",
760
+ reason: `tintindex ${index} is untinted in vanilla too: ${expected}`
761
+ });
762
+ }
740
763
  }
764
+ const biomes = await buildBiomeClimates(resources, namespaces);
741
765
  await mkdir(output, { recursive: true });
742
766
  const hashes = {};
743
767
  let writtenFiles = 0;
@@ -773,6 +797,12 @@ async function exportBlockPack(options) {
773
797
  await emit("models.json", JSON.stringify(sortedByKey(emittedModels)));
774
798
  await emit("blockstates.json", JSON.stringify(sortedByKey(blockStates)));
775
799
  await emit("tints.json", JSON.stringify(tints.pack));
800
+ if (Object.keys(biomes.pack).length > 0) await emit("biomes.json", JSON.stringify(sortedByKey(biomes.pack)));
801
+ for (const biome of biomes.unreadable) failures.push({
802
+ id: biome,
803
+ kind: "biome",
804
+ reason: "biome definition is unreadable or states no climate; exported without one"
805
+ });
776
806
  failures.sort((left, right) => left.id.localeCompare(right.id) || left.kind.localeCompare(right.kind));
777
807
  await emit("failures.json", JSON.stringify(failures, null, " "));
778
808
  const counts = {
@@ -780,6 +810,7 @@ async function exportBlockPack(options) {
780
810
  models: Object.keys(emittedModels).length,
781
811
  sprites: Object.keys(emittedSprites).length,
782
812
  pages: packed.pages.length,
813
+ biomes: Object.keys(biomes.pack).length,
783
814
  failures: failures.length
784
815
  };
785
816
  await emit("meta.json", JSON.stringify({
@@ -1,8 +1,8 @@
1
- import { n as FloatTexture } from "./blend-8lnfxtLe.js";
1
+ import { n as FloatTexture } from "./blend-eT64Z6qm.js";
2
2
  import { t as Mat4 } from "./vector-DRKRi4--.js";
3
3
  import { n as FaceGeometry } from "./geometry-Bkur58Vi.js";
4
4
  import { r as LightSource } from "./lighting-3FGRC3Af.js";
5
- import { n as FaceBuffer } from "./rasterizer-BSQHEhJ-.js";
5
+ import { n as FaceBuffer } from "./rasterizer-BFAHGtdT.js";
6
6
  //#region src/render/face.d.ts
7
7
  interface TintColor {
8
8
  r: number;
@@ -1,4 +1,4 @@
1
- import { n as MapResourceManager } from "./synthetic-Qk-BSUXO.js";
1
+ import { n as MapResourceManager } from "./synthetic-B3R7mW9k.js";
2
2
  //#region src/dynamic/generators.d.ts
3
3
  declare const TRIM_MATERIALS: readonly ["quartz", "iron", "gold", "diamond", "netherite", "redstone", "copper", "emerald", "lapis", "amethyst", "resin"];
4
4
  /** Materials with a darker variant used when the trim matches the armor metal. */
package/dist/index.d.ts CHANGED
@@ -1,25 +1,26 @@
1
1
  import { n as ResourceLocator, t as InvalidResourceLocatorError } from "./locator-jDbdUeTd.js";
2
- import { a as ResourceManager, i as ResourceKindName, n as LayeredResourceManager, r as ResourceKind, t as FolderResourceManager } from "./manager-Cv1NeFyF.js";
3
- import { a as TextureMeta, i as TextureLoader, o as TextureResolutionError, r as Texture, t as AnimatedTexture } from "./loader-Myy22TDL.js";
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
- import { a as PackedRect, i as PackedPage, n as PackOptions, o as packAtlas, r as PackedAtlas, t as PackEntry } from "./atlas-pack-DRTrWcSU.js";
6
- import { a as resolveTexture, n as ModelResolutionError, o as salvageJson, r as ResolvedModel, t as ModelLoader } from "./loader-C_1_amsq.js";
2
+ import { a as ResourceManager, i as ResourceKindName, n as LayeredResourceManager, r as ResourceKind, t as FolderResourceManager } from "./manager-exOIcdyx.js";
3
+ import { a as TextureMeta, i as TextureLoader, o as TextureResolutionError, r as Texture, t as AnimatedTexture } from "./loader-DUlx29PC.js";
4
+ import { d as parseAtlasSources, n as AtlasSource, r as AtlasSourceError, s as ResolvedSprite, t as AtlasResolver, u as createAtlasResolver } from "./sources-BFuYpSSD.js";
5
+ import { a as PackedRect, i as PackedPage, n as PackOptions, o as packAtlas, r as PackedAtlas, t as PackEntry } from "./atlas-pack-D8745_wo.js";
6
+ import { a as buildBiomeClimates, i as VANILLA_BIOME_CLIMATES, n as BiomeClimatePack, o as parseBiomeClimate, r as DEFAULT_WATER_COLOR, t as BiomeClimate } from "./biomes-CJDJQqJb.js";
7
+ import { a as resolveTexture, n as ModelResolutionError, o as salvageJson, r as ResolvedModel, t as ModelLoader } from "./loader-DSir1-P0.js";
7
8
  import { a as BlockStateMultipartCase, d as matchesCondition, f as parseBlockState, i as BlockStateError, l as collectModels, 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";
8
- import { i as exportBlockPack, n as BlockPackResult, r as ExportBlockPackOptions, t as BlockPackFailure } from "./export-BIpqNU3H.js";
9
- import { i as buildObjMesh, n as ObjMesh, r as ObjMeshError, t as MeshGroup } from "./obj-mesh-C6Sp4Ysc.js";
10
- import { i as buildBlockTints, n as BlockTintPack, t as BlockTint } from "./tints-2k3ZhkY3.js";
11
- import { s as builtinDynamicResources } from "./generators-DhRov4RB.js";
12
- import { d as toFloatTexture, n as FloatTexture, u as toByteTexture } from "./blend-8lnfxtLe.js";
9
+ import { i as exportBlockPack, n as BlockPackResult, r as ExportBlockPackOptions, t as BlockPackFailure } from "./export-Bllg8Fw7.js";
10
+ import { i as buildObjMesh, n as ObjMesh, r as ObjMeshError, t as MeshGroup } from "./obj-mesh-ydhVfLKs.js";
11
+ import { a as buildBlockTints, i as UNREGISTERED_TINTS, n as BlockTintPack, t as BlockTint } from "./tints-DoBv5S9v.js";
12
+ import { s as builtinDynamicResources } from "./generators-BnIzAftW.js";
13
+ import { d as toFloatTexture, n as FloatTexture, u as toByteTexture } from "./blend-eT64Z6qm.js";
13
14
  import { a as LightingProfileName, i as LightingProfile, r as LightSource, u as lightsForProfile } from "./lighting-3FGRC3Af.js";
14
- import { a as RenderedFrames, c as renderModel, i as RenderOptions, l as renderModelFrames, o as boxDownscale, r as ItemRenderError, s as pointResize } from "./renderer-U20hnhbi.js";
15
+ import { a as RenderedFrames, c as renderModel, i as RenderOptions, l as renderModelFrames, o as boxDownscale, r as ItemRenderError, s as pointResize } from "./renderer-C_DFi8DF.js";
15
16
  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";
16
- import { a as resolveItem, i as discoverItems, n as ItemDiscoveryOptions, r as ItemResolutionError, t as DiscoveredItem } from "./discovery-BPSUtdm4.js";
17
- import { a as resolveTint, i as parseTintValue, n as InvalidTinterDefinitionError, o as resolveTints, t as DYE_COLORS } from "./tints-DqhgFi8a.js";
18
- import { i as EncodedIcon, n as EncodeOptions, o as encodeAnimatedIcon, r as EncodedAnimatedIcon, s as encodeIcon, t as AnimatedEncodeOptions } from "./encode-DNcXXvYe.js";
17
+ import { a as resolveItem, i as discoverItems, n as ItemDiscoveryOptions, r as ItemResolutionError, t as DiscoveredItem } from "./discovery-C5ZR4aoG.js";
18
+ import { a as resolveTint, i as parseTintValue, n as InvalidTinterDefinitionError, o as resolveTints, t as DYE_COLORS } from "./tints-6z6ysGUs.js";
19
+ import { i as EncodedIcon, n as EncodeOptions, o as encodeAnimatedIcon, r as EncodedAnimatedIcon, s as encodeIcon, t as AnimatedEncodeOptions } from "./encode-Cf8hI5OY.js";
19
20
  import { t as minifyStylesheet } from "./minify-CIV6enbr.js";
20
- import { a as compareVersions, o as eraForVersion, s as prepareVersionResources } from "./prepare-Cs6QDqie.js";
21
- import { i as prepareModResources } from "./prepare-Dce7-HAe.js";
21
+ import { a as compareVersions, o as eraForVersion, s as prepareVersionResources } from "./prepare-6pH3CNpg.js";
22
+ import { i as prepareModResources } from "./prepare-OS7wL3jv.js";
22
23
  import { i as itemClass, n as StylesheetOptions, r as generateStylesheet, t as ItemStyle } from "./stylesheet-i-t_7sZ7.js";
23
- import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-CvIqiZ6T.js";
24
- import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-CFkA-VgT.js";
25
- export { type AnimatedEncodeOptions, AnimatedTexture, type AtlasResolver, type AtlasSource, AtlasSourceError, type BlockModelVariant, type BlockPackFailure, type BlockPackResult, type BlockProperties, type BlockStateDefinition, BlockStateError, type BlockStateMultipartCase, type BlockStateVariantCase, type BlockTint, type BlockTintPack, DYE_COLORS, type DiscoveredItem, type EncodeOptions, type EncodedAnimatedIcon, type EncodedIcon, type ExportBlockPackOptions, 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, type MeshGroup, ModelLoader, ModelResolutionError, type MultipartCondition, type ObjMesh, ObjMeshError, type PackEntry, type PackOptions, type PackedAtlas, type PackedPage, type PackedRect, 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, buildBlockTints, buildObjMesh, builtinDynamicResources, collectModels, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateBlockState, evaluateItemModel, exportBlockPack, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, matchesCondition, minifyStylesheet, packAtlas, parseAtlasSources, parseBlockState, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture, weightedVariantIndex };
24
+ import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-Bblci_CC.js";
25
+ import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-B5iRZQeL.js";
26
+ export { type AnimatedEncodeOptions, AnimatedTexture, type AtlasResolver, type AtlasSource, AtlasSourceError, type BiomeClimate, type BiomeClimatePack, type BlockModelVariant, type BlockPackFailure, type BlockPackResult, type BlockProperties, type BlockStateDefinition, BlockStateError, type BlockStateMultipartCase, type BlockStateVariantCase, type BlockTint, type BlockTintPack, DEFAULT_WATER_COLOR, DYE_COLORS, type DiscoveredItem, type EncodeOptions, type EncodedAnimatedIcon, type EncodedIcon, type ExportBlockPackOptions, 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, type MeshGroup, ModelLoader, ModelResolutionError, type MultipartCondition, type ObjMesh, ObjMeshError, type PackEntry, type PackOptions, type PackedAtlas, type PackedPage, type PackedRect, 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, UNREGISTERED_TINTS, UnsafeJarError, VANILLA_BIOME_CLIMATES, boxDownscale, buildBiomeClimates, buildBlockTints, buildObjMesh, builtinDynamicResources, collectModels, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateBlockState, evaluateItemModel, exportBlockPack, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, matchesCondition, minifyStylesheet, packAtlas, parseAtlasSources, parseBiomeClimate, parseBlockState, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture, weightedVariantIndex };
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { t as packAtlas } from "./atlas-pack-CoOih7By.js";
2
+ import { i as parseBiomeClimate, n as VANILLA_BIOME_CLIMATES, r as buildBiomeClimates, t as DEFAULT_WATER_COLOR } from "./biomes-5ZwYxMYe.js";
2
3
  import { n as ResourceLocator, t as InvalidResourceLocatorError } from "./locator-COMEtEn9.js";
3
4
  import { a as parseBlockState, i as matchesCondition, n as collectModels, o as weightedVariantIndex, r as evaluateBlockState, t as BlockStateError } from "./blockstate-eval-BRQ3NWY2.js";
4
5
  import { c as toByteTexture, l as toFloatTexture } from "./blend-KXMclcHk.js";
@@ -6,20 +7,20 @@ import { c as lightsForProfile, r as LightingProfile } from "./lighting--5myudVu
6
7
  import { a as salvageJson, i as resolveTexture, n as ModelResolutionError, t as ModelLoader } from "./loader-C-NuJaEi.js";
7
8
  import { a as ItemRenderError, c as renderModel, l as renderModelFrames, o as boxDownscale, s as pointResize } from "./obj-bvs3gwex.js";
8
9
  import { n as buildObjMesh, t as ObjMeshError } from "./obj-mesh-rnYbSbpv.js";
9
- import { t as buildBlockTints } from "./tints-a9FWZLma.js";
10
+ import { n as buildBlockTints, t as UNREGISTERED_TINTS } from "./tints-Cl0r-Ol3.js";
10
11
  import { o as createAtlasResolver, s as parseAtlasSources, t as AtlasSourceError } from "./sources-BlUriDCs.js";
11
- import { n as LayeredResourceManager, r as ResourceKind, t as FolderResourceManager } from "./manager-CYbAkWuT.js";
12
+ import { n as LayeredResourceManager, r as ResourceKind, t as FolderResourceManager } from "./manager-BNibYkmI.js";
12
13
  import { n as TextureLoader, r as TextureResolutionError, t as AnimatedTexture } from "./loader-C18GpurU.js";
13
- import { t as exportBlockPack } from "./export-BNvYiw6i.js";
14
+ import { t as exportBlockPack } from "./export-kMoMes_a.js";
14
15
  import { a as defaultProperties, i as UNKNOWN_MODEL, n as InvalidItemDefinitionError, o as evaluateItemModel } from "./definition-ColsvWrH.js";
15
- import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-5aLDI0nT.js";
16
- import { n as prepareModResources } from "./prepare-B8oPdGYz.js";
17
- import { a as prepareVersionResources, i as eraForVersion, r as compareVersions } from "./prepare-C95vjt_o.js";
16
+ import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-W2cV2ZVO.js";
17
+ import { n as prepareModResources } from "./prepare-C9gjqQTt.js";
18
+ import { a as prepareVersionResources, i as eraForVersion, r as compareVersions } from "./prepare-8LswFoS-.js";
18
19
  import { n as discoverItems, r as resolveItem, t as ItemResolutionError } from "./discovery-CsZu08re.js";
19
20
  import { n as encodeIcon, t as encodeAnimatedIcon } from "./encode-LR9wxigC.js";
20
21
  import { a as builtinDynamicResources } from "./generators-BCZVlWig.js";
21
22
  import { t as minifyStylesheet } from "./minify-bjMRmr5J.js";
22
23
  import { n as itemClass, t as generateStylesheet } from "./stylesheet-CovT3B2S.js";
23
24
  import { a as resolveTints, i as resolveTint, n as InvalidTinterDefinitionError, r as parseTintValue, t as DYE_COLORS } from "./tints-B3WQcPtx.js";
24
- import { t as run } from "./run-Diql5y56.js";
25
- export { AnimatedTexture, AtlasSourceError, BlockStateError, DYE_COLORS, FolderResourceManager, InvalidItemDefinitionError, InvalidResourceLocatorError, InvalidTinterDefinitionError, ItemRenderError, ItemResolutionError, JarResourceManager, LayeredResourceManager, LightingProfile, ModelLoader, ModelResolutionError, ObjMeshError, ResourceKind, ResourceLocator, TextureLoader, TextureResolutionError, UNKNOWN_MODEL, UnsafeJarError, boxDownscale, buildBlockTints, buildObjMesh, builtinDynamicResources, collectModels, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateBlockState, evaluateItemModel, exportBlockPack, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, matchesCondition, minifyStylesheet, packAtlas, parseAtlasSources, parseBlockState, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture, weightedVariantIndex };
25
+ import { t as run } from "./run-B_JAUbXe.js";
26
+ export { AnimatedTexture, AtlasSourceError, BlockStateError, DEFAULT_WATER_COLOR, DYE_COLORS, FolderResourceManager, InvalidItemDefinitionError, InvalidResourceLocatorError, InvalidTinterDefinitionError, ItemRenderError, ItemResolutionError, JarResourceManager, LayeredResourceManager, LightingProfile, ModelLoader, ModelResolutionError, ObjMeshError, ResourceKind, ResourceLocator, TextureLoader, TextureResolutionError, UNKNOWN_MODEL, UNREGISTERED_TINTS, UnsafeJarError, VANILLA_BIOME_CLIMATES, boxDownscale, buildBiomeClimates, buildBlockTints, buildObjMesh, builtinDynamicResources, collectModels, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateBlockState, evaluateItemModel, exportBlockPack, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, matchesCondition, minifyStylesheet, packAtlas, parseAtlasSources, parseBiomeClimate, parseBlockState, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture, weightedVariantIndex };
@@ -1,5 +1,5 @@
1
1
  import { n as ResourceLocator } from "../locator-jDbdUeTd.js";
2
- import { a as ResourceManager } from "../manager-Cv1NeFyF.js";
2
+ import { a as ResourceManager } from "../manager-exOIcdyx.js";
3
3
  import { t as Mat4 } from "../vector-DRKRi4--.js";
4
4
  //#region src/items/blockstate.d.ts
5
5
  interface ResolvedBlockState {
@@ -1,2 +1,2 @@
1
- import { a as resolveItem, i as discoverItems, n as ItemDiscoveryOptions, r as ItemResolutionError, t as DiscoveredItem } from "../discovery-BPSUtdm4.js";
1
+ import { a as resolveItem, i as discoverItems, n as ItemDiscoveryOptions, r as ItemResolutionError, t as DiscoveredItem } from "../discovery-C5ZR4aoG.js";
2
2
  export { DiscoveredItem, ItemDiscoveryOptions, ItemResolutionError, discoverItems, resolveItem };
@@ -1,5 +1,5 @@
1
1
  import { n as ResourceLocator } from "./locator-jDbdUeTd.js";
2
- import { a as ResourceManager, i as ResourceKindName, s as ResourceDescriptor } from "./manager-Cv1NeFyF.js";
2
+ import { a as ResourceManager, i as ResourceKindName, s as ResourceDescriptor } from "./manager-exOIcdyx.js";
3
3
  //#region src/resources/jar.d.ts
4
4
  /** Jar entries that could escape the archive get the whole jar rejected. */
5
5
  declare function isUnsafeEntryPath(entryPath: string): boolean;
@@ -1,5 +1,5 @@
1
1
  import { n as ResourceLocator } from "./locator-COMEtEn9.js";
2
- import { r as ResourceKind } from "./manager-CYbAkWuT.js";
2
+ import { r as ResourceKind } from "./manager-BNibYkmI.js";
3
3
  import { t as openZip } from "./zip-reader-BSbJKUT1.js";
4
4
  //#region src/resources/jar.ts
5
5
  /**
@@ -31,12 +31,12 @@ var JarResourceManager = class {
31
31
  reject(new UnsafeJarError(`Unsafe entry in ${this.jarPath}: ${entry.fileName}`));
32
32
  return;
33
33
  }
34
- const match = /^assets\/([^/]+)\//.exec(entry.fileName);
34
+ const match = /^(assets|data)\/([^/]+)\//.exec(entry.fileName);
35
35
  if (match) {
36
36
  entries.set(entry.fileName, entry);
37
37
  const lower = entry.fileName.toLowerCase();
38
38
  if (!entriesLower.has(lower)) entriesLower.set(lower, entry);
39
- namespaces.add(match[1].toLowerCase());
39
+ if (match[1] === "assets") namespaces.add(match[2].toLowerCase());
40
40
  }
41
41
  zip.readEntry();
42
42
  });
@@ -53,9 +53,9 @@ var JarResourceManager = class {
53
53
  return this.index;
54
54
  }
55
55
  entryPath(kind, locator) {
56
- const { directory, extension } = ResourceKind[kind];
56
+ const { root, directory, extension } = ResourceKind[kind];
57
57
  const prefix = directory === "" ? "" : `${directory}/`;
58
- return `assets/${locator.namespace}/${prefix}${locator.path}${extension}`;
58
+ return `${root}/${locator.namespace}/${prefix}${locator.path}${extension}`;
59
59
  }
60
60
  async getResource(kind, locator) {
61
61
  const index = await this.getIndex();
@@ -88,8 +88,8 @@ var JarResourceManager = class {
88
88
  }
89
89
  async listResources(kind, namespace) {
90
90
  const index = await this.getIndex();
91
- const { directory, extension } = ResourceKind[kind];
92
- const prefix = directory === "" ? `assets/${namespace}/` : `assets/${namespace}/${directory}/`;
91
+ const { root, directory, extension } = ResourceKind[kind];
92
+ const prefix = directory === "" ? `${root}/${namespace}/` : `${root}/${namespace}/${directory}/`;
93
93
  const locators = [];
94
94
  for (const entryPath of index.entries.keys()) {
95
95
  if (!entryPath.startsWith(prefix) || !entryPath.endsWith(extension) || entryPath.endsWith("/")) continue;
@@ -1,5 +1,5 @@
1
1
  import { n as ResourceLocator } from "./locator-jDbdUeTd.js";
2
- import { a as ResourceManager } from "./manager-Cv1NeFyF.js";
2
+ import { a as ResourceManager } from "./manager-exOIcdyx.js";
3
3
  import { c as ModelJson, n as DisplayTransformJson, o as ModelElementJson, t as DisplayPosition } from "./types-qlp3I8_-.js";
4
4
  //#region src/models/loader.d.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { n as ResourceLocator } from "./locator-jDbdUeTd.js";
2
- import { a as ResourceManager } from "./manager-Cv1NeFyF.js";
2
+ import { a as ResourceManager } from "./manager-exOIcdyx.js";
3
3
  //#region src/textures/loader.d.ts
4
4
  /** Structural interface for atlas resolvers (avoids a circular module edge). */
5
5
  interface AtlasResolverLike {
@@ -5,41 +5,59 @@ import { existsSync } from "node:fs";
5
5
  //#region src/resources/manager.ts
6
6
  /**
7
7
  * A category of resource inside a pack, mapping to a directory under
8
- * `assets/<namespace>/` plus a file extension.
8
+ * `<root>/<namespace>/` plus a file extension.
9
+ *
10
+ * `root` is `assets` for everything a renderer draws with. Biome definitions are
11
+ * the exception: they are *data*, not assets, so a jar keeps them under `data/`
12
+ * and a manager that assumed `assets/` could never see them.
9
13
  */
10
14
  const ResourceKind = {
11
15
  model: {
16
+ root: "assets",
12
17
  directory: "models",
13
18
  extension: ".json"
14
19
  },
15
20
  itemDefinition: {
21
+ root: "assets",
16
22
  directory: "items",
17
23
  extension: ".json"
18
24
  },
19
25
  blockstate: {
26
+ root: "assets",
20
27
  directory: "blockstates",
21
28
  extension: ".json"
22
29
  },
23
30
  texture: {
31
+ root: "assets",
24
32
  directory: "textures",
25
33
  extension: ".png"
26
34
  },
27
35
  textureMeta: {
36
+ root: "assets",
28
37
  directory: "textures",
29
38
  extension: ".png.mcmeta"
30
39
  },
31
40
  atlas: {
41
+ root: "assets",
32
42
  directory: "atlases",
33
43
  extension: ".json"
34
44
  },
35
45
  lang: {
46
+ root: "assets",
36
47
  directory: "lang",
37
48
  extension: ".json"
38
49
  },
39
50
  /** Arbitrary file under assets/<ns>/ (OBJ geometry, MTL material libraries). */
40
51
  raw: {
52
+ root: "assets",
41
53
  directory: "",
42
54
  extension: ""
55
+ },
56
+ /** A datapack biome: climate and the colours a renderer tints its blocks with. */
57
+ biome: {
58
+ root: "data",
59
+ directory: "worldgen/biome",
60
+ extension: ".json"
43
61
  }
44
62
  };
45
63
  /**
@@ -48,13 +66,22 @@ const ResourceKind = {
48
66
  * (what renderchest's --assets and the ui pipeline pass).
49
67
  */
50
68
  var FolderResourceManager = class {
69
+ /** What `root` was before the `assets/` layout was detected, so `data/` is reachable too. */
70
+ packRoot;
51
71
  root;
52
72
  constructor(root) {
73
+ this.packRoot = root;
53
74
  this.root = existsSync(path.join(root, "assets")) ? path.join(root, "assets") : root;
54
75
  }
76
+ /** Where a kind's namespaces live: the detected assets root, or a sibling of it. */
77
+ base(kind, namespace) {
78
+ const { root, directory } = ResourceKind[kind];
79
+ const rooted = root === "assets" ? this.root : path.join(this.packRoot, root);
80
+ return path.join(rooted, namespace, directory);
81
+ }
55
82
  resolve(kind, locator) {
56
- const { directory, extension } = ResourceKind[kind];
57
- return path.join(this.root, locator.namespace, directory, `${locator.path}${extension}`);
83
+ const { extension } = ResourceKind[kind];
84
+ return path.join(this.base(kind, locator.namespace), `${locator.path}${extension}`);
58
85
  }
59
86
  async getResource(kind, locator) {
60
87
  try {
@@ -76,8 +103,8 @@ var FolderResourceManager = class {
76
103
  return resource === null ? [] : [resource];
77
104
  }
78
105
  async listResources(kind, namespace) {
79
- const { directory, extension } = ResourceKind[kind];
80
- const base = path.join(this.root, namespace, directory);
106
+ const { extension } = ResourceKind[kind];
107
+ const base = this.base(kind, namespace);
81
108
  let entries;
82
109
  try {
83
110
  entries = await readdir(base, {
@@ -27,42 +27,60 @@ declare function restoreResources(descriptor: ResourceDescriptor): ResourceManag
27
27
  //#region src/resources/manager.d.ts
28
28
  /**
29
29
  * A category of resource inside a pack, mapping to a directory under
30
- * `assets/<namespace>/` plus a file extension.
30
+ * `<root>/<namespace>/` plus a file extension.
31
+ *
32
+ * `root` is `assets` for everything a renderer draws with. Biome definitions are
33
+ * the exception: they are *data*, not assets, so a jar keeps them under `data/`
34
+ * and a manager that assumed `assets/` could never see them.
31
35
  */
32
36
  declare const ResourceKind: {
33
37
  readonly model: {
38
+ readonly root: "assets";
34
39
  readonly directory: "models";
35
40
  readonly extension: ".json";
36
41
  };
37
42
  readonly itemDefinition: {
43
+ readonly root: "assets";
38
44
  readonly directory: "items";
39
45
  readonly extension: ".json";
40
46
  };
41
47
  readonly blockstate: {
48
+ readonly root: "assets";
42
49
  readonly directory: "blockstates";
43
50
  readonly extension: ".json";
44
51
  };
45
52
  readonly texture: {
53
+ readonly root: "assets";
46
54
  readonly directory: "textures";
47
55
  readonly extension: ".png";
48
56
  };
49
57
  readonly textureMeta: {
58
+ readonly root: "assets";
50
59
  readonly directory: "textures";
51
60
  readonly extension: ".png.mcmeta";
52
61
  };
53
62
  readonly atlas: {
63
+ readonly root: "assets";
54
64
  readonly directory: "atlases";
55
65
  readonly extension: ".json";
56
66
  };
57
67
  readonly lang: {
68
+ readonly root: "assets";
58
69
  readonly directory: "lang";
59
70
  readonly extension: ".json";
60
71
  };
61
72
  /** Arbitrary file under assets/<ns>/ (OBJ geometry, MTL material libraries). */
62
73
  readonly raw: {
74
+ readonly root: "assets";
63
75
  readonly directory: "";
64
76
  readonly extension: "";
65
77
  };
78
+ /** A datapack biome: climate and the colours a renderer tints its blocks with. */
79
+ readonly biome: {
80
+ readonly root: "data";
81
+ readonly directory: "worldgen/biome";
82
+ readonly extension: ".json";
83
+ };
66
84
  };
67
85
  type ResourceKindName = keyof typeof ResourceKind;
68
86
  interface ResourceManager {
@@ -87,8 +105,12 @@ interface ResourceManager {
87
105
  * (what renderchest's --assets and the ui pipeline pass).
88
106
  */
89
107
  declare class FolderResourceManager implements ResourceManager {
108
+ /** What `root` was before the `assets/` layout was detected, so `data/` is reachable too. */
109
+ private readonly packRoot;
90
110
  readonly root: string;
91
111
  constructor(root: string);
112
+ /** Where a kind's namespaces live: the detected assets root, or a sibling of it. */
113
+ private base;
92
114
  private resolve;
93
115
  getResource(kind: ResourceKindName, locator: ResourceLocator): Promise<Buffer | null>;
94
116
  hasResource(kind: ResourceKindName, locator: ResourceLocator): Promise<boolean>;
@@ -1,2 +1,2 @@
1
- import { a as resolveTexture, i as flattenLoaderModel, n as ModelResolutionError, o as salvageJson, r as ResolvedModel, t as ModelLoader } from "../loader-C_1_amsq.js";
1
+ import { a as resolveTexture, i as flattenLoaderModel, n as ModelResolutionError, o as salvageJson, r as ResolvedModel, t as ModelLoader } from "../loader-DSir1-P0.js";
2
2
  export { ModelLoader, ModelResolutionError, ResolvedModel, flattenLoaderModel, resolveTexture, salvageJson };
@@ -1,5 +1,5 @@
1
1
  import { r as modModelPackPath } from "./builtin-WkWjATeh.js";
2
- import { t as FolderResourceManager } from "./manager-CYbAkWuT.js";
2
+ import { t as FolderResourceManager } from "./manager-BNibYkmI.js";
3
3
  //#region src/mods/models.ts
4
4
  /**
5
5
  * Geometry for mod items the game draws in code. A `builtin/entity` item model
@@ -1,4 +1,4 @@
1
- import { a as ResourceManager } from "../manager-Cv1NeFyF.js";
1
+ import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
2
  //#region src/mods/models.d.ts
3
3
  declare function curatedModelOverrides(): ResourceManager;
4
4
  //#endregion
@@ -1,2 +1,2 @@
1
- import { t as curatedModelOverrides } from "../models-CQwcTZcg.js";
1
+ import { t as curatedModelOverrides } from "../models-CZjCOjs4.js";
2
2
  export { curatedModelOverrides };
@@ -1,2 +1,2 @@
1
- import { i as prepareModResources, n as ModPreparation, r as PrepareModsOptions, t as LOADER_NAMESPACES } from "../prepare-Dce7-HAe.js";
1
+ import { i as prepareModResources, n as ModPreparation, r as PrepareModsOptions, t as LOADER_NAMESPACES } from "../prepare-OS7wL3jv.js";
2
2
  export { LOADER_NAMESPACES, ModPreparation, PrepareModsOptions, prepareModResources };
@@ -1,2 +1,2 @@
1
- import { n as prepareModResources, t as LOADER_NAMESPACES } from "../prepare-B8oPdGYz.js";
1
+ import { n as prepareModResources, t as LOADER_NAMESPACES } from "../prepare-C9gjqQTt.js";
2
2
  export { LOADER_NAMESPACES, prepareModResources };
@@ -1,5 +1,5 @@
1
- import { a as ResourceManager } from "../manager-Cv1NeFyF.js";
2
- import { n as MapResourceManager } from "../synthetic-Qk-BSUXO.js";
1
+ import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
+ import { n as MapResourceManager } from "../synthetic-B3R7mW9k.js";
3
3
  //#region src/mods/synthesize.d.ts
4
4
  interface SynthesisResult {
5
5
  models: MapResourceManager;
@@ -1,5 +1,5 @@
1
- import { a as ResourceManager } from "../manager-Cv1NeFyF.js";
2
- import { n as MapResourceManager } from "../synthetic-Qk-BSUXO.js";
1
+ import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
+ import { n as MapResourceManager } from "../synthetic-B3R7mW9k.js";
3
3
  //#region src/mods/tints.d.ts
4
4
  interface HarvestTintsOptions {
5
5
  /** Assets from 1.21.4+ releases of the same mods, read only for their tints. */
@@ -1,2 +1,2 @@
1
- import { n as harvestTintOverrides, t as curatedTintOverrides } from "../tints-nxtGrqv5.js";
1
+ import { n as harvestTintOverrides, t as curatedTintOverrides } from "../tints-C1tT6pKk.js";
2
2
  export { curatedTintOverrides, harvestTintOverrides };
@@ -1,5 +1,5 @@
1
- import { a as ResourceManager } from "./manager-Cv1NeFyF.js";
2
- import { r as ResolvedModel } from "./loader-C_1_amsq.js";
1
+ import { a as ResourceManager } from "./manager-exOIcdyx.js";
2
+ import { r as ResolvedModel } from "./loader-DSir1-P0.js";
3
3
  //#region src/blocks/obj-mesh.d.ts
4
4
  interface MeshGroup {
5
5
  /** Sprite every triangle in this group samples. */
@@ -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-DNcXXvYe.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-Cf8hI5OY.js";
2
2
  export { AnimatedEncodeOptions, EncodeOptions, EncodedAnimatedIcon, EncodedIcon, RasterAssetFormat, encodeAnimatedIcon, encodeIcon, encodeRasterAsset };
@@ -1,7 +1,8 @@
1
+ import { n as BiomeClimatePack } from "./biomes-CJDJQqJb.js";
1
2
  import { a as FaceDirectionName, l as Vec3, o as ModelElementJson, u as Vec4 } from "./types-qlp3I8_-.js";
2
3
  import { a as BlockStateMultipartCase, o as BlockStateVariantCase } from "./blockstate-eval-BzznRcVY.js";
3
- import { t as MeshGroup } from "./obj-mesh-C6Sp4Ysc.js";
4
- import { n as BlockTintPack } from "./tints-2k3ZhkY3.js";
4
+ import { t as MeshGroup } from "./obj-mesh-ydhVfLKs.js";
5
+ import { n as BlockTintPack } from "./tints-DoBv5S9v.js";
5
6
  //#region src/blocks/pack-format.d.ts
6
7
  /** How a sprite's alpha classifies it, inferred because assets rarely say. */
7
8
  type BlockPackRenderLayer = 'solid' | 'cutout' | 'translucent';
@@ -112,6 +113,12 @@ type BlockPackBlockState = {
112
113
  };
113
114
  /** `tints.json`. */
114
115
  type BlockPackTintsFile = BlockTintPack;
116
+ /**
117
+ * `biomes.json`, present only when the pack has biomes to describe: vanilla's
118
+ * whole table, or the ones a mod's datapack declares. Absent is not empty — a
119
+ * consumer with no file falls back to tinting at `tints.json`'s flat climate.
120
+ */
121
+ type BlockPackBiomesFile = BiomeClimatePack;
115
122
  /** `meta.json`, written last because it hashes every other file. */
116
123
  interface BlockPackMetaFile {
117
124
  generator: string;
@@ -122,10 +129,12 @@ interface BlockPackMetaFile {
122
129
  models: number;
123
130
  sprites: number;
124
131
  pages: number;
132
+ /** Biomes in `biomes.json`; `0` means the pack has none and the file is absent. */
133
+ biomes: number;
125
134
  failures: number;
126
135
  };
127
136
  /** sha256 per file, enough to verify a cached copy without refetching it. */
128
137
  hashes: Record<string, string>;
129
138
  }
130
139
  //#endregion
131
- export { BlockPackElement as a, BlockPackModel as c, BlockPackSprite as d, BlockPackSpriteFrame as f, BlockPackBlockStatesFile as i, BlockPackModelsFile as l, BlockPackVariant as m, BlockPackAtlasPage as n, BlockPackFace as o, BlockPackTintsFile as p, BlockPackBlockState as r, BlockPackMetaFile as s, BlockPackAtlasFile as t, BlockPackRenderLayer as u };
140
+ export { BlockPackBlockStatesFile as a, BlockPackMetaFile as c, BlockPackRenderLayer as d, BlockPackSprite as f, BlockPackVariant as h, BlockPackBlockState as i, BlockPackModel as l, BlockPackTintsFile as m, BlockPackAtlasPage as n, BlockPackElement as o, BlockPackSpriteFrame as p, BlockPackBiomesFile as r, BlockPackFace as s, BlockPackAtlasFile as t, BlockPackModelsFile as u };
package/dist/pack.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import { n as BiomeClimatePack, t as BiomeClimate } from "./biomes-CJDJQqJb.js";
1
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";
2
- import { n as ObjMesh, t as MeshGroup } from "./obj-mesh-C6Sp4Ysc.js";
3
- import { n as BlockTintPack, t as BlockTint } from "./tints-2k3ZhkY3.js";
4
- import { a as BlockPackElement, c as BlockPackModel, d as BlockPackSprite, f as BlockPackSpriteFrame, i as BlockPackBlockStatesFile, l as BlockPackModelsFile, m as BlockPackVariant, n as BlockPackAtlasPage, o as BlockPackFace, p as BlockPackTintsFile, r as BlockPackBlockState, s as BlockPackMetaFile, t as BlockPackAtlasFile, u as BlockPackRenderLayer } from "./pack-format-CfCP4kzy.js";
5
- export { type BlockModelVariant, type BlockPackAtlasFile, type BlockPackAtlasPage, 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 };
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 { a as BlockPackBlockStatesFile, c as BlockPackMetaFile, d as BlockPackRenderLayer, f as BlockPackSprite, h as BlockPackVariant, i as BlockPackBlockState, l as BlockPackModel, m as BlockPackTintsFile, n as BlockPackAtlasPage, o as BlockPackElement, p as BlockPackSpriteFrame, r as BlockPackBiomesFile, s as BlockPackFace, t as BlockPackAtlasFile, u as BlockPackModelsFile } from "./pack-format-BVC_B-ZW.js";
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 };
@@ -3,7 +3,7 @@ import { l as toFloatTexture, t as blendPixel } from "./blend-KXMclcHk.js";
3
3
  import { t as ModelLoader } from "./loader-C-NuJaEi.js";
4
4
  import { c as renderModel, l as renderModelFrames, o as boxDownscale, s as pointResize } from "./obj-bvs3gwex.js";
5
5
  import { t as loadAtlasResolver } from "./registry-DlduyjtM.js";
6
- import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-CYbAkWuT.js";
6
+ import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
7
7
  import { n as TextureLoader } from "./loader-C18GpurU.js";
8
8
  import { a as defaultProperties } from "./definition-ColsvWrH.js";
9
9
  import { r as resolveItem } from "./discovery-CsZu08re.js";
@@ -1,7 +1,7 @@
1
- import { a as ResourceManager } from "./manager-Cv1NeFyF.js";
2
- import { n as FloatTexture } from "./blend-8lnfxtLe.js";
1
+ import { a as ResourceManager } from "./manager-exOIcdyx.js";
2
+ import { n as FloatTexture } from "./blend-eT64Z6qm.js";
3
3
  import { a as LightingProfileName } from "./lighting-3FGRC3Af.js";
4
- import { n as AnimationLimits } from "./renderer-U20hnhbi.js";
4
+ import { n as AnimationLimits } from "./renderer-C_DFi8DF.js";
5
5
  //#region src/render/pipeline.d.ts
6
6
  interface PipelineSettings {
7
7
  builtin?: string;