@nodecraft/rendermite 1.8.0 → 1.9.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 (146) hide show
  1. package/README.md +8 -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/{pack-format-BqWf-DNc.d.ts → block-behaviour-9Tj_GIUC.d.ts} +287 -5
  9. package/dist/block-behaviour-D-SG2Xfp.js +155 -0
  10. package/dist/blocks/atlas-pack.d.ts +1 -1
  11. package/dist/blocks/biomes.d.ts +2 -2
  12. package/dist/blocks/biomes.js +2 -2
  13. package/dist/blocks/block-behaviour.d.ts +2 -0
  14. package/dist/blocks/block-behaviour.js +2 -0
  15. package/dist/blocks/block-entities.d.ts +3 -3
  16. package/dist/blocks/cli.js +1 -1
  17. package/dist/blocks/datapack.d.ts +2 -0
  18. package/dist/blocks/datapack.js +2 -0
  19. package/dist/blocks/ender-storage.d.ts +2 -2
  20. package/dist/blocks/entities.d.ts +3 -3
  21. package/dist/blocks/entity-geo.d.ts +1 -1
  22. package/dist/blocks/entity-models.d.ts +3 -3
  23. package/dist/blocks/entity-models.js +1 -1
  24. package/dist/blocks/entity-sizes.d.ts +25 -0
  25. package/dist/blocks/entity-sizes.js +2 -0
  26. package/dist/blocks/export.d.ts +1 -1
  27. package/dist/blocks/export.js +1 -1
  28. package/dist/blocks/game-rules.d.ts +2 -0
  29. package/dist/blocks/game-rules.js +2 -0
  30. package/dist/blocks/geo-blocks.d.ts +2 -2
  31. package/dist/blocks/item-sprites.d.ts +4 -4
  32. package/dist/blocks/light-bytecode.d.ts +2 -174
  33. package/dist/blocks/light-bytecode.js +1 -1
  34. package/dist/blocks/light-eval.d.ts +1 -1
  35. package/dist/blocks/light.d.ts +11 -1
  36. package/dist/blocks/light.js +1 -1
  37. package/dist/blocks/obj-mesh.d.ts +1 -1
  38. package/dist/blocks/pack-format.d.ts +2 -2
  39. package/dist/blocks/sprite-sheet.d.ts +3 -3
  40. package/dist/blocks/states.d.ts +2 -0
  41. package/dist/blocks/states.js +2 -0
  42. package/dist/blocks/tints.d.ts +1 -1
  43. package/dist/{cli-Dw1Q5CPR.js → cli-xBcMuKA3.js} +10 -5
  44. package/dist/cli.js +7 -7
  45. package/dist/datapack-CmEg0Vko.d.ts +15 -0
  46. package/dist/datapack-D6eH46ay.js +71 -0
  47. package/dist/{descriptor-CmkIkDKL.js → descriptor-Dz2cR-BH.js} +2 -2
  48. package/dist/{discovery-Cmir3QfC.d.ts → discovery-DWe_kX8W.d.ts} +1 -1
  49. package/dist/dynamic/generators.d.ts +1 -1
  50. package/dist/{encode-Br_vPrd8.d.ts → encode-BNEYHHR0.d.ts} +1 -1
  51. package/dist/entities/geo-model.d.ts +1 -1
  52. package/dist/entities/inherit.d.ts +1 -1
  53. package/dist/entities/jar-classes.js +1 -1
  54. package/dist/entities/link.d.ts +1 -1
  55. package/dist/entities/mappings.d.ts +1 -1
  56. package/dist/entities/mappings.js +1 -1
  57. package/dist/entities/model-bytecode.d.ts +1 -1
  58. package/dist/{entity-models-BGiy3pey.js → entity-models-BYAxrTsk.js} +1 -1
  59. package/dist/entity-sizes-CpO1gA7p.js +194 -0
  60. package/dist/{export-t8X_oRws.js → export-CbG2Rx3i.js} +54 -5
  61. package/dist/{export-J13L9Lqu.d.ts → export-HEoqcV-Y.d.ts} +17 -2
  62. package/dist/{face-DqEd9G_U.d.ts → face-uWXECGNr.d.ts} +2 -2
  63. package/dist/game-rules-DuLlFc7o.js +104 -0
  64. package/dist/game-rules-ThvdDG3B.d.ts +16 -0
  65. package/dist/{generators-BnIzAftW.d.ts → generators-hu_vk10m.d.ts} +1 -1
  66. package/dist/{geo-C9QYeLVN.d.ts → geo-DsWwuC5o.d.ts} +4 -4
  67. package/dist/index.d.ts +20 -20
  68. package/dist/index.js +8 -8
  69. package/dist/items/blockstate.d.ts +1 -1
  70. package/dist/items/discovery.d.ts +1 -1
  71. package/dist/{jar-B5iRZQeL.d.ts → jar-4Jg7ufWK.d.ts} +1 -1
  72. package/dist/{jar-CBYPMbw7.js → jar-DvofBm71.js} +2 -2
  73. package/dist/{jar-classes-CSm7qq1R.js → jar-classes-0wqWbTax.js} +2 -2
  74. package/dist/{light-CyRhYulM.js → light-CC3VMsjl.js} +37 -5
  75. package/dist/{light-bytecode-Cpyuxo9b.js → light-bytecode-DYxb6pJk.js} +80 -30
  76. package/dist/{light-eval-D9x0ufZx.d.ts → light-eval-DMjK6xnb.d.ts} +1 -1
  77. package/dist/{loader-DSir1-P0.d.ts → loader-BYyPIs9f.d.ts} +1 -1
  78. package/dist/{loader-59_eMa8e.d.ts → loader-C4gsX_wO.d.ts} +1 -1
  79. package/dist/{manager-exOIcdyx.d.ts → manager-Ct0dEOMg.d.ts} +6 -0
  80. package/dist/{manager-BNibYkmI.js → manager-D6zXmFrO.js} +6 -0
  81. package/dist/{mappings-Ep6ko0rg.js → mappings-DEl_7xxQ.js} +18 -1
  82. package/dist/{mappings-USwcjtcH.d.ts → mappings-DhOPQTgV.d.ts} +5 -0
  83. package/dist/models/loader.d.ts +1 -1
  84. package/dist/{models-CZjCOjs4.js → models-BsYA-NZg.js} +1 -1
  85. package/dist/mods/models.d.ts +1 -1
  86. package/dist/mods/models.js +1 -1
  87. package/dist/mods/prepare.d.ts +1 -1
  88. package/dist/mods/prepare.js +1 -1
  89. package/dist/mods/synthesize.d.ts +2 -2
  90. package/dist/mods/tints.d.ts +2 -2
  91. package/dist/mods/tints.js +1 -1
  92. package/dist/{obj-mesh-ydhVfLKs.d.ts → obj-mesh-CzL0lOlJ.d.ts} +2 -2
  93. package/dist/output/encode.d.ts +1 -1
  94. package/dist/pack.d.ts +7 -6
  95. package/dist/{pipeline-DFuQa8ZT.d.ts → pipeline-DuPF3sap.d.ts} +3 -3
  96. package/dist/{pipeline-CRTQGba7.js → pipeline-Q_185kY6.js} +1 -1
  97. package/dist/{prepare-OS7wL3jv.d.ts → prepare-BPzsZI_S.d.ts} +1 -1
  98. package/dist/{prepare-6pH3CNpg.d.ts → prepare-Ce5SpR7Y.d.ts} +1 -1
  99. package/dist/{prepare-C61BcwFA.js → prepare-DkJkZXuQ.js} +2 -2
  100. package/dist/{prepare-DxPEu9mo.js → prepare-sj36BP90.js} +4 -4
  101. package/dist/{rasterizer-C2wgJZ6J.d.ts → rasterizer-DjnurUgD.d.ts} +1 -1
  102. package/dist/render/blend.d.ts +1 -1
  103. package/dist/render/compose.d.ts +2 -2
  104. package/dist/render/entity-fallback.d.ts +6 -6
  105. package/dist/render/face.d.ts +1 -1
  106. package/dist/render/fluid-bucket.d.ts +2 -2
  107. package/dist/render/geo.d.ts +1 -1
  108. package/dist/render/legacy-tints.d.ts +2 -2
  109. package/dist/render/obj.d.ts +5 -5
  110. package/dist/render/pipeline.d.ts +1 -1
  111. package/dist/render/pipeline.js +1 -1
  112. package/dist/render/rasterizer.d.ts +1 -1
  113. package/dist/render/renderer.d.ts +1 -1
  114. package/dist/render/tints.d.ts +1 -1
  115. package/dist/{renderer-DbUmTFDb.d.ts → renderer-QgROYvPv.d.ts} +5 -5
  116. package/dist/resources/descriptor.d.ts +1 -1
  117. package/dist/resources/descriptor.js +1 -1
  118. package/dist/resources/entity-textures.d.ts +2 -2
  119. package/dist/resources/jar.d.ts +1 -1
  120. package/dist/resources/jar.js +1 -1
  121. package/dist/resources/manager.d.ts +1 -1
  122. package/dist/resources/manager.js +1 -1
  123. package/dist/resources/synthetic.d.ts +1 -1
  124. package/dist/resources/zip-reader.js +1 -1
  125. package/dist/{run-DYcem_Vv.js → run-5yX5KRiI.js} +4 -4
  126. package/dist/{run-CLjF0N2d.d.ts → run-CxB1qabg.d.ts} +2 -2
  127. package/dist/run.d.ts +1 -1
  128. package/dist/run.js +1 -1
  129. package/dist/{sources-e5D09Jz_.d.ts → sources-sFtealLJ.d.ts} +1 -1
  130. package/dist/states-BvoZA-ql.js +40 -0
  131. package/dist/states-OzneeCTU.d.ts +25 -0
  132. package/dist/{synthetic-B3R7mW9k.d.ts → synthetic-CWtFtAkR.d.ts} +1 -1
  133. package/dist/textures/loader.d.ts +1 -1
  134. package/dist/textures/overlay.d.ts +1 -1
  135. package/dist/{tints-uLl1CIkC.d.ts → tints-B0a1K11c.d.ts} +2 -2
  136. package/dist/{tints-CWQz6UkM.js → tints-CZeyKzMv.js} +2 -2
  137. package/dist/{tints-CQX8a1F0.d.ts → tints-DwFmEkf3.d.ts} +2 -2
  138. package/dist/versions/legacy-reshape.d.ts +1 -1
  139. package/dist/versions/prepare.d.ts +1 -1
  140. package/dist/versions/prepare.js +1 -1
  141. package/dist/workers/render-worker.d.ts +2 -2
  142. package/dist/workers/render-worker.js +2 -2
  143. package/dist/{zip-reader-zx3kdSq4.js → zip-reader-onwEVMea.js} +4 -4
  144. package/package.json +1 -1
  145. package/dist/biomes-5ZwYxMYe.js +0 -384
  146. package/dist/biomes-CJDJQqJb.d.ts +0 -38
@@ -0,0 +1,25 @@
1
+ import { t as ClassSource } from "../jar-classes-CSRrPAUy.js";
2
+ //#region src/blocks/entity-sizes.d.ts
3
+ interface Instruction {
4
+ op: number;
5
+ /** The pool index a two-byte operand names, for the loads and invokes this reads. */
6
+ index: number;
7
+ }
8
+ /** Every instruction of a method, in order. */
9
+ declare function instructions(code: Uint8Array): Generator<Instruction>;
10
+ interface EntitySizeResult {
11
+ /** Entity id → [width, height], in blocks. */
12
+ sizes: Map<string, [number, number]>;
13
+ failures: Array<{
14
+ id: string;
15
+ reason: string;
16
+ }>;
17
+ }
18
+ declare function collectEntitySizes(options: {
19
+ classes: ClassSource;
20
+ version: string;
21
+ cacheDir: string;
22
+ entityIds: readonly string[];
23
+ }): Promise<EntitySizeResult>;
24
+ //#endregion
25
+ export { EntitySizeResult, collectEntitySizes, instructions };
@@ -0,0 +1,2 @@
1
+ import { n as instructions, t as collectEntitySizes } from "../entity-sizes-CpO1gA7p.js";
2
+ export { collectEntitySizes, instructions };
@@ -1,2 +1,2 @@
1
- import { i as exportBlockPack, n as BlockPackResult, r as ExportBlockPackOptions, t as BlockPackFailure } from "../export-J13L9Lqu.js";
1
+ import { i as exportBlockPack, n as BlockPackResult, r as ExportBlockPackOptions, t as BlockPackFailure } from "../export-HEoqcV-Y.js";
2
2
  export { BlockPackFailure, BlockPackResult, ExportBlockPackOptions, exportBlockPack };
@@ -1,2 +1,2 @@
1
- import { t as exportBlockPack } from "../export-t8X_oRws.js";
1
+ import { t as exportBlockPack } from "../export-CbG2Rx3i.js";
2
2
  export { exportBlockPack };
@@ -0,0 +1,2 @@
1
+ import { n as GameRulePack, r as collectGameRules, t as GameRule } from "../game-rules-ThvdDG3B.js";
2
+ export { GameRule, GameRulePack, collectGameRules };
@@ -0,0 +1,2 @@
1
+ import { t as collectGameRules } from "../game-rules-DuLlFc7o.js";
2
+ export { collectGameRules };
@@ -1,5 +1,5 @@
1
- import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
- import { m as BlockPackModel } from "../pack-format-BqWf-DNc.js";
1
+ import { a as ResourceManager } from "../manager-Ct0dEOMg.js";
2
+ import { P as BlockPackModel } from "../block-behaviour-9Tj_GIUC.js";
3
3
  //#region src/blocks/geo-blocks.d.ts
4
4
  interface GeoBlockOverride {
5
5
  model: BlockPackModel;
@@ -1,7 +1,7 @@
1
- import { a as ResourceManager } from "../manager-exOIcdyx.js";
2
- import { i as TextureLoader } from "../loader-59_eMa8e.js";
3
- import { t as ModelLoader } from "../loader-DSir1-P0.js";
4
- import { k as ItemPackEntry } from "../pack-format-BqWf-DNc.js";
1
+ import { a as ResourceManager } from "../manager-Ct0dEOMg.js";
2
+ import { i as TextureLoader } from "../loader-C4gsX_wO.js";
3
+ import { t as ModelLoader } from "../loader-BYyPIs9f.js";
4
+ import { Z as ItemPackEntry } from "../block-behaviour-9Tj_GIUC.js";
5
5
  //#region src/blocks/item-sprites.d.ts
6
6
  interface ItemSpriteFailure {
7
7
  id: string;
@@ -1,174 +1,2 @@
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 };
1
+ import { _ as extractBlockLight, a as Handle, c as LightExtraction, d as MemberReference, f as PropertyDomain, g as Value, h as StateProbe, l as LightGetter, m as Registration, o as LambdaValue, p as PropsCall, s as LightCodeSource, u as LightSpec } from "../block-behaviour-9Tj_GIUC.js";
2
+ export { Handle, LambdaValue, LightCodeSource, LightExtraction, LightGetter, LightSpec, MemberReference, PropertyDomain, PropsCall, Registration, StateProbe, Value, extractBlockLight };
@@ -1,2 +1,2 @@
1
- import { t as extractBlockLight } from "../light-bytecode-Cpyuxo9b.js";
1
+ import { t as extractBlockLight } from "../light-bytecode-DYxb6pJk.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-DMjK6xnb.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-9Tj_GIUC.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-CC3VMsjl.js";
2
2
  export { VANILLA_LIGHT, collectBlockLight, vanillaLightAt };
@@ -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 { A as BlockPackItemsFile, B as BlockPackTagsFile, C as BlockPackBlockState, D as BlockPackEntityModelsFile, E as BlockPackEntitiesFile, F as BlockPackModelsFile, G as EntityPackCubeFace, H as BlockPackVariant, I as BlockPackRenderLayer, J as EntityPackPart, K as EntityPackEntry, L as BlockPackSprite, M as BlockPackLightFile, N as BlockPackMetaFile, O as BlockPackFace, P as BlockPackModel, Q as ItemPackLayer, R as BlockPackSpriteFrame, S as BlockPackBiomesFile, T as BlockPackElement, U as EQUIPMENT_SLOTS, V as BlockPackTintsFile, W as EntityPackCube, X as EquipmentSlot, Y as EquipmentPack, Z as ItemPackEntry, b as BlockPackAtlasPage, j as BlockPackLight, k as BlockPackGameRulesFile, q as EntityPackModel, v as BlockPackAdvancementsFile, w as BlockPackBlockStatesFile, x as BlockPackBehaviourFile, y as BlockPackAtlasFile, z as BlockPackStatesFile } from "../block-behaviour-9Tj_GIUC.js";
2
+ export { BlockPackAdvancementsFile, BlockPackAtlasFile, BlockPackAtlasPage, BlockPackBehaviourFile, BlockPackBiomesFile, BlockPackBlockState, BlockPackBlockStatesFile, BlockPackElement, BlockPackEntitiesFile, BlockPackEntityModelsFile, BlockPackFace, BlockPackGameRulesFile, BlockPackItemsFile, BlockPackLight, BlockPackLightFile, BlockPackMetaFile, BlockPackModel, BlockPackModelsFile, 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 { I as BlockPackRenderLayer, L as BlockPackSprite } from "../block-behaviour-9Tj_GIUC.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 };
@@ -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-CbG2Rx3i.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-xBcMuKA3.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,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,5 +1,5 @@
1
- import { r as ExtractedModel } from "../model-PnQ4gV0-.js";
2
1
  import { t as ClassFile } from "../classfile-CsLXlh5z.js";
2
+ import { r as ExtractedModel } from "../model-PnQ4gV0-.js";
3
3
  import { t as ModelCode } from "../model-code-Csc3bs3h.js";
4
4
  //#region src/entities/inherit.d.ts
5
5
  interface Ancestry {
@@ -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
1
  import { t as ClassFile } from "../classfile-CsLXlh5z.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 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 { r as ExtractedModel } from "../model-PnQ4gV0-.js";
2
1
  import { t as ClassFile } from "../classfile-CsLXlh5z.js";
2
+ import { r as ExtractedModel } from "../model-PnQ4gV0-.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): {
@@ -4,7 +4,7 @@ import { t as EQUIPMENT_SLOTS } from "./pack-format-BP5dJMYY.js";
4
4
  import { n as extractModel, t as extractArmourMesh } from "./model-bytecode-VaLUQfGO.js";
5
5
  import { n as extractInheritedModel, t as ancestryOf } from "./inherit-BUn0Cve9.js";
6
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";
7
+ import { c as resolveMappings, t as MappingsUnavailableError } from "./mappings-DEl_7xxQ.js";
8
8
  import { n as loadModelCode } from "./model-code-DbN2uVhp.js";
9
9
  //#region src/blocks/entity-models.ts
10
10
  /**