@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
@@ -0,0 +1,673 @@
1
+ import { n as BiomeClimatePack } from "./biomes-CnnhDCnk.js";
2
+ import { a as BlockStateMultipartCase, o as BlockStateVariantCase } from "./blockstate-eval-BzznRcVY.js";
3
+ import { r as TagPack, t as AdvancementPack } from "./datapack-CmEg0Vko.js";
4
+ import { n as GameRulePack } from "./game-rules-ThvdDG3B.js";
5
+ import { t as NamePack } from "./names-D1abAVIB.js";
6
+ import { a as FaceDirectionName, l as Vec3, o as ModelElementJson, u as Vec4 } from "./types-qlp3I8_-.js";
7
+ import { t as MeshGroup } from "./obj-mesh-CzL0lOlJ.js";
8
+ import { n as BlockStatesPack } from "./states-OzneeCTU.js";
9
+ import { n as BlockTintPack } from "./tints-DwFmEkf3.js";
10
+ import { t as ClassFile } from "./classfile-Dzn0gW9M.js";
11
+ //#region src/blocks/pack-format.d.ts
12
+ /** How a sprite's alpha classifies it, inferred because assets rarely say. */
13
+ type BlockPackRenderLayer = 'solid' | 'cutout' | 'translucent';
14
+ interface BlockPackFace {
15
+ sprite: string;
16
+ /** [u1, v1, u2, v2] in 0–16 sprite space, derived when the model omits it. */
17
+ uv: Vec4;
18
+ rotation?: number;
19
+ tintindex?: number;
20
+ cullface?: FaceDirectionName;
21
+ }
22
+ interface BlockPackElement {
23
+ from: Vec3;
24
+ to: Vec3;
25
+ rotation?: ModelElementJson['rotation'];
26
+ shade?: false;
27
+ faces: Partial<Record<FaceDirectionName, BlockPackFace>>;
28
+ }
29
+ interface BlockPackModel {
30
+ ao: boolean;
31
+ elements: BlockPackElement[];
32
+ /**
33
+ * The model's `particle` texture. What the game throws when the block breaks
34
+ * or is walked on, and the only colour a consumer has to work with for a
35
+ * block that draws nothing — a placeholder cube for a chest comes out oak
36
+ * rather than magenta.
37
+ */
38
+ particle?: string;
39
+ /** Triangle geometry from an OBJ loader, when the model uses one. */
40
+ mesh?: MeshGroup[];
41
+ /**
42
+ * The layer the model states it draws on. Authoritative where present, and
43
+ * it beats the per-sprite alpha inference — the same sprite can be solid in
44
+ * one model and translucent in another.
45
+ */
46
+ renderType?: BlockPackRenderLayer;
47
+ /** Block offsets a split-multiblock mesh spans. */
48
+ multiblock?: Array<[number, number, number]>;
49
+ /**
50
+ * Present when the block is a fluid, whose real surface height and flow
51
+ * direction come from its neighbours and so cannot be baked. The cube here is
52
+ * a stand-in; these are the sheets to mesh the real thing with.
53
+ */
54
+ fluid?: {
55
+ still: string;
56
+ flow: string;
57
+ overlay?: string;
58
+ };
59
+ }
60
+ interface BlockPackSpriteFrame {
61
+ page: number;
62
+ x: number;
63
+ y: number;
64
+ /** Duration in game ticks. */
65
+ time: number;
66
+ }
67
+ interface BlockPackSprite {
68
+ page: number;
69
+ x: number;
70
+ y: number;
71
+ w: number;
72
+ h: number;
73
+ layer: BlockPackRenderLayer;
74
+ /** The displayed sequence, which can revisit a frame; absent when static. */
75
+ frames?: BlockPackSpriteFrame[];
76
+ interpolate?: true;
77
+ }
78
+ interface BlockPackAtlasPage {
79
+ file: string;
80
+ width: number;
81
+ height: number;
82
+ }
83
+ /** `atlas.json`. */
84
+ interface BlockPackAtlasFile {
85
+ /** Edge-extended border per sprite, in pixels. */
86
+ padding: number;
87
+ pages: BlockPackAtlasPage[];
88
+ sprites: Record<string, BlockPackSprite>;
89
+ }
90
+ /** `models.json`, by fully-qualified model id. */
91
+ type BlockPackModelsFile = Record<string, BlockPackModel>;
92
+ /** `blockstates.json`, by block id, with keys and predicates already parsed. */
93
+ type BlockPackBlockStatesFile = Record<string, BlockPackBlockState>;
94
+ /**
95
+ * A variant as the pack writes it. Every rotation is optional because the emit
96
+ * drops each one at its default, which is most of them.
97
+ */
98
+ interface BlockPackVariant {
99
+ model: string;
100
+ x?: number;
101
+ y?: number;
102
+ z?: number;
103
+ uvlock?: true;
104
+ weight?: number;
105
+ }
106
+ /**
107
+ * One block's cases as the pack writes them: what `evaluateBlockState` takes,
108
+ * flattened to the key the file uses. Pass it as
109
+ * `{ kind: 'variants', cases: state.variants }` and the models come back as
110
+ * `BlockPackVariant`, no cast in either direction.
111
+ */
112
+ type BlockPackBlockState = {
113
+ variants: Array<BlockStateVariantCase<BlockPackVariant>>;
114
+ multipart?: undefined;
115
+ } | {
116
+ multipart: Array<BlockStateMultipartCase<BlockPackVariant>>;
117
+ variants?: undefined;
118
+ };
119
+ /** `tints.json`. */
120
+ type BlockPackTintsFile = BlockTintPack;
121
+ /**
122
+ * How much light a block emits, 0–15.
123
+ *
124
+ * A number when every state of the block emits the same. Otherwise the commonest level is `default`
125
+ * and each other level is a case naming only the properties that decide it: a redstone lamp is
126
+ * `{ default: 0, cases: [{ when: { lit: 'true' }, level: 15 }] }`. The first case whose every
127
+ * property matches the state applies; `blockLightLevel` in `light-eval.ts` does that lookup.
128
+ */
129
+ type BlockPackLight = number | {
130
+ default: number;
131
+ cases: Array<{
132
+ when: Record<string, string>;
133
+ level: number;
134
+ }>;
135
+ };
136
+ /**
137
+ * `light.json`, by block id, holding only the blocks that emit: absent means 0. Present only when the
138
+ * pack has emitters and the export could read the code for them — an `--assets` run has none.
139
+ */
140
+ type BlockPackLightFile = Record<string, BlockPackLight>;
141
+ /**
142
+ * `behaviour.json`, by block id: hardness, collision, replaceability, map colour and the rest of what
143
+ * the block's `Properties` builder chain states. Read from the code, like `light.json`, so absent
144
+ * from an `--assets` run and from 1.13, whose builder calls have no names without mappings.
145
+ */
146
+ type BlockPackBehaviourFile = Record<string, BlockBehaviour>;
147
+ /**
148
+ * `biomes.json`, present only when the pack has biomes to describe: vanilla's
149
+ * whole table, or the ones a mod's datapack declares. Absent is not empty — a
150
+ * consumer with no file falls back to tinting at `tints.json`'s flat climate.
151
+ */
152
+ type BlockPackBiomesFile = BiomeClimatePack;
153
+ /**
154
+ * `tags.json`: registry → tag id → values, exactly as the version's datapack states them. Unexpanded,
155
+ * so a value starting `#` names another tag in the same registry. Registries are keyed by their 1.21+
156
+ * singular folder name (`block`, `item`, `entity_type`, `worldgen/biome`) at every version.
157
+ */
158
+ type BlockPackTagsFile = TagPack;
159
+ /** `advancements.json`: advancement id → its criteria names, recipe unlocks left out. */
160
+ type BlockPackAdvancementsFile = AdvancementPack;
161
+ /**
162
+ * `states.json`: every block's properties, values in the game's order, and its default state. Present
163
+ * only when the export was given the version's data generator reports.
164
+ */
165
+ type BlockPackStatesFile = BlockStatesPack;
166
+ /**
167
+ * `game-rules.json`: every rule the version registers, by the name `level.dat` stores it under
168
+ * (camelCase before 26.x, snake_case from it), with its type and default. Vanilla packs only.
169
+ */
170
+ type BlockPackGameRulesFile = GameRulePack;
171
+ /** `names.json`: English display names by id, for blocks and items, from each namespace's `en_us`. */
172
+ type BlockPackNamesFile = NamePack;
173
+ /** One flat sprite of an item's layer stack, in the order the client draws them. */
174
+ interface ItemPackLayer {
175
+ sprite: string;
176
+ /**
177
+ * Present when the item declares a tint at this layer, which is the client's own
178
+ * rule: `ItemModelGenerator` passes each layer its own index as the tint index.
179
+ */
180
+ tintindex?: number;
181
+ /**
182
+ * The colour that tint resolves to in an item's default state, `#rrggbb`.
183
+ *
184
+ * Absent where it cannot be known from assets — a dyed leather boot or a potion
185
+ * takes its colour from the stack's components, which no pack can carry. A
186
+ * consumer drawing an absent tint untinted gets the mod's own artwork, which is
187
+ * the same thing the icon renderer settles for.
188
+ */
189
+ tint?: string;
190
+ }
191
+ /** One flat item: everything there is to say about how the game draws it. */
192
+ interface ItemPackEntry {
193
+ layers: ItemPackLayer[];
194
+ }
195
+ /**
196
+ * `items.json`. Self-contained rather than sharing `atlas.json`'s pages, so a
197
+ * consumer that only draws blocks never fetches the item sheet at all — a world
198
+ * viewer needs it only once it finds a dropped stack of something that is not a
199
+ * block.
200
+ *
201
+ * Holds *only* items whose model is a flat sprite stack. An item absent from
202
+ * `items` either draws from `blockstates.json` under the same id, or is in
203
+ * `failures.json` saying why nothing can draw it.
204
+ */
205
+ interface BlockPackItemsFile {
206
+ /** Edge-extended border per sprite, in pixels. */
207
+ padding: number;
208
+ pages: BlockPackAtlasPage[];
209
+ sprites: Record<string, BlockPackSprite>;
210
+ items: Record<string, ItemPackEntry>;
211
+ }
212
+ /**
213
+ * One entity type: what to call it, and what colour it is.
214
+ *
215
+ * No geometry, because no jar has any — entity models are Java code at every version. What a consumer
216
+ * can do with this is name the stand-in box it draws and tint it like the animal, which is the
217
+ * difference between a field of arbitrary colours and a readable one.
218
+ */
219
+ interface EntityPackEntry {
220
+ /** English display name, from the jar's own lang file. */
221
+ name: string;
222
+ /**
223
+ * Mean colour of the opaque pixels of the entity's sheet, `#rrggbb`.
224
+ *
225
+ * Absent for everything that is not a mob — an item entity, a falling block, a marker, a display,
226
+ * a thrown projectile — because those draw from an item or a block and have no sheet of their own.
227
+ * None is invented for them.
228
+ */
229
+ color?: string;
230
+ /**
231
+ * The sheet the colour came from, and what the model's `uv` values address. A sprite id in
232
+ * `entity-models.json`'s atlas once that file is present.
233
+ */
234
+ texture?: string;
235
+ /** Key into `entity-models.json`'s `models`, when geometry was recovered for this entity. */
236
+ model?: string;
237
+ /**
238
+ * Hitbox in blocks, as `EntityType.Builder.sized` states it: the base size, before a baby or a big
239
+ * slime scales its own. Absent where no code was read (an `--assets` run, 1.13).
240
+ */
241
+ width?: number;
242
+ height?: number;
243
+ }
244
+ /**
245
+ * `entities.json`, by entity id. The registry read off the lang file, which is the closest thing a jar
246
+ * carries to it. Absent from a pack whose namespaces register no entities.
247
+ */
248
+ type BlockPackEntitiesFile = Record<string, EntityPackEntry>;
249
+ /** One box of a part, in the model's own space, exactly as the game's own builder stated it. */
250
+ /** The six faces a box can carry its own texture rect on. */
251
+ type EntityPackCubeFace = 'north' | 'south' | 'east' | 'west' | 'up' | 'down';
252
+ interface EntityPackCube {
253
+ /** Minimum corner. */
254
+ origin: Vec3;
255
+ size: Vec3;
256
+ /** Texture offset in pixels on the entity's own sheet, as `texOffs` set it. */
257
+ uv: [number, number];
258
+ /** Grows the box on every side; `CubeDeformation`, or a builder's `delta`. */
259
+ inflate?: number;
260
+ mirror?: true;
261
+ /**
262
+ * Per-face texture rects, which replace the box unwrap `uv` implies wherever they are present.
263
+ *
264
+ * Java has no such thing, since `addBox` always unwraps the same way, but bedrock geometry does and
265
+ * leans on it: 56% of the cubes across four GeckoLib mods state their faces individually. A consumer
266
+ * that ignores this draws over half of every such mob from the wrong part of its sheet.
267
+ */
268
+ faces?: Partial<Record<EntityPackCubeFace, {
269
+ uv: [number, number];
270
+ size: [number, number];
271
+ }>>;
272
+ }
273
+ /** One bone: where it pivots, what it is made of, and what hangs off it. */
274
+ interface EntityPackPart {
275
+ name: string;
276
+ /** Pivot relative to the parent bone. */
277
+ pivot: Vec3;
278
+ /** Radians about x, y, z, as `PartPose.offsetAndRotation` states them. */
279
+ rotation: Vec3;
280
+ cubes: EntityPackCube[];
281
+ children: EntityPackPart[];
282
+ }
283
+ /**
284
+ * One entity model: a bone hierarchy of boxes, recovered from the client's own code.
285
+ *
286
+ * `textureSize` is the sheet the `uv` values are in, which is *not* the atlas page — a consumer maps
287
+ * `uv` through it into the sprite's rect, exactly as it does for a block face.
288
+ *
289
+ * **Prefer the sprite's own `w`/`h` where the entity has one**, and keep this as the fallback. One
290
+ * model can be drawn on two differently sized sheets: from 1.21.4 a boat and a chest boat are both a
291
+ * `BoatModel`, on a 128x64 and a 128x128 sheet respectively, so no single value here is right for both.
292
+ */
293
+ interface EntityPackModel {
294
+ textureSize: [number, number];
295
+ parts: EntityPackPart[];
296
+ /** Anything the extraction had to skip or assume, so a consumer can distrust it knowingly. */
297
+ notes?: string[];
298
+ }
299
+ /**
300
+ * `entity-models.json`. Self-contained like `items.json`, with its own atlas of entity sheets, so a
301
+ * consumer that never draws a mob does not fetch any of it.
302
+ *
303
+ * `models` is keyed by the class the geometry came from, and `entities.json`'s `model` points at it —
304
+ * several entities share one model (every zombie is a `HumanoidModel`), and keying by class is what
305
+ * makes that one entry rather than twenty copies.
306
+ */
307
+ interface BlockPackEntityModelsFile {
308
+ padding: number;
309
+ pages: BlockPackAtlasPage[];
310
+ sprites: Record<string, BlockPackSprite>;
311
+ models: Record<string, EntityPackModel>;
312
+ /** Worn armour, when the version's classes described any. Absent otherwise. */
313
+ equipment?: EquipmentPack;
314
+ }
315
+ /** The armour slots the game dresses a humanoid in, in the order it layers them. */
316
+ declare const EQUIPMENT_SLOTS: readonly ["feet", "legs", "chest", "head"];
317
+ type EquipmentSlot = typeof EQUIPMENT_SLOTS[number];
318
+ /**
319
+ * Worn armour: one humanoid-shaped mesh, the two sizes it is drawn at, and a sheet per material.
320
+ *
321
+ * Armour is not geometry of its own — it is the wearer's own humanoid shape grown by a fixed amount,
322
+ * which is why one mesh dresses a player, a zombie and an armour stand alike. The leggings are the
323
+ * *inner* layer and everything else the *outer*, drawn a little larger so the two never fight.
324
+ *
325
+ * Everything a consumer needs to decide what to draw is stated here rather than derived, in keeping
326
+ * with the rest of the pack: which parts a slot lights up, which sheet a material uses, and which
327
+ * material an item is made of.
328
+ */
329
+ interface EquipmentPack {
330
+ /** Key into `models`, holding the humanoid armour shape. */
331
+ model: string;
332
+ /** How much each layer grows the wearer's boxes by, in pixels. */
333
+ inflate: {
334
+ inner: number;
335
+ outer: number;
336
+ };
337
+ /** Parts each slot shows. A slot lights up some of the one mesh rather than owning geometry. */
338
+ slots: Record<EquipmentSlot, string[]>;
339
+ /** Which layer a slot is drawn on, which decides the sheet as well as the size. */
340
+ layerOf: Record<EquipmentSlot, 'inner' | 'outer'>;
341
+ /** Sprite ids per material and layer, into this file's own `sprites`. */
342
+ materials: Record<string, Partial<Record<'inner' | 'outer', string>>>;
343
+ /**
344
+ * The armour items themselves. Keyed by item id because that is what a world writes into an
345
+ * entity's `equipment` compound, and nothing in the assets maps one to the other.
346
+ */
347
+ items: Record<string, {
348
+ material: string;
349
+ slot: EquipmentSlot;
350
+ }>;
351
+ /** Materials whose sheet is greyscale and takes the item's own dye colour. */
352
+ dyeable: string[];
353
+ /** The colour a dyeable material takes when nothing dyed it, read from the game's own constant. */
354
+ undyed?: Record<string, string>;
355
+ /** Worn armour-trim sheets generated from the version's armour-trim atlas. */
356
+ trims: {
357
+ /** Sprite ids per pattern and material, into this file's own `sprites`. */
358
+ patterns: Record<string, Record<string, Partial<Record<'inner' | 'outer', string>>>>;
359
+ /** Material a trim falls back to when it matches the armour it is on. */
360
+ darker: Record<string, string>;
361
+ };
362
+ }
363
+ /** `meta.json`, written last because it hashes every other file. */
364
+ interface BlockPackMetaFile {
365
+ generator: string;
366
+ version: string;
367
+ namespaces: string[];
368
+ counts: {
369
+ blocks: number;
370
+ models: number;
371
+ sprites: number;
372
+ pages: number;
373
+ /** Biomes in `biomes.json`; `0` means the pack has none and the file is absent. */
374
+ biomes: number;
375
+ /** Flat items in `items.json`; `0` means the pack has none and the file is absent. */
376
+ items: number;
377
+ /** Entity types in `entities.json`; `0` means the pack has none and the file is absent. */
378
+ entities: number;
379
+ /** Distinct entity models in `entity-models.json`; `0` means the file is absent. */
380
+ entityModels: number;
381
+ /** Emitting blocks in `light.json`; `0` means the file is absent. */
382
+ light: number;
383
+ /** Blocks in `behaviour.json`; `0` means the file is absent. */
384
+ behaviour: number;
385
+ /** Tags across every registry in `tags.json`; `0` means the file is absent. */
386
+ tags: number;
387
+ /** Advancements in `advancements.json`; `0` means the file is absent. */
388
+ advancements: number;
389
+ /** Blocks in `states.json`; `0` means the file is absent. */
390
+ states: number;
391
+ /** Rules in `game-rules.json`; `0` means the file is absent. */
392
+ gameRules: number;
393
+ /** Block and item names in `names.json`; `0` means the file is absent. */
394
+ names: number;
395
+ failures: number;
396
+ };
397
+ /** sha256 per file, enough to verify a cached copy without refetching it. */
398
+ hashes: Record<string, string>;
399
+ }
400
+ //#endregion
401
+ //#region src/blocks/light-bytecode.d.ts
402
+ /** A member reference as the constant pool spells it. */
403
+ interface MemberReference {
404
+ owner: string;
405
+ name: string;
406
+ descriptor: string;
407
+ }
408
+ /** What the caller supplies: how to find code, and how to rename a reference before looking. */
409
+ interface LightCodeSource {
410
+ /** The parsed class, or null for anything outside the jars (the JDK, a loader). */
411
+ resolve: (internalName: string) => ClassFile | null;
412
+ /**
413
+ * A reference as the jar spells it. A mod names the game's classes and members by their original
414
+ * names; against an obfuscated client those have to be renamed before they can be found.
415
+ */
416
+ remap: (reference: MemberReference, field: boolean) => MemberReference;
417
+ remapClass: (internalName: string) => string;
418
+ /**
419
+ * A member's original name, for reading the game's own obfuscated calls: `eea$d.a(FF)` is `strength`.
420
+ * Absent, or answering the name it was given, where the jar already speaks original names.
421
+ */
422
+ nameOf?: (reference: MemberReference, field: boolean) => string;
423
+ /** Classes that are a block `Properties` builder, in every spelling the jars use. */
424
+ propsClasses: ReadonlySet<string>;
425
+ /**
426
+ * Whether a class is the game's rather than a mod's. A mod export runs the game's own `Blocks` too,
427
+ * for the properties mods copy, and its registrations must not answer for a mod block that happens
428
+ * to share a name — `immersiveengineering:lantern` is not `minecraft:lantern`.
429
+ */
430
+ isVanillaClass: (internalName: string) => boolean;
431
+ /**
432
+ * Methods a block class may override to answer its own light: the game's `getLightValue(state)`
433
+ * before 1.16, when a lit furnace was an override rather than a lambda, and a loader's
434
+ * `getLightEmission(state, level, pos)`. `root` is the class whose implementation is the plain
435
+ * property read, so a call resolving there — `super.getLightValue(state)` — is answered from the
436
+ * block's `Properties`.
437
+ */
438
+ lightGetters: ReadonlyArray<LightGetter>;
439
+ }
440
+ interface LightGetter {
441
+ name: string;
442
+ /** Empty to match by name alone: a loader method whose parameter types the jar does not spell. */
443
+ descriptor: string;
444
+ root: string | null;
445
+ }
446
+ /** How a block's light is stated, before it is evaluated. */
447
+ type LightSpec = {
448
+ kind: 'constant';
449
+ level: number;
450
+ } |
451
+ /** A `ToIntFunction<BlockState>`, to be run per state. */
452
+ {
453
+ kind: 'function';
454
+ fn: LambdaValue;
455
+ } |
456
+ /** A block class's own light method: a 1.13–1.15 `getLightValue` override, or a loader's `getLightEmission`. */
457
+ {
458
+ kind: 'method';
459
+ owner: string;
460
+ getter: LightGetter;
461
+ receiver: Handle | null;
462
+ } |
463
+ /** A light function the interpreter could not identify — one built from a value it never saw. */
464
+ {
465
+ kind: 'opaque';
466
+ reason: string;
467
+ };
468
+ interface PropsCall {
469
+ name: string;
470
+ descriptor: string;
471
+ args: Value[];
472
+ }
473
+ interface Handle {
474
+ id: number;
475
+ /** Internal class name, from `new` or the declared return type of the opaque call that made it. */
476
+ type: string | null;
477
+ /** Strings that flowed into this object: the name a registration key or a property was made from. */
478
+ strings: string[];
479
+ numbers: number[];
480
+ /** Class literals that flowed in: the value class of an enum property. */
481
+ classes: string[];
482
+ fields: Map<string, Value>;
483
+ isProps: boolean;
484
+ light: LightSpec | null;
485
+ /** For a `Properties`: every builder call made on it, by its mapped name, for `block-behaviour.ts` to read. */
486
+ calls?: PropsCall[];
487
+ /** For a `Properties` made by copying a block's: the properties it copied, whose calls come first. */
488
+ copyOf?: Handle | null;
489
+ /** For a block: the `Properties` it was constructed with. */
490
+ props: Handle | null;
491
+ ctorArgs: Value[] | null;
492
+ /** `StringBuilder` parts, for the pre-Java 9 way of building a name. */
493
+ builder?: Array<string | number>;
494
+ origin?: string;
495
+ /** Entries of a map the code filled, for a lookup table of properties by direction. */
496
+ map?: Array<{
497
+ key: Value;
498
+ value: Value;
499
+ }>;
500
+ /** Elements of a list or set the code filled, for a table of names a mod registers in a loop. */
501
+ items?: Value[];
502
+ /** An iterator over a list: what it walks and where it is. */
503
+ iterator?: {
504
+ items: Value[];
505
+ at: number;
506
+ };
507
+ }
508
+ interface LambdaValue {
509
+ kind: 'lambda';
510
+ owner: string;
511
+ name: string;
512
+ descriptor: string;
513
+ captured: Value[];
514
+ }
515
+ /** A `BlockState` during evaluation of a light function: a bag of property values being read. */
516
+ interface StateProbe {
517
+ values: Map<string, string>;
518
+ domains: Map<string, PropertyDomain>;
519
+ reads: Set<string>;
520
+ failure: string | null;
521
+ }
522
+ interface PropertyDomain {
523
+ name: string;
524
+ values: string[];
525
+ /** The enum constant per serialized value, for a property whose values are an enum. */
526
+ constants?: Map<string, Handle>;
527
+ }
528
+ type Value = LambdaValue | {
529
+ kind: 'number';
530
+ value: number;
531
+ wide?: boolean;
532
+ } | {
533
+ kind: 'string';
534
+ value: string;
535
+ } | {
536
+ kind: 'object';
537
+ handle: Handle;
538
+ } | {
539
+ kind: 'array';
540
+ items: Value[];
541
+ } | {
542
+ kind: 'class';
543
+ name: string;
544
+ } | {
545
+ kind: 'null';
546
+ } | {
547
+ kind: 'state';
548
+ probe: StateProbe;
549
+ } | {
550
+ kind: 'unknown';
551
+ };
552
+ /** One registration this found: which `Properties` a name was registered with, and the block if seen. */
553
+ interface Registration {
554
+ props: Handle | null;
555
+ block: Handle | null;
556
+ /** The block's class, when a factory method reference named it. */
557
+ blockType: string | null;
558
+ /** The call that registered it, for a person chasing a wrong answer. */
559
+ site: string;
560
+ /** Made by the game's own code, which a mod's block of the same bare name must not inherit. */
561
+ vanilla: boolean;
562
+ }
563
+ /** What one run over a set of registry classes found. */
564
+ interface LightExtraction {
565
+ registrations: Map<string, Registration>;
566
+ notes: string[];
567
+ /** The light a block emits, or why it could not be worked out. */
568
+ lightOf: (blockId: string) => {
569
+ light: BlockPackLight;
570
+ } | {
571
+ failure: string;
572
+ };
573
+ /** The registration the code made for a block, under its full id or its own side's bare path. */
574
+ registrationOf: (blockId: string) => Registration | null;
575
+ /**
576
+ * Runs a function of a block state once per combination of the properties it reads, folded like
577
+ * light: a number when every state agrees, a default and cases otherwise. `read` turns what the
578
+ * function returned into a number, or null when it is not one this can use.
579
+ */
580
+ tabulate: (fn: LambdaValue, read: (value: Value) => number | null) => {
581
+ value: BlockPackLight;
582
+ } | {
583
+ failure: string;
584
+ };
585
+ /** The same, for a method a block's class declares, run on the block its registration made. */
586
+ tabulateMethod: (registration: Registration, method: MemberReference, read: (value: Value) => number | null) => {
587
+ value: BlockPackLight;
588
+ } | {
589
+ failure: string;
590
+ };
591
+ /** What was recorded for a block, for a person chasing a failure. */
592
+ describe: (blockId: string) => string;
593
+ }
594
+ /**
595
+ * Runs the registry code of a set of classes and answers, per block, what it emits.
596
+ *
597
+ * `roots` are the classes whose methods register blocks; every method of each is run, because where
598
+ * the registrations sit differs by era and mod — `<clinit>` for a modern registry, a static
599
+ * `registerBlocks()` in 1.13, an instance `init()` in a mod. The order is `<clinit>` first, since the
600
+ * others read what it set up.
601
+ */
602
+ declare function extractBlockLight(roots: readonly ClassFile[], source: LightCodeSource): LightExtraction;
603
+ //#endregion
604
+ //#region src/blocks/block-behaviour.d.ts
605
+ /** How pistons treat a block; absent means `normal`, pushed and pulled like stone. */
606
+ type PushReactionName = 'destroy' | 'block' | 'ignore' | 'push_only';
607
+ interface BlockBehaviour {
608
+ /** Seconds-ish to mine by hand, as `destroyTime`; `-1` is unbreakable. */
609
+ hardness: number;
610
+ /** Explosion resistance. */
611
+ resistance: number;
612
+ /**
613
+ * Map colour id (0–63, 0 draws nothing). A number, or per-state cases in the shape `light.json`
614
+ * uses: a log is one colour on its end grain and another on its bark.
615
+ */
616
+ mapColor?: BlockPackLight;
617
+ /** Entities walk through it: grass, flowers, torches. */
618
+ collision?: false;
619
+ /** It hides nothing behind it: glass, leaves, anything `noOcclusion()`. */
620
+ occludes?: false;
621
+ /** A placed block or a growing tree takes its place without breaking it. */
622
+ replaceable?: true;
623
+ air?: true;
624
+ liquid?: true;
625
+ /** Lava sets it alight (`ignitedByLava`, or a flammable `Material` before 1.20). */
626
+ flammable?: true;
627
+ pushReaction?: PushReactionName;
628
+ /** Drops nothing unless mined with the right tool. */
629
+ requiresTool?: true;
630
+ randomTicks?: true;
631
+ friction?: number;
632
+ speedFactor?: number;
633
+ jumpFactor?: number;
634
+ /**
635
+ * The block's shape decides how light crosses its faces (`useShapeForLightOcclusion`): stairs,
636
+ * slabs, snow layers. `true` in every state, or cases of 1 where a state does (a double slab does not).
637
+ */
638
+ lightShape?: true | Exclude<BlockPackLight, number>;
639
+ /**
640
+ * Light lost passing through the block, where its class answers for itself (`getLightBlock`): 15
641
+ * for tinted glass, whose faces are see-through. Absent means the game's default rule.
642
+ */
643
+ lightBlock?: BlockPackLight;
644
+ /** The fluid the block holds in every state, as kelp and seagrass are always under water. */
645
+ fluid?: 'water' | 'lava';
646
+ /**
647
+ * The block model renderer draws nothing for it (`RenderShape.INVISIBLE`): a barrier, a light block, a
648
+ * structure void, and the blocks something else draws, a fluid or an end portal.
649
+ */
650
+ invisible?: true;
651
+ /**
652
+ * Its class decides whether a face against a neighbour draws (`skipRendering`): glass hides the faces
653
+ * it shares with glass, although its texture reads as plain cutout.
654
+ */
655
+ hidesSharedFaces?: true;
656
+ }
657
+ /**
658
+ * The colour a block's `Properties` state: a `mapColor` call, the colour a pre-1.20 `Properties` was
659
+ * constructed with, or its `Material`'s, latest first. A constant or a function of state.
660
+ */
661
+ declare function statedMapColor(props: Handle): Value | undefined;
662
+ declare function blockBehaviour(registration: Registration, extraction: Pick<LightExtraction, 'tabulate' | 'tabulateMethod'>,
663
+ /** The block's class's overrides, if it can be read: see `block-overrides.ts`. */
664
+ overrides?: {
665
+ of: (names: readonly string[]) => MemberReference | null;
666
+ fluid: (method: MemberReference) => 'water' | 'lava' | null;
667
+ invisible: (method: MemberReference) => boolean;
668
+ } | null): {
669
+ behaviour: BlockBehaviour;
670
+ failures: string[];
671
+ } | null;
672
+ //#endregion
673
+ export { ItemPackLayer as $, BlockPackItemsFile as A, BlockPackStatesFile as B, BlockPackBlockState as C, BlockPackEntityModelsFile as D, BlockPackEntitiesFile as E, BlockPackModelsFile as F, EntityPackCube as G, BlockPackTintsFile as H, BlockPackNamesFile as I, EntityPackModel as J, EntityPackCubeFace as K, BlockPackRenderLayer as L, BlockPackLightFile as M, BlockPackMetaFile as N, BlockPackFace as O, BlockPackModel as P, ItemPackEntry as Q, BlockPackSprite as R, BlockPackBiomesFile as S, BlockPackElement as T, BlockPackVariant as U, BlockPackTagsFile as V, EQUIPMENT_SLOTS as W, EquipmentPack as X, EntityPackPart as Y, EquipmentSlot as Z, extractBlockLight as _, Handle as a, BlockPackAtlasPage as b, LightExtraction as c, MemberReference as d, PropertyDomain as f, Value as g, StateProbe as h, statedMapColor as i, BlockPackLight as j, BlockPackGameRulesFile as k, LightGetter as l, Registration as m, PushReactionName as n, LambdaValue as o, PropsCall as p, EntityPackEntry as q, blockBehaviour as r, LightCodeSource as s, BlockBehaviour as t, LightSpec as u, BlockPackAdvancementsFile as v, BlockPackBlockStatesFile as w, BlockPackBehaviourFile as x, BlockPackAtlasFile as y, BlockPackSpriteFrame as z };