@nodecraft/rendermite 1.7.4 → 1.8.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 (72) hide show
  1. package/dist/blocks/cli.js +1 -1
  2. package/dist/blocks/ender-storage.d.ts +1 -1
  3. package/dist/blocks/entities.d.ts +1 -1
  4. package/dist/blocks/entity-models.d.ts +3 -3
  5. package/dist/blocks/entity-models.js +1 -1
  6. package/dist/blocks/export.d.ts +1 -1
  7. package/dist/blocks/export.js +1 -1
  8. package/dist/blocks/geo-blocks.d.ts +1 -1
  9. package/dist/blocks/item-sprites.d.ts +1 -1
  10. package/dist/blocks/light-bytecode.d.ts +174 -0
  11. package/dist/blocks/light-bytecode.js +2 -0
  12. package/dist/blocks/light-eval.d.ts +2 -0
  13. package/dist/blocks/light-eval.js +2 -0
  14. package/dist/blocks/light.d.ts +38 -0
  15. package/dist/blocks/light.js +2 -0
  16. package/dist/blocks/pack-format.d.ts +2 -2
  17. package/dist/blocks/sprite-sheet.d.ts +1 -1
  18. package/dist/{classfile-Bo7FUrrD.js → classfile-CiIDF3vc.js} +23 -1
  19. package/dist/{classfile-BdLIk4Pe.d.ts → classfile-CsLXlh5z.d.ts} +23 -0
  20. package/dist/{cli-DBNuCnry.js → cli-Dw1Q5CPR.js} +5 -4
  21. package/dist/cli.js +5 -5
  22. package/dist/{descriptor-JyXhfd-c.js → descriptor-CmkIkDKL.js} +2 -2
  23. package/dist/entities/classfile.d.ts +1 -1
  24. package/dist/entities/classfile.js +1 -1
  25. package/dist/entities/inherit.d.ts +2 -2
  26. package/dist/entities/inherit.js +1 -1
  27. package/dist/entities/jar-classes.js +1 -1
  28. package/dist/entities/link.d.ts +2 -2
  29. package/dist/entities/link.js +1 -1
  30. package/dist/entities/mappings.d.ts +2 -2
  31. package/dist/entities/mappings.js +2 -2
  32. package/dist/entities/model-bytecode.d.ts +7 -2
  33. package/dist/entities/model-bytecode.js +2 -2
  34. package/dist/entities/model-code.d.ts +1 -1
  35. package/dist/entities/model-code.js +1 -1
  36. package/dist/{entity-models-DUKiHpn1.js → entity-models-BGiy3pey.js} +5 -5
  37. package/dist/{export-B8tPsf4K.d.ts → export-J13L9Lqu.d.ts} +3 -1
  38. package/dist/{export-Ds1EelMa.js → export-t8X_oRws.js} +22 -2
  39. package/dist/index.d.ts +1 -1
  40. package/dist/index.js +6 -6
  41. package/dist/{inherit-BYLi3Q28.js → inherit-BUn0Cve9.js} +2 -2
  42. package/dist/{jar-W2cV2ZVO.js → jar-CBYPMbw7.js} +1 -1
  43. package/dist/{jar-classes-3GVCJZT7.js → jar-classes-CSm7qq1R.js} +2 -2
  44. package/dist/light-CyRhYulM.js +582 -0
  45. package/dist/light-bytecode-Cpyuxo9b.js +1749 -0
  46. package/dist/light-eval-BsJJoSv4.js +23 -0
  47. package/dist/light-eval-D9x0ufZx.d.ts +13 -0
  48. package/dist/{link-5GmBLTzk.js → link-Cuhyrz07.js} +1 -1
  49. package/dist/{mappings-BEPVaiwE.js → mappings-Ep6ko0rg.js} +77 -9
  50. package/dist/{mappings-DxX4KoZl.d.ts → mappings-USwcjtcH.d.ts} +28 -2
  51. package/dist/{model-bytecode-B43uSqet.js → model-bytecode-VaLUQfGO.js} +2 -2
  52. package/dist/{model-code-BY44ao27.d.ts → model-code-Csc3bs3h.d.ts} +1 -1
  53. package/dist/{model-code-1Vuk-zj_.js → model-code-DbN2uVhp.js} +1 -1
  54. package/dist/mods/prepare.js +1 -1
  55. package/dist/mods/tints.js +1 -1
  56. package/dist/{pack-format-Baoc_aSZ.d.ts → pack-format-BqWf-DNc.d.ts} +23 -1
  57. package/dist/pack.d.ts +3 -2
  58. package/dist/pack.js +2 -1
  59. package/dist/{prepare-D49Gu4Lv.js → prepare-C61BcwFA.js} +2 -2
  60. package/dist/{prepare-Myd_ec4v.js → prepare-DxPEu9mo.js} +2 -2
  61. package/dist/render/pipeline.js +1 -1
  62. package/dist/resources/descriptor.js +1 -1
  63. package/dist/resources/jar.js +1 -1
  64. package/dist/resources/zip-reader.js +1 -1
  65. package/dist/{run-Ctt_1iTd.js → run-DYcem_Vv.js} +2 -2
  66. package/dist/run.js +1 -1
  67. package/dist/versions/prepare.js +1 -1
  68. package/dist/workers/render-worker.js +2 -2
  69. package/package.json +6 -6
  70. package/dist/{pipeline-BTlk9-s5.js → pipeline-CRTQGba7.js} +1 -1
  71. package/dist/{tints-BspVCz2G.js → tints-CWQz6UkM.js} +1 -1
  72. package/dist/{zip-reader-BSbJKUT1.js → zip-reader-zx3kdSq4.js} +1 -1
@@ -1,2 +1,2 @@
1
- import { t as runBlocksCli } from "../cli-DBNuCnry.js";
1
+ import { t as runBlocksCli } from "../cli-Dw1Q5CPR.js";
2
2
  export { runBlocksCli };
@@ -1,5 +1,5 @@
1
1
  import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
- import { f as BlockPackModel } from "../pack-format-Baoc_aSZ.js";
2
+ import { m as BlockPackModel } from "../pack-format-BqWf-DNc.js";
3
3
  //#region src/blocks/ender-storage.d.ts
4
4
  /**
5
5
  * Ender Storage feeds this OBJ through CodeChickenLib's `swapYZ`, translates it almost exactly onto
@@ -1,6 +1,6 @@
1
1
  import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
2
  import { i as TextureLoader } from "../loader-59_eMa8e.js";
3
- import { S as EntityPackEntry } from "../pack-format-Baoc_aSZ.js";
3
+ import { w as EntityPackEntry } from "../pack-format-BqWf-DNc.js";
4
4
  //#region src/blocks/entities.d.ts
5
5
  interface EntityPackResult {
6
6
  entities: Record<string, EntityPackEntry>;
@@ -1,8 +1,8 @@
1
1
  import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
- import { C as EntityPackModel, T as EquipmentPack } from "../pack-format-Baoc_aSZ.js";
2
+ import { D as EquipmentPack, T as EntityPackModel } from "../pack-format-BqWf-DNc.js";
3
3
  import { t as ClassSource } from "../jar-classes-CSRrPAUy.js";
4
- import { t as Mappings } from "../mappings-DxX4KoZl.js";
5
- import { t as ModelCode } from "../model-code-BY44ao27.js";
4
+ import { t as Mappings } from "../mappings-USwcjtcH.js";
5
+ import { t as ModelCode } from "../model-code-Csc3bs3h.js";
6
6
  //#region src/blocks/entity-models.d.ts
7
7
  interface EntityGeometryResult {
8
8
  /** Model id (the class it came from) → geometry. */
@@ -1,2 +1,2 @@
1
- import { n as collectEntityGeometry, r as collectEquipment, t as collectArmourTrims } from "../entity-models-DUKiHpn1.js";
1
+ import { n as collectEntityGeometry, r as collectEquipment, t as collectArmourTrims } from "../entity-models-BGiy3pey.js";
2
2
  export { collectArmourTrims, collectEntityGeometry, collectEquipment };
@@ -1,2 +1,2 @@
1
- import { i as exportBlockPack, n as BlockPackResult, r as ExportBlockPackOptions, t as BlockPackFailure } from "../export-B8tPsf4K.js";
1
+ import { i as exportBlockPack, n as BlockPackResult, r as ExportBlockPackOptions, t as BlockPackFailure } from "../export-J13L9Lqu.js";
2
2
  export { BlockPackFailure, BlockPackResult, ExportBlockPackOptions, exportBlockPack };
@@ -1,2 +1,2 @@
1
- import { t as exportBlockPack } from "../export-Ds1EelMa.js";
1
+ import { t as exportBlockPack } from "../export-t8X_oRws.js";
2
2
  export { exportBlockPack };
@@ -1,5 +1,5 @@
1
1
  import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
- import { f as BlockPackModel } from "../pack-format-Baoc_aSZ.js";
2
+ import { m as BlockPackModel } from "../pack-format-BqWf-DNc.js";
3
3
  //#region src/blocks/geo-blocks.d.ts
4
4
  interface GeoBlockOverride {
5
5
  model: BlockPackModel;
@@ -1,7 +1,7 @@
1
1
  import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
2
  import { i as TextureLoader } from "../loader-59_eMa8e.js";
3
3
  import { t as ModelLoader } from "../loader-DSir1-P0.js";
4
- import { D as ItemPackEntry } from "../pack-format-Baoc_aSZ.js";
4
+ import { k as ItemPackEntry } from "../pack-format-BqWf-DNc.js";
5
5
  //#region src/blocks/item-sprites.d.ts
6
6
  interface ItemSpriteFailure {
7
7
  id: string;
@@ -0,0 +1,174 @@
1
+ import { d as BlockPackLight } from "../pack-format-BqWf-DNc.js";
2
+ import { t as ClassFile } from "../classfile-CsLXlh5z.js";
3
+ //#region src/blocks/light-bytecode.d.ts
4
+ /** A member reference as the constant pool spells it. */
5
+ interface MemberReference {
6
+ owner: string;
7
+ name: string;
8
+ descriptor: string;
9
+ }
10
+ /** What the caller supplies: how to find code, and how to rename a reference before looking. */
11
+ interface LightCodeSource {
12
+ /** The parsed class, or null for anything outside the jars (the JDK, a loader). */
13
+ resolve: (internalName: string) => ClassFile | null;
14
+ /**
15
+ * A reference as the jar spells it. A mod names the game's classes and members by their original
16
+ * names; against an obfuscated client those have to be renamed before they can be found.
17
+ */
18
+ remap: (reference: MemberReference, field: boolean) => MemberReference;
19
+ remapClass: (internalName: string) => string;
20
+ /** Classes that are a block `Properties` builder, in every spelling the jars use. */
21
+ propsClasses: ReadonlySet<string>;
22
+ /**
23
+ * Whether a class is the game's rather than a mod's. A mod export runs the game's own `Blocks` too,
24
+ * for the properties mods copy, and its registrations must not answer for a mod block that happens
25
+ * to share a name — `immersiveengineering:lantern` is not `minecraft:lantern`.
26
+ */
27
+ isVanillaClass: (internalName: string) => boolean;
28
+ /**
29
+ * Methods a block class may override to answer its own light: the game's `getLightValue(state)`
30
+ * before 1.16, when a lit furnace was an override rather than a lambda, and a loader's
31
+ * `getLightEmission(state, level, pos)`. `root` is the class whose implementation is the plain
32
+ * property read, so a call resolving there — `super.getLightValue(state)` — is answered from the
33
+ * block's `Properties`.
34
+ */
35
+ lightGetters: ReadonlyArray<LightGetter>;
36
+ }
37
+ interface LightGetter {
38
+ name: string;
39
+ /** Empty to match by name alone: a loader method whose parameter types the jar does not spell. */
40
+ descriptor: string;
41
+ root: string | null;
42
+ }
43
+ /** How a block's light is stated, before it is evaluated. */
44
+ type LightSpec = {
45
+ kind: 'constant';
46
+ level: number;
47
+ } |
48
+ /** A `ToIntFunction<BlockState>`, to be run per state. */
49
+ {
50
+ kind: 'function';
51
+ fn: LambdaValue;
52
+ } |
53
+ /** A block class's own light method: a 1.13–1.15 `getLightValue` override, or a loader's `getLightEmission`. */
54
+ {
55
+ kind: 'method';
56
+ owner: string;
57
+ getter: LightGetter;
58
+ receiver: Handle | null;
59
+ } |
60
+ /** A light function the interpreter could not identify — one built from a value it never saw. */
61
+ {
62
+ kind: 'opaque';
63
+ reason: string;
64
+ };
65
+ interface Handle {
66
+ id: number;
67
+ /** Internal class name, from `new` or the declared return type of the opaque call that made it. */
68
+ type: string | null;
69
+ /** Strings that flowed into this object: the name a registration key or a property was made from. */
70
+ strings: string[];
71
+ numbers: number[];
72
+ /** Class literals that flowed in: the value class of an enum property. */
73
+ classes: string[];
74
+ fields: Map<string, Value>;
75
+ isProps: boolean;
76
+ light: LightSpec | null;
77
+ /** For a block: the `Properties` it was constructed with. */
78
+ props: Handle | null;
79
+ ctorArgs: Value[] | null;
80
+ /** `StringBuilder` parts, for the pre-Java 9 way of building a name. */
81
+ builder?: Array<string | number>;
82
+ origin?: string;
83
+ /** Entries of a map the code filled, for a lookup table of properties by direction. */
84
+ map?: Array<{
85
+ key: Value;
86
+ value: Value;
87
+ }>;
88
+ /** Elements of a list or set the code filled, for a table of names a mod registers in a loop. */
89
+ items?: Value[];
90
+ /** An iterator over a list: what it walks and where it is. */
91
+ iterator?: {
92
+ items: Value[];
93
+ at: number;
94
+ };
95
+ }
96
+ interface LambdaValue {
97
+ kind: 'lambda';
98
+ owner: string;
99
+ name: string;
100
+ descriptor: string;
101
+ captured: Value[];
102
+ }
103
+ /** A `BlockState` during evaluation of a light function: a bag of property values being read. */
104
+ interface StateProbe {
105
+ values: Map<string, string>;
106
+ domains: Map<string, PropertyDomain>;
107
+ reads: Set<string>;
108
+ failure: string | null;
109
+ }
110
+ interface PropertyDomain {
111
+ name: string;
112
+ values: string[];
113
+ /** The enum constant per serialized value, for a property whose values are an enum. */
114
+ constants?: Map<string, Handle>;
115
+ }
116
+ type Value = LambdaValue | {
117
+ kind: 'number';
118
+ value: number;
119
+ wide?: boolean;
120
+ } | {
121
+ kind: 'string';
122
+ value: string;
123
+ } | {
124
+ kind: 'object';
125
+ handle: Handle;
126
+ } | {
127
+ kind: 'array';
128
+ items: Value[];
129
+ } | {
130
+ kind: 'class';
131
+ name: string;
132
+ } | {
133
+ kind: 'null';
134
+ } | {
135
+ kind: 'state';
136
+ probe: StateProbe;
137
+ } | {
138
+ kind: 'unknown';
139
+ };
140
+ /** One registration this found: which `Properties` a name was registered with, and the block if seen. */
141
+ interface Registration {
142
+ props: Handle | null;
143
+ block: Handle | null;
144
+ /** The block's class, when a factory method reference named it. */
145
+ blockType: string | null;
146
+ /** The call that registered it, for a person chasing a wrong answer. */
147
+ site: string;
148
+ /** Made by the game's own code, which a mod's block of the same bare name must not inherit. */
149
+ vanilla: boolean;
150
+ }
151
+ /** What one run over a set of registry classes found. */
152
+ interface LightExtraction {
153
+ registrations: Map<string, Registration>;
154
+ notes: string[];
155
+ /** The light a block emits, or why it could not be worked out. */
156
+ lightOf: (blockId: string) => {
157
+ light: BlockPackLight;
158
+ } | {
159
+ failure: string;
160
+ };
161
+ /** What was recorded for a block, for a person chasing a failure. */
162
+ describe: (blockId: string) => string;
163
+ }
164
+ /**
165
+ * Runs the registry code of a set of classes and answers, per block, what it emits.
166
+ *
167
+ * `roots` are the classes whose methods register blocks; every method of each is run, because where
168
+ * the registrations sit differs by era and mod — `<clinit>` for a modern registry, a static
169
+ * `registerBlocks()` in 1.13, an instance `init()` in a mod. The order is `<clinit>` first, since the
170
+ * others read what it set up.
171
+ */
172
+ declare function extractBlockLight(roots: readonly ClassFile[], source: LightCodeSource): LightExtraction;
173
+ //#endregion
174
+ export { LightCodeSource, LightExtraction, LightGetter, LightSpec, MemberReference, PropertyDomain, Registration, StateProbe, extractBlockLight };
@@ -0,0 +1,2 @@
1
+ import { t as extractBlockLight } from "../light-bytecode-Cpyuxo9b.js";
2
+ export { extractBlockLight };
@@ -0,0 +1,2 @@
1
+ import { t as blockLightLevel } from "../light-eval-D9x0ufZx.js";
2
+ export { blockLightLevel };
@@ -0,0 +1,2 @@
1
+ import { t as blockLightLevel } from "../light-eval-BsJJoSv4.js";
2
+ export { blockLightLevel };
@@ -0,0 +1,38 @@
1
+ import { d as BlockPackLight } from "../pack-format-BqWf-DNc.js";
2
+ import { t as ClassSource } from "../jar-classes-CSRrPAUy.js";
3
+ //#region src/blocks/light.d.ts
4
+ interface CollectBlockLightOptions {
5
+ version: string;
6
+ /** Where mappings cache; the jar cache directory. */
7
+ cacheDir: string;
8
+ classes: ClassSource;
9
+ /** Every block the pack describes, fully qualified; each gets an answer or a failure. */
10
+ blockIds: readonly string[];
11
+ /** Blocks to describe in `notes` — what was registered and with which light — for chasing a failure. */
12
+ trace?: readonly string[];
13
+ onProgress?: (done: number, total: number) => void;
14
+ }
15
+ interface BlockLightResult {
16
+ /** Only the blocks that emit; absent is 0. */
17
+ light: Record<string, BlockPackLight>;
18
+ failures: Array<{
19
+ id: string;
20
+ reason: string;
21
+ }>;
22
+ /** What the interpreter gave up on along the way, for a person reading a failure. */
23
+ notes: string[];
24
+ }
25
+ declare function collectBlockLight(options: CollectBlockLightOptions): Promise<BlockLightResult>;
26
+ /**
27
+ * Vanilla's emitters, transcribed from `Blocks.java` across 1.13 → 26.2 and checked against the wiki.
28
+ *
29
+ * By path, as a superset across versions: a block a version does not have never comes up in one of its
30
+ * worlds, and none of these levels has changed since the block was added. Cases are in the folded form
31
+ * the extractor emits — the commonest level as `default`, the rest as the fewest properties that
32
+ * decide them — so the two can be compared directly.
33
+ */
34
+ declare const VANILLA_LIGHT: Record<string, BlockPackLight>;
35
+ /** The vanilla table as it stood at a version: `VANILLA_LIGHT` with the history applied. */
36
+ declare function vanillaLightAt(version: string): Record<string, BlockPackLight>;
37
+ //#endregion
38
+ export { BlockLightResult, CollectBlockLightOptions, VANILLA_LIGHT, collectBlockLight, vanillaLightAt };
@@ -0,0 +1,2 @@
1
+ import { n as collectBlockLight, r as vanillaLightAt, t as VANILLA_LIGHT } from "../light-CyRhYulM.js";
2
+ export { VANILLA_LIGHT, collectBlockLight, vanillaLightAt };
@@ -1,2 +1,2 @@
1
- import { C as EntityPackModel, D as ItemPackEntry, E as EquipmentSlot, O as ItemPackLayer, S as EntityPackEntry, T as EquipmentPack, _ as BlockPackTintsFile, a as BlockPackBlockStatesFile, b as EntityPackCube, c as BlockPackEntityModelsFile, 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, s as BlockPackEntitiesFile, t as BlockPackAtlasFile, u as BlockPackItemsFile, v as BlockPackVariant, w as EntityPackPart, x as EntityPackCubeFace, y as EQUIPMENT_SLOTS } from "../pack-format-Baoc_aSZ.js";
2
- export { BlockPackAtlasFile, BlockPackAtlasPage, BlockPackBiomesFile, BlockPackBlockState, BlockPackBlockStatesFile, BlockPackElement, BlockPackEntitiesFile, BlockPackEntityModelsFile, BlockPackFace, BlockPackItemsFile, BlockPackMetaFile, BlockPackModel, BlockPackModelsFile, BlockPackRenderLayer, BlockPackSprite, BlockPackSpriteFrame, BlockPackTintsFile, BlockPackVariant, EQUIPMENT_SLOTS, EntityPackCube, EntityPackCubeFace, EntityPackEntry, EntityPackModel, EntityPackPart, EquipmentPack, EquipmentSlot, ItemPackEntry, ItemPackLayer };
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,6 +1,6 @@
1
1
  import { i as TextureLoader, r as Texture } from "../loader-59_eMa8e.js";
2
2
  import { i as PackedPage } from "../atlas-pack-C56gzqAg.js";
3
- import { h as BlockPackSprite, m as BlockPackRenderLayer } from "../pack-format-Baoc_aSZ.js";
3
+ import { _ as BlockPackSprite, g as BlockPackRenderLayer } from "../pack-format-BqWf-DNc.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
@@ -272,6 +272,26 @@ function parseClassFile(bytes) {
272
272
  }
273
273
  return null;
274
274
  };
275
+ const bootstrap = (index) => {
276
+ const entry = constants[index];
277
+ const row = entry?.bootstrapIndex === void 0 ? void 0 : bootstraps[entry.bootstrapIndex];
278
+ if (!row) return null;
279
+ const handle = constants[row.handleIndex];
280
+ return {
281
+ factory: handle?.tag === "methodHandle" && handle.referenceIndex !== void 0 ? reference(handle.referenceIndex) : null,
282
+ args: row.argumentIndexes.map((argument) => literal(argument))
283
+ };
284
+ };
285
+ const invokeDynamic = (index) => {
286
+ const entry = constants[index];
287
+ if (entry?.tag !== "invokeDynamic" || entry.nameAndTypeIndex === void 0) return null;
288
+ const nameAndType = constants[entry.nameAndTypeIndex];
289
+ if (!nameAndType?.nameIndex || !nameAndType.descriptorIndex) return null;
290
+ return {
291
+ name: utf8(nameAndType.nameIndex),
292
+ descriptor: utf8(nameAndType.descriptorIndex)
293
+ };
294
+ };
275
295
  return {
276
296
  thisClass,
277
297
  superClass,
@@ -280,7 +300,9 @@ function parseClassFile(bytes) {
280
300
  utf8,
281
301
  reference,
282
302
  literal,
283
- lambdaTarget
303
+ lambdaTarget,
304
+ bootstrap,
305
+ invokeDynamic
284
306
  };
285
307
  }
286
308
  //#endregion
@@ -61,6 +61,29 @@ interface ClassFile {
61
61
  name: string;
62
62
  descriptor: string;
63
63
  } | null;
64
+ /**
65
+ * An `invokedynamic`'s bootstrap row: the factory it calls and the constant arguments it was given.
66
+ *
67
+ * A lambda is one shape of this; string concatenation is another. `makeConcatWithConstants` takes
68
+ * a recipe string with a placeholder per operand, and a name built as `prefix + "_stairs"` is only
69
+ * recoverable by reading that recipe back.
70
+ */
71
+ bootstrap: (index: number) => {
72
+ factory: {
73
+ owner: string;
74
+ name: string;
75
+ descriptor: string;
76
+ } | null;
77
+ args: Array<string | number | bigint | null>;
78
+ } | null;
79
+ /**
80
+ * An `invokedynamic`'s own name and descriptor: what it pops (the values the lambda captured) and
81
+ * what it leaves. `reference` cannot answer for one, since the pool entry names no owner class.
82
+ */
83
+ invokeDynamic: (index: number) => {
84
+ name: string;
85
+ descriptor: string;
86
+ } | null;
64
87
  }
65
88
  declare function parseClassFile(bytes: Uint8Array): ClassFile;
66
89
  //#endregion
@@ -1,10 +1,10 @@
1
1
  import { n as builtinPackPath } from "./builtin-WkWjATeh.js";
2
2
  import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
3
- import { t as exportBlockPack } from "./export-Ds1EelMa.js";
4
- import { n as layeredClasses, t as JarClassReader } from "./jar-classes-3GVCJZT7.js";
5
- import { n as prepareModResources } from "./prepare-Myd_ec4v.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";
6
7
  import { t as downloadClientJar } from "./download-1wAfrGKx.js";
7
- import { a as prepareVersionResources, r as compareVersions } from "./prepare-D49Gu4Lv.js";
8
8
  import path from "node:path";
9
9
  import os from "node:os";
10
10
  import { parseArgs } from "node:util";
@@ -181,6 +181,7 @@ async function runBlocksCli(argv) {
181
181
  console.log(result.items > 0 ? `${result.items} flat items described in items.json.` : "No flat item sprites exported.");
182
182
  console.log(result.entities > 0 ? `${result.entities} entity types described in entities.json.` : "No entity types exported.");
183
183
  console.log(result.entityModels > 0 ? `${result.entityModels} entity models recovered from the jar's own code.` : "No entity geometry recovered.");
184
+ console.log(result.light > 0 ? `${result.light} light-emitting blocks described in light.json.` : "No block light read; light.json not written.");
184
185
  console.log(result.biomes > 0 ? `${result.biomes} biomes described in biomes.json.` : "No biomes to describe; biomes.json not written.");
185
186
  console.log(`${result.failures.length} entries in failures.json.`);
186
187
  return 0;
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
3
  import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
4
- import { t as JarResourceManager } from "./jar-W2cV2ZVO.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";
5
6
  import { t as curatedModelOverrides } from "./models-CZjCOjs4.js";
6
- import { n as harvestTintOverrides, t as curatedTintOverrides } from "./tints-BspVCz2G.js";
7
+ import { n as harvestTintOverrides, t as curatedTintOverrides } from "./tints-CWQz6UkM.js";
7
8
  import { t as downloadClientJar } from "./download-1wAfrGKx.js";
8
- import { a as prepareVersionResources, i as eraForVersion, n as GEOMETRY_DONOR_VERSIONS } from "./prepare-D49Gu4Lv.js";
9
- import { t as runBlocksCli } from "./cli-DBNuCnry.js";
10
- import { t as run } from "./run-Ctt_1iTd.js";
9
+ import { t as runBlocksCli } from "./cli-Dw1Q5CPR.js";
10
+ import { t as run } from "./run-DYcem_Vv.js";
11
11
  import path from "node:path";
12
12
  import os from "node:os";
13
13
  import { parseArgs } from "node:util";
@@ -1,6 +1,6 @@
1
- import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
2
- import { t as JarResourceManager } from "./jar-W2cV2ZVO.js";
3
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";
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,2 +1,2 @@
1
- import { a as parseClassFile, i as MethodInfo, n as Constant, r as ConstantTag, t as ClassFile } from "../classfile-BdLIk4Pe.js";
1
+ import { a as parseClassFile, i as MethodInfo, n as Constant, r as ConstantTag, t as ClassFile } from "../classfile-CsLXlh5z.js";
2
2
  export { ClassFile, Constant, ConstantTag, MethodInfo, parseClassFile };
@@ -1,2 +1,2 @@
1
- import { t as parseClassFile } from "../classfile-Bo7FUrrD.js";
1
+ import { t as parseClassFile } from "../classfile-CiIDF3vc.js";
2
2
  export { parseClassFile };
@@ -1,6 +1,6 @@
1
1
  import { r as ExtractedModel } from "../model-PnQ4gV0-.js";
2
- import { t as ClassFile } from "../classfile-BdLIk4Pe.js";
3
- import { t as ModelCode } from "../model-code-BY44ao27.js";
2
+ import { t as ClassFile } from "../classfile-CsLXlh5z.js";
3
+ import { t as ModelCode } from "../model-code-Csc3bs3h.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-BYLi3Q28.js";
1
+ import { n as extractInheritedModel, t as ancestryOf } from "../inherit-BUn0Cve9.js";
2
2
  export { ancestryOf, extractInheritedModel };
@@ -1,2 +1,2 @@
1
- import { n as layeredClasses, t as JarClassReader } from "../jar-classes-3GVCJZT7.js";
1
+ import { n as layeredClasses, t as JarClassReader } from "../jar-classes-CSm7qq1R.js";
2
2
  export { JarClassReader, layeredClasses };
@@ -1,5 +1,5 @@
1
- import { t as Mappings } from "../mappings-DxX4KoZl.js";
2
- import { t as ClassFile } from "../classfile-BdLIk4Pe.js";
1
+ import { t as Mappings } from "../mappings-USwcjtcH.js";
2
+ import { t as ClassFile } from "../classfile-CsLXlh5z.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-5GmBLTzk.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-Cuhyrz07.js";
2
2
  export { NO_MODEL, RENDERER_ALIASES, buildModelNameIndex, classReader, linkEntityModel, normaliseModelName };
@@ -1,2 +1,2 @@
1
- import { a as isObfuscated, c as resolveMappings, i as identityMappings, n as MappingsUnavailableError, o as loadMappings, r as downloadClientMappings, s as parseMappings, t as Mappings } from "../mappings-DxX4KoZl.js";
2
- export { Mappings, MappingsUnavailableError, downloadClientMappings, identityMappings, isObfuscated, loadMappings, parseMappings, resolveMappings };
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";
2
+ export { Mappings, MappingsUnavailableError, downloadClientMappings, identityMappings, isObfuscated, loadMappings, parseMappings, remapDescriptor, resolveMappings };
@@ -1,2 +1,2 @@
1
- import { a as loadMappings, i as isObfuscated, n as downloadClientMappings, o as parseMappings, r as identityMappings, s as resolveMappings, t as MappingsUnavailableError } from "../mappings-BEPVaiwE.js";
2
- export { MappingsUnavailableError, downloadClientMappings, identityMappings, isObfuscated, loadMappings, parseMappings, resolveMappings };
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";
2
+ export { MappingsUnavailableError, downloadClientMappings, identityMappings, isObfuscated, loadMappings, parseMappings, remapDescriptor, resolveMappings };
@@ -1,6 +1,11 @@
1
1
  import { r as ExtractedModel } from "../model-PnQ4gV0-.js";
2
- import { t as ClassFile } from "../classfile-BdLIk4Pe.js";
2
+ import { t as ClassFile } from "../classfile-CsLXlh5z.js";
3
3
  //#region src/entities/model-bytecode.d.ts
4
+ /** Argument slot count and shape of a descriptor's parameter list. */
5
+ declare function parseDescriptor(descriptor: string): {
6
+ args: string[];
7
+ returns: string;
8
+ };
4
9
  /**
5
10
  * Extracts whatever geometry a class's methods build.
6
11
  *
@@ -43,4 +48,4 @@ interface Following {
43
48
  declare function extractArmourMesh(bytes: Uint8Array, following: Following): ExtractedModel;
44
49
  declare function extractModel(bytes: Uint8Array, following?: Following): ExtractedModel;
45
50
  //#endregion
46
- export { Following, extractArmourMesh, extractModel };
51
+ export { Following, extractArmourMesh, extractModel, parseDescriptor };
@@ -1,2 +1,2 @@
1
- import { n as extractModel, t as extractArmourMesh } from "../model-bytecode-B43uSqet.js";
2
- export { extractArmourMesh, extractModel };
1
+ import { n as extractModel, r as parseDescriptor, t as extractArmourMesh } from "../model-bytecode-VaLUQfGO.js";
2
+ export { extractArmourMesh, extractModel, parseDescriptor };
@@ -1,2 +1,2 @@
1
- import { n as isModelCode, r as loadModelCode, t as ModelCode } from "../model-code-BY44ao27.js";
1
+ import { n as isModelCode, r as loadModelCode, t as ModelCode } from "../model-code-Csc3bs3h.js";
2
2
  export { ModelCode, isModelCode, loadModelCode };
@@ -1,2 +1,2 @@
1
- import { n as loadModelCode, t as isModelCode } from "../model-code-1Vuk-zj_.js";
1
+ import { n as loadModelCode, t as isModelCode } from "../model-code-DbN2uVhp.js";
2
2
  export { isModelCode, loadModelCode };
@@ -1,11 +1,11 @@
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-B43uSqet.js";
5
- import { n as extractInheritedModel, t as ancestryOf } from "./inherit-BYLi3Q28.js";
6
- import { a as linkEntityModel, i as classReader, r as buildModelNameIndex } from "./link-5GmBLTzk.js";
7
- import { s as resolveMappings, t as MappingsUnavailableError } from "./mappings-BEPVaiwE.js";
8
- import { n as loadModelCode } from "./model-code-1Vuk-zj_.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";
9
9
  //#region src/blocks/entity-models.ts
10
10
  /**
11
11
  * Entity geometry for the pack: link each entity to the class that builds it, read that class's
@@ -50,7 +50,7 @@ interface BlockPackFailure {
50
50
  * `intentional` is not a failure: it marks a block that is empty because the
51
51
  * game draws nothing for it. Filter it out to get the real gaps.
52
52
  */
53
- kind: 'blockstate' | 'model' | 'texture' | 'sprite' | 'geometry' | 'tint' | 'biome' | 'item' | 'entity' | 'intentional';
53
+ kind: 'blockstate' | 'model' | 'texture' | 'sprite' | 'geometry' | 'tint' | 'biome' | 'item' | 'entity' | 'light' | 'intentional';
54
54
  reason: string;
55
55
  }
56
56
  interface BlockPackResult {
@@ -66,6 +66,8 @@ interface BlockPackResult {
66
66
  entities: number;
67
67
  /** Distinct entity models in `entity-models.json`; `0` means the file was not written. */
68
68
  entityModels: number;
69
+ /** Emitting blocks in `light.json`; `0` means the file was not written. */
70
+ light: number;
69
71
  /** Files actually written — the only trustworthy success signal. */
70
72
  writtenFiles: number;
71
73
  failures: BlockPackFailure[];