@nodecraft/rendermite 1.8.0 → 1.10.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 (168) hide show
  1. package/README.md +9 -1
  2. package/dist/atlas/registry.d.ts +3 -3
  3. package/dist/atlas/sources.d.ts +1 -1
  4. package/dist/{atlas-pack-C56gzqAg.d.ts → atlas-pack-BUadroKy.d.ts} +1 -1
  5. package/dist/biomes-BGOF6gRM.js +1100 -0
  6. package/dist/biomes-CnnhDCnk.d.ts +59 -0
  7. package/dist/{blend-C5UYzink.d.ts → blend-mJAeQB3C.d.ts} +1 -1
  8. package/dist/block-behaviour-BBslelpW.d.ts +673 -0
  9. package/dist/block-behaviour-DVjqeSkv.js +180 -0
  10. package/dist/block-overrides-XtxICunI.js +77 -0
  11. package/dist/blocks/atlas-pack.d.ts +1 -1
  12. package/dist/blocks/biomes.d.ts +2 -2
  13. package/dist/blocks/biomes.js +2 -2
  14. package/dist/blocks/block-behaviour.d.ts +2 -0
  15. package/dist/blocks/block-behaviour.js +2 -0
  16. package/dist/blocks/block-entities.d.ts +3 -3
  17. package/dist/blocks/block-overrides.d.ts +26 -0
  18. package/dist/blocks/block-overrides.js +2 -0
  19. package/dist/blocks/cli.js +1 -1
  20. package/dist/blocks/datapack.d.ts +2 -0
  21. package/dist/blocks/datapack.js +2 -0
  22. package/dist/blocks/ender-storage.d.ts +2 -2
  23. package/dist/blocks/entities.d.ts +3 -3
  24. package/dist/blocks/entity-geo.d.ts +1 -1
  25. package/dist/blocks/entity-models.d.ts +4 -13
  26. package/dist/blocks/entity-models.js +1 -1
  27. package/dist/blocks/entity-sizes.d.ts +25 -0
  28. package/dist/blocks/entity-sizes.js +2 -0
  29. package/dist/blocks/export.d.ts +1 -1
  30. package/dist/blocks/export.js +1 -1
  31. package/dist/blocks/game-rules.d.ts +2 -0
  32. package/dist/blocks/game-rules.js +2 -0
  33. package/dist/blocks/geo-blocks.d.ts +2 -2
  34. package/dist/blocks/item-sprites.d.ts +4 -4
  35. package/dist/blocks/light-bytecode.d.ts +2 -174
  36. package/dist/blocks/light-bytecode.js +1 -1
  37. package/dist/blocks/light-eval.d.ts +1 -1
  38. package/dist/blocks/light.d.ts +11 -1
  39. package/dist/blocks/light.js +1 -1
  40. package/dist/blocks/names.d.ts +2 -0
  41. package/dist/blocks/names.js +2 -0
  42. package/dist/blocks/obj-mesh.d.ts +1 -1
  43. package/dist/blocks/pack-format.d.ts +2 -2
  44. package/dist/blocks/sprite-sheet.d.ts +3 -3
  45. package/dist/blocks/states.d.ts +2 -0
  46. package/dist/blocks/states.js +2 -0
  47. package/dist/blocks/tints.d.ts +1 -1
  48. package/dist/{classfile-CiIDF3vc.js → classfile-BJSs3JH0.js} +23 -3
  49. package/dist/{classfile-CsLXlh5z.d.ts → classfile-Dzn0gW9M.d.ts} +6 -0
  50. package/dist/{cli-Dw1Q5CPR.js → cli-DwMPoX0I.js} +10 -5
  51. package/dist/cli.js +7 -7
  52. package/dist/datapack-CmEg0Vko.d.ts +15 -0
  53. package/dist/datapack-D6eH46ay.js +71 -0
  54. package/dist/{descriptor-CmkIkDKL.js → descriptor-Dz2cR-BH.js} +2 -2
  55. package/dist/{discovery-Cmir3QfC.d.ts → discovery-DWe_kX8W.d.ts} +1 -1
  56. package/dist/dynamic/generators.d.ts +1 -1
  57. package/dist/{encode-Br_vPrd8.d.ts → encode-BNEYHHR0.d.ts} +1 -1
  58. package/dist/entities/classfile.d.ts +1 -1
  59. package/dist/entities/classfile.js +1 -1
  60. package/dist/entities/geo-model.d.ts +1 -1
  61. package/dist/entities/inherit.d.ts +2 -2
  62. package/dist/entities/inherit.js +1 -1
  63. package/dist/entities/jar-classes.js +1 -1
  64. package/dist/entities/link.d.ts +2 -2
  65. package/dist/entities/link.js +1 -1
  66. package/dist/entities/mappings.d.ts +1 -1
  67. package/dist/entities/mappings.js +1 -1
  68. package/dist/entities/model-bytecode.d.ts +1 -1
  69. package/dist/entities/model-bytecode.js +1 -1
  70. package/dist/entities/model-code.d.ts +1 -1
  71. package/dist/entities/model-code.js +1 -1
  72. package/dist/{entity-models-BGiy3pey.js → entity-models-vFl_EwfA.js} +24 -5
  73. package/dist/entity-sizes-DspxgSUA.js +194 -0
  74. package/dist/{export-t8X_oRws.js → export-ArMmWuCC.js} +62 -5
  75. package/dist/{export-J13L9Lqu.d.ts → export-CqeTinYL.d.ts} +19 -2
  76. package/dist/{face-DqEd9G_U.d.ts → face-uWXECGNr.d.ts} +2 -2
  77. package/dist/game-rules-BDPTopVW.js +104 -0
  78. package/dist/game-rules-ThvdDG3B.d.ts +16 -0
  79. package/dist/{generators-BnIzAftW.d.ts → generators-hu_vk10m.d.ts} +1 -1
  80. package/dist/{geo-C9QYeLVN.d.ts → geo-DsWwuC5o.d.ts} +4 -4
  81. package/dist/index.d.ts +20 -20
  82. package/dist/index.js +8 -8
  83. package/dist/{inherit-BUn0Cve9.js → inherit-DJ45bOB_.js} +2 -2
  84. package/dist/items/blockstate.d.ts +1 -1
  85. package/dist/items/discovery.d.ts +1 -1
  86. package/dist/{jar-B5iRZQeL.d.ts → jar-4Jg7ufWK.d.ts} +1 -1
  87. package/dist/{jar-CBYPMbw7.js → jar-DvofBm71.js} +2 -2
  88. package/dist/{jar-classes-CSm7qq1R.js → jar-classes-0wqWbTax.js} +2 -2
  89. package/dist/{light-CyRhYulM.js → light-CZRA1pOj.js} +48 -6
  90. package/dist/{light-bytecode-Cpyuxo9b.js → light-bytecode-BqpQWqP7.js} +144 -46
  91. package/dist/{light-eval-D9x0ufZx.d.ts → light-eval-C0-kt0bp.d.ts} +1 -1
  92. package/dist/{link-Cuhyrz07.js → link-IDjVJ2Ij.js} +1 -1
  93. package/dist/{loader-DSir1-P0.d.ts → loader-BYyPIs9f.d.ts} +1 -1
  94. package/dist/{loader-59_eMa8e.d.ts → loader-C4gsX_wO.d.ts} +1 -1
  95. package/dist/{manager-exOIcdyx.d.ts → manager-Ct0dEOMg.d.ts} +6 -0
  96. package/dist/{manager-BNibYkmI.js → manager-D6zXmFrO.js} +6 -0
  97. package/dist/{mappings-Ep6ko0rg.js → mappings-DEl_7xxQ.js} +18 -1
  98. package/dist/{mappings-USwcjtcH.d.ts → mappings-DhOPQTgV.d.ts} +5 -0
  99. package/dist/{model-bytecode-VaLUQfGO.js → model-bytecode-CXYAZ5dX.js} +1 -1
  100. package/dist/{model-code-Csc3bs3h.d.ts → model-code-BclYt1do.d.ts} +1 -1
  101. package/dist/{model-code-DbN2uVhp.js → model-code-BmA5ilgt.js} +1 -1
  102. package/dist/models/loader.d.ts +1 -1
  103. package/dist/{models-CZjCOjs4.js → models-BsYA-NZg.js} +1 -1
  104. package/dist/mods/models.d.ts +1 -1
  105. package/dist/mods/models.js +1 -1
  106. package/dist/mods/prepare.d.ts +1 -1
  107. package/dist/mods/prepare.js +1 -1
  108. package/dist/mods/synthesize.d.ts +2 -2
  109. package/dist/mods/tints.d.ts +2 -2
  110. package/dist/mods/tints.js +1 -1
  111. package/dist/names-D1abAVIB.d.ts +10 -0
  112. package/dist/names-GLa5TyL7.js +36 -0
  113. package/dist/{obj-mesh-ydhVfLKs.d.ts → obj-mesh-CzL0lOlJ.d.ts} +2 -2
  114. package/dist/output/encode.d.ts +1 -1
  115. package/dist/pack.d.ts +7 -6
  116. package/dist/{pipeline-DFuQa8ZT.d.ts → pipeline-DuPF3sap.d.ts} +3 -3
  117. package/dist/{pipeline-CRTQGba7.js → pipeline-Q_185kY6.js} +1 -1
  118. package/dist/{prepare-OS7wL3jv.d.ts → prepare-BPzsZI_S.d.ts} +1 -1
  119. package/dist/{prepare-6pH3CNpg.d.ts → prepare-Ce5SpR7Y.d.ts} +1 -1
  120. package/dist/{prepare-C61BcwFA.js → prepare-DkJkZXuQ.js} +2 -2
  121. package/dist/{prepare-DxPEu9mo.js → prepare-sj36BP90.js} +4 -4
  122. package/dist/{rasterizer-C2wgJZ6J.d.ts → rasterizer-DjnurUgD.d.ts} +1 -1
  123. package/dist/render/blend.d.ts +1 -1
  124. package/dist/render/compose.d.ts +2 -2
  125. package/dist/render/entity-fallback.d.ts +6 -6
  126. package/dist/render/face.d.ts +1 -1
  127. package/dist/render/fluid-bucket.d.ts +2 -2
  128. package/dist/render/geo.d.ts +1 -1
  129. package/dist/render/legacy-tints.d.ts +2 -2
  130. package/dist/render/obj.d.ts +5 -5
  131. package/dist/render/pipeline.d.ts +1 -1
  132. package/dist/render/pipeline.js +1 -1
  133. package/dist/render/rasterizer.d.ts +1 -1
  134. package/dist/render/renderer.d.ts +1 -1
  135. package/dist/render/tints.d.ts +1 -1
  136. package/dist/{renderer-DbUmTFDb.d.ts → renderer-QgROYvPv.d.ts} +5 -5
  137. package/dist/resources/descriptor.d.ts +1 -1
  138. package/dist/resources/descriptor.js +1 -1
  139. package/dist/resources/entity-textures.d.ts +2 -2
  140. package/dist/resources/jar.d.ts +1 -1
  141. package/dist/resources/jar.js +1 -1
  142. package/dist/resources/manager.d.ts +1 -1
  143. package/dist/resources/manager.js +1 -1
  144. package/dist/resources/synthetic.d.ts +1 -1
  145. package/dist/resources/zip-reader.js +1 -1
  146. package/dist/{run-DYcem_Vv.js → run-5yX5KRiI.js} +4 -4
  147. package/dist/{run-CLjF0N2d.d.ts → run-CxB1qabg.d.ts} +2 -2
  148. package/dist/run.d.ts +1 -1
  149. package/dist/run.js +1 -1
  150. package/dist/{sources-e5D09Jz_.d.ts → sources-sFtealLJ.d.ts} +1 -1
  151. package/dist/states-BvoZA-ql.js +40 -0
  152. package/dist/states-OzneeCTU.d.ts +25 -0
  153. package/dist/{synthetic-B3R7mW9k.d.ts → synthetic-CWtFtAkR.d.ts} +1 -1
  154. package/dist/textures/loader.d.ts +1 -1
  155. package/dist/textures/overlay.d.ts +1 -1
  156. package/dist/{tints-uLl1CIkC.d.ts → tints-B0a1K11c.d.ts} +2 -2
  157. package/dist/{tints-CWQz6UkM.js → tints-CZeyKzMv.js} +2 -2
  158. package/dist/{tints-CQX8a1F0.d.ts → tints-DwFmEkf3.d.ts} +2 -2
  159. package/dist/versions/legacy-reshape.d.ts +1 -1
  160. package/dist/versions/prepare.d.ts +1 -1
  161. package/dist/versions/prepare.js +1 -1
  162. package/dist/workers/render-worker.d.ts +2 -2
  163. package/dist/workers/render-worker.js +2 -2
  164. package/dist/{zip-reader-zx3kdSq4.js → zip-reader-onwEVMea.js} +4 -4
  165. package/package.json +1 -1
  166. package/dist/biomes-5ZwYxMYe.js +0 -384
  167. package/dist/biomes-CJDJQqJb.d.ts +0 -38
  168. package/dist/pack-format-BqWf-DNc.d.ts +0 -350
@@ -1,2 +1,2 @@
1
- import { t as extractBlockLight } from "../light-bytecode-Cpyuxo9b.js";
1
+ import { t as extractBlockLight } from "../light-bytecode-BqpQWqP7.js";
2
2
  export { extractBlockLight };
@@ -1,2 +1,2 @@
1
- import { t as blockLightLevel } from "../light-eval-D9x0ufZx.js";
1
+ import { t as blockLightLevel } from "../light-eval-C0-kt0bp.js";
2
2
  export { blockLightLevel };
@@ -1,5 +1,5 @@
1
- import { d as BlockPackLight } from "../pack-format-BqWf-DNc.js";
2
1
  import { t as ClassSource } from "../jar-classes-CSRrPAUy.js";
2
+ import { j as BlockPackLight, t as BlockBehaviour } from "../block-behaviour-BBslelpW.js";
3
3
  //#region src/blocks/light.d.ts
4
4
  interface CollectBlockLightOptions {
5
5
  version: string;
@@ -15,10 +15,20 @@ interface CollectBlockLightOptions {
15
15
  interface BlockLightResult {
16
16
  /** Only the blocks that emit; absent is 0. */
17
17
  light: Record<string, BlockPackLight>;
18
+ /**
19
+ * What each block does, from the same run: hardness, collision, map colour. Empty on a version with
20
+ * no mappings (1.13), whose builder calls have no names to read.
21
+ */
22
+ behaviour: Record<string, BlockBehaviour>;
18
23
  failures: Array<{
19
24
  id: string;
20
25
  reason: string;
21
26
  }>;
27
+ /** Blocks whose behaviour was partly unreadable, kept apart from light's so each file owns its gaps. */
28
+ behaviourFailures: Array<{
29
+ id: string;
30
+ reason: string;
31
+ }>;
22
32
  /** What the interpreter gave up on along the way, for a person reading a failure. */
23
33
  notes: string[];
24
34
  }
@@ -1,2 +1,2 @@
1
- import { n as collectBlockLight, r as vanillaLightAt, t as VANILLA_LIGHT } from "../light-CyRhYulM.js";
1
+ import { n as collectBlockLight, r as vanillaLightAt, t as VANILLA_LIGHT } from "../light-CZRA1pOj.js";
2
2
  export { VANILLA_LIGHT, collectBlockLight, vanillaLightAt };
@@ -0,0 +1,2 @@
1
+ import { n as collectNames, t as NamePack } from "../names-D1abAVIB.js";
2
+ export { NamePack, collectNames };
@@ -0,0 +1,2 @@
1
+ import { t as collectNames } from "../names-GLa5TyL7.js";
2
+ export { collectNames };
@@ -1,2 +1,2 @@
1
- import { i as buildObjMesh, n as ObjMesh, r as ObjMeshError, t as MeshGroup } from "../obj-mesh-ydhVfLKs.js";
1
+ import { i as buildObjMesh, n as ObjMesh, r as ObjMeshError, t as MeshGroup } from "../obj-mesh-CzL0lOlJ.js";
2
2
  export { MeshGroup, ObjMesh, ObjMeshError, buildObjMesh };
@@ -1,2 +1,2 @@
1
- import { A as ItemPackLayer, C as EntityPackCubeFace, D as EquipmentPack, E as EntityPackPart, O as EquipmentSlot, S as EntityPackCube, T as EntityPackModel, _ as BlockPackSprite, a as BlockPackBlockStatesFile, b as BlockPackVariant, c as BlockPackEntityModelsFile, d as BlockPackLight, f as BlockPackLightFile, g as BlockPackRenderLayer, h as BlockPackModelsFile, i as BlockPackBlockState, k as ItemPackEntry, l as BlockPackFace, m as BlockPackModel, n as BlockPackAtlasPage, o as BlockPackElement, p as BlockPackMetaFile, r as BlockPackBiomesFile, s as BlockPackEntitiesFile, t as BlockPackAtlasFile, u as BlockPackItemsFile, v as BlockPackSpriteFrame, w as EntityPackEntry, x as EQUIPMENT_SLOTS, y as BlockPackTintsFile } from "../pack-format-BqWf-DNc.js";
2
- export { BlockPackAtlasFile, BlockPackAtlasPage, BlockPackBiomesFile, BlockPackBlockState, BlockPackBlockStatesFile, BlockPackElement, BlockPackEntitiesFile, BlockPackEntityModelsFile, BlockPackFace, BlockPackItemsFile, BlockPackLight, BlockPackLightFile, BlockPackMetaFile, BlockPackModel, BlockPackModelsFile, BlockPackRenderLayer, BlockPackSprite, BlockPackSpriteFrame, BlockPackTintsFile, BlockPackVariant, EQUIPMENT_SLOTS, EntityPackCube, EntityPackCubeFace, EntityPackEntry, EntityPackModel, EntityPackPart, EquipmentPack, EquipmentSlot, ItemPackEntry, ItemPackLayer };
1
+ import { $ as ItemPackLayer, A as BlockPackItemsFile, B as BlockPackStatesFile, C as BlockPackBlockState, D as BlockPackEntityModelsFile, E as BlockPackEntitiesFile, F as BlockPackModelsFile, G as EntityPackCube, H as BlockPackTintsFile, I as BlockPackNamesFile, J as EntityPackModel, K as EntityPackCubeFace, L as BlockPackRenderLayer, M as BlockPackLightFile, N as BlockPackMetaFile, O as BlockPackFace, P as BlockPackModel, Q as ItemPackEntry, R as BlockPackSprite, S as BlockPackBiomesFile, T as BlockPackElement, U as BlockPackVariant, V as BlockPackTagsFile, W as EQUIPMENT_SLOTS, X as EquipmentPack, Y as EntityPackPart, Z as EquipmentSlot, b as BlockPackAtlasPage, j as BlockPackLight, k as BlockPackGameRulesFile, q as EntityPackEntry, v as BlockPackAdvancementsFile, w as BlockPackBlockStatesFile, x as BlockPackBehaviourFile, y as BlockPackAtlasFile, z as BlockPackSpriteFrame } from "../block-behaviour-BBslelpW.js";
2
+ export { BlockPackAdvancementsFile, BlockPackAtlasFile, BlockPackAtlasPage, BlockPackBehaviourFile, BlockPackBiomesFile, BlockPackBlockState, BlockPackBlockStatesFile, BlockPackElement, BlockPackEntitiesFile, BlockPackEntityModelsFile, BlockPackFace, BlockPackGameRulesFile, BlockPackItemsFile, BlockPackLight, BlockPackLightFile, BlockPackMetaFile, BlockPackModel, BlockPackModelsFile, BlockPackNamesFile, BlockPackRenderLayer, BlockPackSprite, BlockPackSpriteFrame, BlockPackStatesFile, BlockPackTagsFile, BlockPackTintsFile, BlockPackVariant, EQUIPMENT_SLOTS, EntityPackCube, EntityPackCubeFace, EntityPackEntry, EntityPackModel, EntityPackPart, EquipmentPack, EquipmentSlot, ItemPackEntry, ItemPackLayer };
@@ -1,6 +1,6 @@
1
- import { i as TextureLoader, r as Texture } from "../loader-59_eMa8e.js";
2
- import { i as PackedPage } from "../atlas-pack-C56gzqAg.js";
3
- import { _ as BlockPackSprite, g as BlockPackRenderLayer } from "../pack-format-BqWf-DNc.js";
1
+ import { i as TextureLoader, r as Texture } from "../loader-C4gsX_wO.js";
2
+ import { i as PackedPage } from "../atlas-pack-BUadroKy.js";
3
+ import { L as BlockPackRenderLayer, R as BlockPackSprite } from "../block-behaviour-BBslelpW.js";
4
4
  //#region src/blocks/sprite-sheet.d.ts
5
5
  /**
6
6
  * Vanilla's own id for the missing-texture sprite. A face whose texture does
@@ -0,0 +1,2 @@
1
+ import { n as BlockStatesPack, r as readBlockStates, t as BlockStateSpec } from "../states-OzneeCTU.js";
2
+ export { BlockStateSpec, BlockStatesPack, readBlockStates };
@@ -0,0 +1,2 @@
1
+ import { t as readBlockStates } from "../states-BvoZA-ql.js";
2
+ export { readBlockStates };
@@ -1,2 +1,2 @@
1
- import { a as buildBlockTints, i as UNREGISTERED_TINTS, n as BlockTintPack, r as BuiltBlockTints, t as BlockTint } from "../tints-CQX8a1F0.js";
1
+ import { a as buildBlockTints, i as UNREGISTERED_TINTS, n as BlockTintPack, r as BuiltBlockTints, t as BlockTint } from "../tints-DwFmEkf3.js";
2
2
  export { BlockTint, BlockTintPack, BuiltBlockTints, UNREGISTERED_TINTS, buildBlockTints };
@@ -173,7 +173,7 @@ function readConstantPool(reader) {
173
173
  * Skips an attribute table, keeping the two that say what a method does: `Code`, and the class-level
174
174
  * `BootstrapMethods` that a lambda's real body is reachable through.
175
175
  */
176
- function readAttributes(reader, utf8, bootstraps) {
176
+ function readAttributes(reader, utf8, bootstraps, constants) {
177
177
  let code;
178
178
  const count = reader.u2();
179
179
  for (let index = 0; index < count; index++) {
@@ -193,6 +193,10 @@ function readAttributes(reader, utf8, bootstraps) {
193
193
  }
194
194
  continue;
195
195
  }
196
+ if (name === "ConstantValue" && constants) {
197
+ constants.push(reader.u2());
198
+ continue;
199
+ }
196
200
  if (name !== "Code") {
197
201
  reader.skip(length);
198
202
  continue;
@@ -221,10 +225,19 @@ function parseClassFile(bytes) {
221
225
  const superIndex = reader.u2();
222
226
  const superClass = superIndex === 0 ? null : utf8(superIndex);
223
227
  reader.skip(reader.u2() * 2);
228
+ const fieldEntries = [];
224
229
  const fieldCount = reader.u2();
225
230
  for (let index = 0; index < fieldCount; index++) {
226
- reader.skip(6);
227
- readAttributes(reader, utf8);
231
+ reader.skip(2);
232
+ const name = utf8(reader.u2());
233
+ const descriptor = utf8(reader.u2());
234
+ const constant = [];
235
+ readAttributes(reader, utf8, void 0, constant);
236
+ fieldEntries.push({
237
+ name,
238
+ descriptor,
239
+ constant: constant[0]
240
+ });
228
241
  }
229
242
  const methods = [];
230
243
  const methodCount = reader.u2();
@@ -297,6 +310,13 @@ function parseClassFile(bytes) {
297
310
  superClass,
298
311
  constants,
299
312
  methods,
313
+ fields: fieldEntries.map((field) => {
314
+ return {
315
+ name: field.name,
316
+ descriptor: field.descriptor,
317
+ constant: field.constant === void 0 ? null : literal(field.constant)
318
+ };
319
+ }),
300
320
  utf8,
301
321
  reference,
302
322
  literal,
@@ -39,6 +39,12 @@ interface ClassFile {
39
39
  superClass: string | null;
40
40
  constants: Array<Constant | null>;
41
41
  methods: MethodInfo[];
42
+ /** Each field, with its value where it is a compile-time constant (`static final int`). */
43
+ fields: Array<{
44
+ name: string;
45
+ descriptor: string;
46
+ constant: string | number | bigint | null;
47
+ }>;
42
48
  /** A pool entry as text, for a `utf8` or anything that resolves to one. */
43
49
  utf8: (index: number) => string;
44
50
  /** `owner.name:descriptor` for a field or method reference. */
@@ -1,9 +1,9 @@
1
1
  import { n as builtinPackPath } from "./builtin-WkWjATeh.js";
2
- import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
3
- import { a as prepareVersionResources, r as compareVersions } from "./prepare-C61BcwFA.js";
4
- import { t as exportBlockPack } from "./export-t8X_oRws.js";
5
- import { n as layeredClasses, t as JarClassReader } from "./jar-classes-CSm7qq1R.js";
6
- import { n as prepareModResources } from "./prepare-DxPEu9mo.js";
2
+ import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-D6zXmFrO.js";
3
+ import { a as prepareVersionResources, r as compareVersions } from "./prepare-DkJkZXuQ.js";
4
+ import { t as exportBlockPack } from "./export-ArMmWuCC.js";
5
+ import { n as layeredClasses, t as JarClassReader } from "./jar-classes-0wqWbTax.js";
6
+ import { n as prepareModResources } from "./prepare-sj36BP90.js";
7
7
  import { t as downloadClientJar } from "./download-1wAfrGKx.js";
8
8
  import path from "node:path";
9
9
  import os from "node:os";
@@ -38,6 +38,8 @@ Options:
38
38
  --no-items do not export items.json (flat sprites for non-block items)
39
39
  --no-entities do not export entities.json (entity names and marker colours)
40
40
  --no-entity-geometry do not read the jar's code for entity model geometry
41
+ --reports <dir> data generator reports for this version (blocks.json
42
+ becomes states.json: every property and default state)
41
43
  --cache-dir <dir> jar download cache (default ~/.rendermite)
42
44
  `;
43
45
  /**
@@ -92,6 +94,7 @@ async function runBlocksCli(argv) {
92
94
  "padding": { type: "string" },
93
95
  "max-page-size": { type: "string" },
94
96
  "cache-dir": { type: "string" },
97
+ "reports": { type: "string" },
95
98
  "builtin": { type: "string" },
96
99
  "no-builtin": {
97
100
  type: "boolean",
@@ -173,6 +176,7 @@ async function runBlocksCli(argv) {
173
176
  entities: !values["no-entities"],
174
177
  classes: classes ?? void 0,
175
178
  cacheDir,
179
+ reports: values.reports,
176
180
  onProgress: (stage, done, total) => {
177
181
  if (done === total || done % 250 === 0) console.log(`${stage}: ${done}/${total}`);
178
182
  }
@@ -183,6 +187,7 @@ async function runBlocksCli(argv) {
183
187
  console.log(result.entityModels > 0 ? `${result.entityModels} entity models recovered from the jar's own code.` : "No entity geometry recovered.");
184
188
  console.log(result.light > 0 ? `${result.light} light-emitting blocks described in light.json.` : "No block light read; light.json not written.");
185
189
  console.log(result.biomes > 0 ? `${result.biomes} biomes described in biomes.json.` : "No biomes to describe; biomes.json not written.");
190
+ console.log(`${result.tags} tags, ${result.advancements} advancements${result.states > 0 ? `, ${result.states} block state definitions` : ""}.`);
186
191
  console.log(`${result.failures.length} entries in failures.json.`);
187
192
  return 0;
188
193
  } finally {
package/dist/cli.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { n as builtinPackPath, t as bedCompatPath } from "./builtin-WkWjATeh.js";
3
- import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
4
- import { t as JarResourceManager } from "./jar-CBYPMbw7.js";
5
- import { a as prepareVersionResources, i as eraForVersion, n as GEOMETRY_DONOR_VERSIONS } from "./prepare-C61BcwFA.js";
6
- import { t as curatedModelOverrides } from "./models-CZjCOjs4.js";
7
- import { n as harvestTintOverrides, t as curatedTintOverrides } from "./tints-CWQz6UkM.js";
3
+ import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-D6zXmFrO.js";
4
+ import { t as JarResourceManager } from "./jar-DvofBm71.js";
5
+ import { a as prepareVersionResources, i as eraForVersion, n as GEOMETRY_DONOR_VERSIONS } from "./prepare-DkJkZXuQ.js";
6
+ import { t as curatedModelOverrides } from "./models-BsYA-NZg.js";
7
+ import { n as harvestTintOverrides, t as curatedTintOverrides } from "./tints-CZeyKzMv.js";
8
8
  import { t as downloadClientJar } from "./download-1wAfrGKx.js";
9
- import { t as runBlocksCli } from "./cli-Dw1Q5CPR.js";
10
- import { t as run } from "./run-DYcem_Vv.js";
9
+ import { t as runBlocksCli } from "./cli-DwMPoX0I.js";
10
+ import { t as run } from "./run-5yX5KRiI.js";
11
11
  import path from "node:path";
12
12
  import os from "node:os";
13
13
  import { parseArgs } from "node:util";
@@ -0,0 +1,15 @@
1
+ import { a as ResourceManager } from "./manager-Ct0dEOMg.js";
2
+ //#region src/blocks/datapack.d.ts
3
+ /** `tags.json`: registry (`block`, `item`, `worldgen/biome`, …) → tag id → its values, unexpanded. */
4
+ type TagPack = Record<string, Record<string, string[]>>;
5
+ /** `advancements.json`: advancement id → the names of its criteria. Recipe unlocks are left out. */
6
+ type AdvancementPack = Record<string, string[]>;
7
+ interface DatapackResult {
8
+ tags: TagPack;
9
+ advancements: AdvancementPack;
10
+ /** Files that were listed but would not parse, by `namespace:path`. */
11
+ unreadable: string[];
12
+ }
13
+ declare function collectDatapack(resources: ResourceManager, namespaces: readonly string[]): Promise<DatapackResult>;
14
+ //#endregion
15
+ export { collectDatapack as i, DatapackResult as n, TagPack as r, AdvancementPack as t };
@@ -0,0 +1,71 @@
1
+ //#region src/blocks/datapack.ts
2
+ /**
3
+ * 1.21 renamed the tag folders to the registry's singular name. Normalised here so a consumer asks
4
+ * for `block` at every version rather than knowing which spelling a jar used.
5
+ */
6
+ const PLURAL_TAG_FOLDERS = {
7
+ blocks: "block",
8
+ items: "item",
9
+ fluids: "fluid",
10
+ entity_types: "entity_type",
11
+ game_events: "game_event",
12
+ functions: "function"
13
+ };
14
+ /** `advancements/` before 1.21, `advancement/` from it. */
15
+ const ADVANCEMENT_FOLDER = /^advancements?\//;
16
+ async function readJson(resources, locator) {
17
+ const raw = await resources.getResource("data", locator);
18
+ if (raw === null) return null;
19
+ try {
20
+ return JSON.parse(raw.toString("utf8"));
21
+ } catch {
22
+ return null;
23
+ }
24
+ }
25
+ async function collectDatapack(resources, namespaces) {
26
+ const tags = {};
27
+ const advancements = {};
28
+ const unreadable = [];
29
+ for (const namespace of namespaces) {
30
+ const listed = await resources.listResources("data", namespace);
31
+ for (const locator of listed.toSorted((left, right) => left.path.localeCompare(right.path))) {
32
+ const tag = /^tags\/(.+)$/.exec(locator.path);
33
+ if (tag) {
34
+ const rest = tag[1];
35
+ const split = /^(worldgen\/[^/]+)\/(.+)$/.exec(rest) ?? /^([^/]+)\/(.+)$/.exec(rest);
36
+ if (!split) continue;
37
+ const registry = PLURAL_TAG_FOLDERS[split[1]] ?? split[1];
38
+ const json = await readJson(resources, locator);
39
+ if (!Array.isArray(json?.values)) {
40
+ unreadable.push(locator.toString());
41
+ continue;
42
+ }
43
+ const values = json.values.flatMap((value) => {
44
+ if (typeof value === "string") return [value];
45
+ const id = value?.id;
46
+ return typeof id === "string" ? [id] : [];
47
+ });
48
+ tags[registry] ??= {};
49
+ tags[registry][`${namespace}:${split[2]}`] = values;
50
+ continue;
51
+ }
52
+ if (ADVANCEMENT_FOLDER.test(locator.path)) {
53
+ const name = locator.path.replace(ADVANCEMENT_FOLDER, "");
54
+ if (name.startsWith("recipes/")) continue;
55
+ const json = await readJson(resources, locator);
56
+ if (typeof json?.criteria !== "object" || json.criteria === null) {
57
+ unreadable.push(locator.toString());
58
+ continue;
59
+ }
60
+ advancements[`${namespace}:${name}`] = Object.keys(json.criteria);
61
+ }
62
+ }
63
+ }
64
+ return {
65
+ tags,
66
+ advancements,
67
+ unreadable
68
+ };
69
+ }
70
+ //#endregion
71
+ export { collectDatapack as t };
@@ -1,6 +1,6 @@
1
1
  import { n as MapResourceManager, t as KindFilteredResourceManager } from "./synthetic-rc9BPT4P.js";
2
- import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
3
- import { t as JarResourceManager } from "./jar-CBYPMbw7.js";
2
+ import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-D6zXmFrO.js";
3
+ import { t as JarResourceManager } from "./jar-DvofBm71.js";
4
4
  //#region src/resources/descriptor.ts
5
5
  /**
6
6
  * Serializable descriptions of a resource tree, so the same layered tree can be
@@ -1,4 +1,4 @@
1
- import { a as ResourceManager } from "./manager-exOIcdyx.js";
1
+ import { a as ResourceManager } from "./manager-Ct0dEOMg.js";
2
2
  import { i as ItemRenderInstruction, r as ItemProperties } from "./definition-ricL7Jqf.js";
3
3
  //#region src/items/discovery.d.ts
4
4
  declare class ItemResolutionError extends Error {}
@@ -1,2 +1,2 @@
1
- import { a as TRIM_DARKER_MATERIALS, i as POTTERY_SHERDS, n as DynamicItem, o as TRIM_MATERIALS, r as DynamicResources, s as builtinDynamicResources, t as ARMOR_ITEM_TYPES } from "../generators-BnIzAftW.js";
1
+ import { a as TRIM_DARKER_MATERIALS, i as POTTERY_SHERDS, n as DynamicItem, o as TRIM_MATERIALS, r as DynamicResources, s as builtinDynamicResources, t as ARMOR_ITEM_TYPES } from "../generators-hu_vk10m.js";
2
2
  export { ARMOR_ITEM_TYPES, DynamicItem, DynamicResources, POTTERY_SHERDS, TRIM_DARKER_MATERIALS, TRIM_MATERIALS, builtinDynamicResources };
@@ -1,4 +1,4 @@
1
- import { n as FloatTexture } from "./blend-C5UYzink.js";
1
+ import { n as FloatTexture } from "./blend-mJAeQB3C.js";
2
2
  //#region src/output/encode.d.ts
3
3
  interface EncodedIcon {
4
4
  png: Buffer;
@@ -1,2 +1,2 @@
1
- import { a as parseClassFile, i as MethodInfo, n as Constant, r as ConstantTag, t as ClassFile } from "../classfile-CsLXlh5z.js";
1
+ import { a as parseClassFile, i as MethodInfo, n as Constant, r as ConstantTag, t as ClassFile } from "../classfile-Dzn0gW9M.js";
2
2
  export { ClassFile, Constant, ConstantTag, MethodInfo, parseClassFile };
@@ -1,2 +1,2 @@
1
- import { t as parseClassFile } from "../classfile-CiIDF3vc.js";
1
+ import { t as parseClassFile } from "../classfile-BJSs3JH0.js";
2
2
  export { parseClassFile };
@@ -1,5 +1,5 @@
1
1
  import { r as ExtractedModel } from "../model-PnQ4gV0-.js";
2
- import { t as ParsedGeo } from "../geo-C9QYeLVN.js";
2
+ import { t as ParsedGeo } from "../geo-DsWwuC5o.js";
3
3
  //#region src/entities/geo-model.d.ts
4
4
  /**
5
5
  * Converts one parsed `.geo.json` into a model.
@@ -1,6 +1,6 @@
1
+ import { t as ClassFile } from "../classfile-Dzn0gW9M.js";
1
2
  import { r as ExtractedModel } from "../model-PnQ4gV0-.js";
2
- import { t as ClassFile } from "../classfile-CsLXlh5z.js";
3
- import { t as ModelCode } from "../model-code-Csc3bs3h.js";
3
+ import { t as ModelCode } from "../model-code-BclYt1do.js";
4
4
  //#region src/entities/inherit.d.ts
5
5
  interface Ancestry {
6
6
  /** The class and its ancestors by internal name, parsed. */
@@ -1,2 +1,2 @@
1
- import { n as extractInheritedModel, t as ancestryOf } from "../inherit-BUn0Cve9.js";
1
+ import { n as extractInheritedModel, t as ancestryOf } from "../inherit-DJ45bOB_.js";
2
2
  export { ancestryOf, extractInheritedModel };
@@ -1,2 +1,2 @@
1
- import { n as layeredClasses, t as JarClassReader } from "../jar-classes-CSm7qq1R.js";
1
+ import { n as layeredClasses, t as JarClassReader } from "../jar-classes-0wqWbTax.js";
2
2
  export { JarClassReader, layeredClasses };
@@ -1,5 +1,5 @@
1
- import { t as Mappings } from "../mappings-USwcjtcH.js";
2
- import { t as ClassFile } from "../classfile-CsLXlh5z.js";
1
+ import { t as ClassFile } from "../classfile-Dzn0gW9M.js";
2
+ import { t as Mappings } from "../mappings-DhOPQTgV.js";
3
3
  //#region src/entities/link.d.ts
4
4
  /**
5
5
  * Entity types whose renderer or model is not named after them. Values are class simple names to look
@@ -1,2 +1,2 @@
1
- import { a as linkEntityModel, i as classReader, n as RENDERER_ALIASES, o as normaliseModelName, r as buildModelNameIndex, t as NO_MODEL } from "../link-Cuhyrz07.js";
1
+ import { a as linkEntityModel, i as classReader, n as RENDERER_ALIASES, o as normaliseModelName, r as buildModelNameIndex, t as NO_MODEL } from "../link-IDjVJ2Ij.js";
2
2
  export { NO_MODEL, RENDERER_ALIASES, buildModelNameIndex, classReader, linkEntityModel, normaliseModelName };
@@ -1,2 +1,2 @@
1
- import { a as isObfuscated, c as remapDescriptor, i as identityMappings, l as resolveMappings, n as MappingsUnavailableError, o as loadMappings, r as downloadClientMappings, s as parseMappings, t as Mappings } from "../mappings-USwcjtcH.js";
1
+ import { a as isObfuscated, c as remapDescriptor, i as identityMappings, l as resolveMappings, n as MappingsUnavailableError, o as loadMappings, r as downloadClientMappings, s as parseMappings, t as Mappings } from "../mappings-DhOPQTgV.js";
2
2
  export { Mappings, MappingsUnavailableError, downloadClientMappings, identityMappings, isObfuscated, loadMappings, parseMappings, remapDescriptor, resolveMappings };
@@ -1,2 +1,2 @@
1
- import { a as loadMappings, c as resolveMappings, i as isObfuscated, n as downloadClientMappings, o as parseMappings, r as identityMappings, s as remapDescriptor, t as MappingsUnavailableError } from "../mappings-Ep6ko0rg.js";
1
+ import { a as loadMappings, c as resolveMappings, i as isObfuscated, n as downloadClientMappings, o as parseMappings, r as identityMappings, s as remapDescriptor, t as MappingsUnavailableError } from "../mappings-DEl_7xxQ.js";
2
2
  export { MappingsUnavailableError, downloadClientMappings, identityMappings, isObfuscated, loadMappings, parseMappings, remapDescriptor, resolveMappings };
@@ -1,5 +1,5 @@
1
+ import { t as ClassFile } from "../classfile-Dzn0gW9M.js";
1
2
  import { r as ExtractedModel } from "../model-PnQ4gV0-.js";
2
- import { t as ClassFile } from "../classfile-CsLXlh5z.js";
3
3
  //#region src/entities/model-bytecode.d.ts
4
4
  /** Argument slot count and shape of a descriptor's parameter list. */
5
5
  declare function parseDescriptor(descriptor: string): {
@@ -1,2 +1,2 @@
1
- import { n as extractModel, r as parseDescriptor, t as extractArmourMesh } from "../model-bytecode-VaLUQfGO.js";
1
+ import { n as extractModel, r as parseDescriptor, t as extractArmourMesh } from "../model-bytecode-CXYAZ5dX.js";
2
2
  export { extractArmourMesh, extractModel, parseDescriptor };
@@ -1,2 +1,2 @@
1
- import { n as isModelCode, r as loadModelCode, t as ModelCode } from "../model-code-Csc3bs3h.js";
1
+ import { n as isModelCode, r as loadModelCode, t as ModelCode } from "../model-code-BclYt1do.js";
2
2
  export { ModelCode, isModelCode, loadModelCode };
@@ -1,2 +1,2 @@
1
- import { n as loadModelCode, t as isModelCode } from "../model-code-DbN2uVhp.js";
1
+ import { n as loadModelCode, t as isModelCode } from "../model-code-BmA5ilgt.js";
2
2
  export { isModelCode, loadModelCode };
@@ -1,11 +1,12 @@
1
1
  import { n as ResourceLocator } from "./locator-COMEtEn9.js";
2
2
  import { t as findGeoForEntity } from "./entity-geo-DbTtMlPL.js";
3
3
  import { t as EQUIPMENT_SLOTS } from "./pack-format-BP5dJMYY.js";
4
- import { n as extractModel, t as extractArmourMesh } from "./model-bytecode-VaLUQfGO.js";
5
- import { n as extractInheritedModel, t as ancestryOf } from "./inherit-BUn0Cve9.js";
6
- import { a as linkEntityModel, i as classReader, r as buildModelNameIndex } from "./link-Cuhyrz07.js";
7
- import { c as resolveMappings, t as MappingsUnavailableError } from "./mappings-Ep6ko0rg.js";
8
- import { n as loadModelCode } from "./model-code-DbN2uVhp.js";
4
+ import { t as parseClassFile } from "./classfile-BJSs3JH0.js";
5
+ import { n as extractModel, t as extractArmourMesh } from "./model-bytecode-CXYAZ5dX.js";
6
+ import { n as extractInheritedModel, t as ancestryOf } from "./inherit-DJ45bOB_.js";
7
+ import { a as linkEntityModel, i as classReader, r as buildModelNameIndex } from "./link-IDjVJ2Ij.js";
8
+ import { c as resolveMappings, t as MappingsUnavailableError } from "./mappings-DEl_7xxQ.js";
9
+ import { n as loadModelCode } from "./model-code-BmA5ilgt.js";
9
10
  //#region src/blocks/entity-models.ts
10
11
  /**
11
12
  * Entity geometry for the pack: link each entity to the class that builds it, read that class's
@@ -345,6 +346,22 @@ async function armourGeometry(names, mappings, read, code) {
345
346
  * the assets cannot answer, since nothing in them maps `iron_helmet` to `iron`: they follow the
346
347
  * game's own naming, and each is confirmed against a real item model before being claimed.
347
348
  */
349
+ /**
350
+ * Where the game keeps the colour an undyed leather piece takes, newest first: 1.20.5 moved it from
351
+ * the item class to the dyed-colour component. A `static final int`, so it is read off the field
352
+ * itself, since javac copies the value into every place that uses it.
353
+ */
354
+ const LEATHER_COLOUR_FIELDS = [["net.minecraft.world.item.component.DyedItemColor", "LEATHER_COLOR"], ["net.minecraft.world.item.DyeableLeatherItem", "DEFAULT_LEATHER_COLOR"]];
355
+ async function undyedLeather(mappings, read) {
356
+ for (const [owner, field] of LEATHER_COLOUR_FIELDS) {
357
+ const bytes = await read((mappings.obfuscatedOf.get(owner) ?? owner).replaceAll(".", "/"));
358
+ if (!bytes) continue;
359
+ const name = mappings.fieldOf.get(`${owner}.${field}`) ?? field;
360
+ const value = parseClassFile(bytes).fields.find((candidate) => candidate.name === name)?.constant;
361
+ if (typeof value === "number") return `#${(value & 16777215).toString(16).padStart(6, "0")}`;
362
+ }
363
+ return null;
364
+ }
348
365
  async function collectEquipment(names, mappings, read, code, resources, models, spriteIds) {
349
366
  if (!resources) return null;
350
367
  const found = await armourGeometry(names, mappings, read, code);
@@ -385,6 +402,7 @@ async function collectEquipment(names, mappings, read, code, resources, models,
385
402
  }
386
403
  }
387
404
  const trims = await collectArmourTrims(resources, spriteIds);
405
+ const leather = dyeable.includes("minecraft:leather") ? await undyedLeather(mappings, read) : null;
388
406
  const modelKey = `${found.className}#armor`;
389
407
  models[modelKey] = {
390
408
  textureSize: [...found.model.textureSize],
@@ -399,6 +417,7 @@ async function collectEquipment(names, mappings, read, code, resources, models,
399
417
  materials,
400
418
  items,
401
419
  dyeable,
420
+ ...leather && { undyed: { "minecraft:leather": leather } },
402
421
  trims
403
422
  };
404
423
  }