@nodecraft/rendermite 1.8.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/README.md +9 -1
  2. package/dist/atlas/registry.d.ts +3 -3
  3. package/dist/atlas/sources.d.ts +1 -1
  4. package/dist/{atlas-pack-C56gzqAg.d.ts → atlas-pack-BUadroKy.d.ts} +1 -1
  5. package/dist/biomes-BGOF6gRM.js +1100 -0
  6. package/dist/biomes-CnnhDCnk.d.ts +59 -0
  7. package/dist/{blend-C5UYzink.d.ts → blend-mJAeQB3C.d.ts} +1 -1
  8. package/dist/block-behaviour-BBslelpW.d.ts +673 -0
  9. package/dist/block-behaviour-DVjqeSkv.js +180 -0
  10. package/dist/block-overrides-XtxICunI.js +77 -0
  11. package/dist/blocks/atlas-pack.d.ts +1 -1
  12. package/dist/blocks/biomes.d.ts +2 -2
  13. package/dist/blocks/biomes.js +2 -2
  14. package/dist/blocks/block-behaviour.d.ts +2 -0
  15. package/dist/blocks/block-behaviour.js +2 -0
  16. package/dist/blocks/block-entities.d.ts +3 -3
  17. package/dist/blocks/block-overrides.d.ts +26 -0
  18. package/dist/blocks/block-overrides.js +2 -0
  19. package/dist/blocks/cli.js +1 -1
  20. package/dist/blocks/datapack.d.ts +2 -0
  21. package/dist/blocks/datapack.js +2 -0
  22. package/dist/blocks/ender-storage.d.ts +2 -2
  23. package/dist/blocks/entities.d.ts +3 -3
  24. package/dist/blocks/entity-geo.d.ts +1 -1
  25. package/dist/blocks/entity-models.d.ts +4 -13
  26. package/dist/blocks/entity-models.js +1 -1
  27. package/dist/blocks/entity-sizes.d.ts +25 -0
  28. package/dist/blocks/entity-sizes.js +2 -0
  29. package/dist/blocks/export.d.ts +1 -1
  30. package/dist/blocks/export.js +1 -1
  31. package/dist/blocks/game-rules.d.ts +2 -0
  32. package/dist/blocks/game-rules.js +2 -0
  33. package/dist/blocks/geo-blocks.d.ts +2 -2
  34. package/dist/blocks/item-sprites.d.ts +4 -4
  35. package/dist/blocks/light-bytecode.d.ts +2 -174
  36. package/dist/blocks/light-bytecode.js +1 -1
  37. package/dist/blocks/light-eval.d.ts +1 -1
  38. package/dist/blocks/light.d.ts +11 -1
  39. package/dist/blocks/light.js +1 -1
  40. package/dist/blocks/names.d.ts +2 -0
  41. package/dist/blocks/names.js +2 -0
  42. package/dist/blocks/obj-mesh.d.ts +1 -1
  43. package/dist/blocks/pack-format.d.ts +2 -2
  44. package/dist/blocks/sprite-sheet.d.ts +3 -3
  45. package/dist/blocks/states.d.ts +2 -0
  46. package/dist/blocks/states.js +2 -0
  47. package/dist/blocks/tints.d.ts +1 -1
  48. package/dist/{classfile-CiIDF3vc.js → classfile-BJSs3JH0.js} +23 -3
  49. package/dist/{classfile-CsLXlh5z.d.ts → classfile-Dzn0gW9M.d.ts} +6 -0
  50. package/dist/{cli-Dw1Q5CPR.js → cli-DwMPoX0I.js} +10 -5
  51. package/dist/cli.js +7 -7
  52. package/dist/datapack-CmEg0Vko.d.ts +15 -0
  53. package/dist/datapack-D6eH46ay.js +71 -0
  54. package/dist/{descriptor-CmkIkDKL.js → descriptor-Dz2cR-BH.js} +2 -2
  55. package/dist/{discovery-Cmir3QfC.d.ts → discovery-DWe_kX8W.d.ts} +1 -1
  56. package/dist/dynamic/generators.d.ts +1 -1
  57. package/dist/{encode-Br_vPrd8.d.ts → encode-BNEYHHR0.d.ts} +1 -1
  58. package/dist/entities/classfile.d.ts +1 -1
  59. package/dist/entities/classfile.js +1 -1
  60. package/dist/entities/geo-model.d.ts +1 -1
  61. package/dist/entities/inherit.d.ts +2 -2
  62. package/dist/entities/inherit.js +1 -1
  63. package/dist/entities/jar-classes.js +1 -1
  64. package/dist/entities/link.d.ts +2 -2
  65. package/dist/entities/link.js +1 -1
  66. package/dist/entities/mappings.d.ts +1 -1
  67. package/dist/entities/mappings.js +1 -1
  68. package/dist/entities/model-bytecode.d.ts +1 -1
  69. package/dist/entities/model-bytecode.js +1 -1
  70. package/dist/entities/model-code.d.ts +1 -1
  71. package/dist/entities/model-code.js +1 -1
  72. package/dist/{entity-models-BGiy3pey.js → entity-models-vFl_EwfA.js} +24 -5
  73. package/dist/entity-sizes-DspxgSUA.js +194 -0
  74. package/dist/{export-t8X_oRws.js → export-ArMmWuCC.js} +62 -5
  75. package/dist/{export-J13L9Lqu.d.ts → export-CqeTinYL.d.ts} +19 -2
  76. package/dist/{face-DqEd9G_U.d.ts → face-uWXECGNr.d.ts} +2 -2
  77. package/dist/game-rules-BDPTopVW.js +104 -0
  78. package/dist/game-rules-ThvdDG3B.d.ts +16 -0
  79. package/dist/{generators-BnIzAftW.d.ts → generators-hu_vk10m.d.ts} +1 -1
  80. package/dist/{geo-C9QYeLVN.d.ts → geo-DsWwuC5o.d.ts} +4 -4
  81. package/dist/index.d.ts +20 -20
  82. package/dist/index.js +8 -8
  83. package/dist/{inherit-BUn0Cve9.js → inherit-DJ45bOB_.js} +2 -2
  84. package/dist/items/blockstate.d.ts +1 -1
  85. package/dist/items/discovery.d.ts +1 -1
  86. package/dist/{jar-B5iRZQeL.d.ts → jar-4Jg7ufWK.d.ts} +1 -1
  87. package/dist/{jar-CBYPMbw7.js → jar-DvofBm71.js} +2 -2
  88. package/dist/{jar-classes-CSm7qq1R.js → jar-classes-0wqWbTax.js} +2 -2
  89. package/dist/{light-CyRhYulM.js → light-CZRA1pOj.js} +48 -6
  90. package/dist/{light-bytecode-Cpyuxo9b.js → light-bytecode-BqpQWqP7.js} +144 -46
  91. package/dist/{light-eval-D9x0ufZx.d.ts → light-eval-C0-kt0bp.d.ts} +1 -1
  92. package/dist/{link-Cuhyrz07.js → link-IDjVJ2Ij.js} +1 -1
  93. package/dist/{loader-DSir1-P0.d.ts → loader-BYyPIs9f.d.ts} +1 -1
  94. package/dist/{loader-59_eMa8e.d.ts → loader-C4gsX_wO.d.ts} +1 -1
  95. package/dist/{manager-exOIcdyx.d.ts → manager-Ct0dEOMg.d.ts} +6 -0
  96. package/dist/{manager-BNibYkmI.js → manager-D6zXmFrO.js} +6 -0
  97. package/dist/{mappings-Ep6ko0rg.js → mappings-DEl_7xxQ.js} +18 -1
  98. package/dist/{mappings-USwcjtcH.d.ts → mappings-DhOPQTgV.d.ts} +5 -0
  99. package/dist/{model-bytecode-VaLUQfGO.js → model-bytecode-CXYAZ5dX.js} +1 -1
  100. package/dist/{model-code-Csc3bs3h.d.ts → model-code-BclYt1do.d.ts} +1 -1
  101. package/dist/{model-code-DbN2uVhp.js → model-code-BmA5ilgt.js} +1 -1
  102. package/dist/models/loader.d.ts +1 -1
  103. package/dist/{models-CZjCOjs4.js → models-BsYA-NZg.js} +1 -1
  104. package/dist/mods/models.d.ts +1 -1
  105. package/dist/mods/models.js +1 -1
  106. package/dist/mods/prepare.d.ts +1 -1
  107. package/dist/mods/prepare.js +1 -1
  108. package/dist/mods/synthesize.d.ts +2 -2
  109. package/dist/mods/tints.d.ts +2 -2
  110. package/dist/mods/tints.js +1 -1
  111. package/dist/names-D1abAVIB.d.ts +10 -0
  112. package/dist/names-GLa5TyL7.js +36 -0
  113. package/dist/{obj-mesh-ydhVfLKs.d.ts → obj-mesh-CzL0lOlJ.d.ts} +2 -2
  114. package/dist/output/encode.d.ts +1 -1
  115. package/dist/pack.d.ts +7 -6
  116. package/dist/{pipeline-DFuQa8ZT.d.ts → pipeline-DuPF3sap.d.ts} +3 -3
  117. package/dist/{pipeline-CRTQGba7.js → pipeline-Q_185kY6.js} +1 -1
  118. package/dist/{prepare-OS7wL3jv.d.ts → prepare-BPzsZI_S.d.ts} +1 -1
  119. package/dist/{prepare-6pH3CNpg.d.ts → prepare-Ce5SpR7Y.d.ts} +1 -1
  120. package/dist/{prepare-C61BcwFA.js → prepare-DkJkZXuQ.js} +2 -2
  121. package/dist/{prepare-DxPEu9mo.js → prepare-sj36BP90.js} +4 -4
  122. package/dist/{rasterizer-C2wgJZ6J.d.ts → rasterizer-DjnurUgD.d.ts} +1 -1
  123. package/dist/render/blend.d.ts +1 -1
  124. package/dist/render/compose.d.ts +2 -2
  125. package/dist/render/entity-fallback.d.ts +6 -6
  126. package/dist/render/face.d.ts +1 -1
  127. package/dist/render/fluid-bucket.d.ts +2 -2
  128. package/dist/render/geo.d.ts +1 -1
  129. package/dist/render/legacy-tints.d.ts +2 -2
  130. package/dist/render/obj.d.ts +5 -5
  131. package/dist/render/pipeline.d.ts +1 -1
  132. package/dist/render/pipeline.js +1 -1
  133. package/dist/render/rasterizer.d.ts +1 -1
  134. package/dist/render/renderer.d.ts +1 -1
  135. package/dist/render/tints.d.ts +1 -1
  136. package/dist/{renderer-DbUmTFDb.d.ts → renderer-QgROYvPv.d.ts} +5 -5
  137. package/dist/resources/descriptor.d.ts +1 -1
  138. package/dist/resources/descriptor.js +1 -1
  139. package/dist/resources/entity-textures.d.ts +2 -2
  140. package/dist/resources/jar.d.ts +1 -1
  141. package/dist/resources/jar.js +1 -1
  142. package/dist/resources/manager.d.ts +1 -1
  143. package/dist/resources/manager.js +1 -1
  144. package/dist/resources/synthetic.d.ts +1 -1
  145. package/dist/resources/zip-reader.js +1 -1
  146. package/dist/{run-DYcem_Vv.js → run-5yX5KRiI.js} +4 -4
  147. package/dist/{run-CLjF0N2d.d.ts → run-CxB1qabg.d.ts} +2 -2
  148. package/dist/run.d.ts +1 -1
  149. package/dist/run.js +1 -1
  150. package/dist/{sources-e5D09Jz_.d.ts → sources-sFtealLJ.d.ts} +1 -1
  151. package/dist/states-BvoZA-ql.js +40 -0
  152. package/dist/states-OzneeCTU.d.ts +25 -0
  153. package/dist/{synthetic-B3R7mW9k.d.ts → synthetic-CWtFtAkR.d.ts} +1 -1
  154. package/dist/textures/loader.d.ts +1 -1
  155. package/dist/textures/overlay.d.ts +1 -1
  156. package/dist/{tints-uLl1CIkC.d.ts → tints-B0a1K11c.d.ts} +2 -2
  157. package/dist/{tints-CWQz6UkM.js → tints-CZeyKzMv.js} +2 -2
  158. package/dist/{tints-CQX8a1F0.d.ts → tints-DwFmEkf3.d.ts} +2 -2
  159. package/dist/versions/legacy-reshape.d.ts +1 -1
  160. package/dist/versions/prepare.d.ts +1 -1
  161. package/dist/versions/prepare.js +1 -1
  162. package/dist/workers/render-worker.d.ts +2 -2
  163. package/dist/workers/render-worker.js +2 -2
  164. package/dist/{zip-reader-zx3kdSq4.js → zip-reader-onwEVMea.js} +4 -4
  165. package/package.json +1 -1
  166. package/dist/biomes-5ZwYxMYe.js +0 -384
  167. package/dist/biomes-CJDJQqJb.d.ts +0 -38
  168. package/dist/pack-format-BqWf-DNc.d.ts +0 -350
@@ -1,350 +0,0 @@
1
- import { n as BiomeClimatePack } from "./biomes-CJDJQqJb.js";
2
- import { a as FaceDirectionName, l as Vec3, o as ModelElementJson, u as Vec4 } from "./types-qlp3I8_-.js";
3
- import { a as BlockStateMultipartCase, o as BlockStateVariantCase } from "./blockstate-eval-BzznRcVY.js";
4
- import { t as MeshGroup } from "./obj-mesh-ydhVfLKs.js";
5
- import { n as BlockTintPack } from "./tints-CQX8a1F0.js";
6
- //#region src/blocks/pack-format.d.ts
7
- /** How a sprite's alpha classifies it, inferred because assets rarely say. */
8
- type BlockPackRenderLayer = 'solid' | 'cutout' | 'translucent';
9
- interface BlockPackFace {
10
- sprite: string;
11
- /** [u1, v1, u2, v2] in 0–16 sprite space, derived when the model omits it. */
12
- uv: Vec4;
13
- rotation?: number;
14
- tintindex?: number;
15
- cullface?: FaceDirectionName;
16
- }
17
- interface BlockPackElement {
18
- from: Vec3;
19
- to: Vec3;
20
- rotation?: ModelElementJson['rotation'];
21
- shade?: false;
22
- faces: Partial<Record<FaceDirectionName, BlockPackFace>>;
23
- }
24
- interface BlockPackModel {
25
- ao: boolean;
26
- elements: BlockPackElement[];
27
- /**
28
- * The model's `particle` texture. What the game throws when the block breaks
29
- * or is walked on, and the only colour a consumer has to work with for a
30
- * block that draws nothing — a placeholder cube for a chest comes out oak
31
- * rather than magenta.
32
- */
33
- particle?: string;
34
- /** Triangle geometry from an OBJ loader, when the model uses one. */
35
- mesh?: MeshGroup[];
36
- /**
37
- * The layer the model states it draws on. Authoritative where present, and
38
- * it beats the per-sprite alpha inference — the same sprite can be solid in
39
- * one model and translucent in another.
40
- */
41
- renderType?: BlockPackRenderLayer;
42
- /** Block offsets a split-multiblock mesh spans. */
43
- multiblock?: Array<[number, number, number]>;
44
- /**
45
- * Present when the block is a fluid, whose real surface height and flow
46
- * direction come from its neighbours and so cannot be baked. The cube here is
47
- * a stand-in; these are the sheets to mesh the real thing with.
48
- */
49
- fluid?: {
50
- still: string;
51
- flow: string;
52
- overlay?: string;
53
- };
54
- }
55
- interface BlockPackSpriteFrame {
56
- page: number;
57
- x: number;
58
- y: number;
59
- /** Duration in game ticks. */
60
- time: number;
61
- }
62
- interface BlockPackSprite {
63
- page: number;
64
- x: number;
65
- y: number;
66
- w: number;
67
- h: number;
68
- layer: BlockPackRenderLayer;
69
- /** The displayed sequence, which can revisit a frame; absent when static. */
70
- frames?: BlockPackSpriteFrame[];
71
- interpolate?: true;
72
- }
73
- interface BlockPackAtlasPage {
74
- file: string;
75
- width: number;
76
- height: number;
77
- }
78
- /** `atlas.json`. */
79
- interface BlockPackAtlasFile {
80
- /** Edge-extended border per sprite, in pixels. */
81
- padding: number;
82
- pages: BlockPackAtlasPage[];
83
- sprites: Record<string, BlockPackSprite>;
84
- }
85
- /** `models.json`, by fully-qualified model id. */
86
- type BlockPackModelsFile = Record<string, BlockPackModel>;
87
- /** `blockstates.json`, by block id, with keys and predicates already parsed. */
88
- type BlockPackBlockStatesFile = Record<string, BlockPackBlockState>;
89
- /**
90
- * A variant as the pack writes it. Every rotation is optional because the emit
91
- * drops each one at its default, which is most of them.
92
- */
93
- interface BlockPackVariant {
94
- model: string;
95
- x?: number;
96
- y?: number;
97
- z?: number;
98
- uvlock?: true;
99
- weight?: number;
100
- }
101
- /**
102
- * One block's cases as the pack writes them: what `evaluateBlockState` takes,
103
- * flattened to the key the file uses. Pass it as
104
- * `{ kind: 'variants', cases: state.variants }` and the models come back as
105
- * `BlockPackVariant`, no cast in either direction.
106
- */
107
- type BlockPackBlockState = {
108
- variants: Array<BlockStateVariantCase<BlockPackVariant>>;
109
- multipart?: undefined;
110
- } | {
111
- multipart: Array<BlockStateMultipartCase<BlockPackVariant>>;
112
- variants?: undefined;
113
- };
114
- /** `tints.json`. */
115
- type BlockPackTintsFile = BlockTintPack;
116
- /**
117
- * How much light a block emits, 0–15.
118
- *
119
- * A number when every state of the block emits the same. Otherwise the commonest level is `default`
120
- * and each other level is a case naming only the properties that decide it: a redstone lamp is
121
- * `{ default: 0, cases: [{ when: { lit: 'true' }, level: 15 }] }`. The first case whose every
122
- * property matches the state applies; `blockLightLevel` in `light-eval.ts` does that lookup.
123
- */
124
- type BlockPackLight = number | {
125
- default: number;
126
- cases: Array<{
127
- when: Record<string, string>;
128
- level: number;
129
- }>;
130
- };
131
- /**
132
- * `light.json`, by block id, holding only the blocks that emit: absent means 0. Present only when the
133
- * pack has emitters and the export could read the code for them — an `--assets` run has none.
134
- */
135
- type BlockPackLightFile = Record<string, BlockPackLight>;
136
- /**
137
- * `biomes.json`, present only when the pack has biomes to describe: vanilla's
138
- * whole table, or the ones a mod's datapack declares. Absent is not empty — a
139
- * consumer with no file falls back to tinting at `tints.json`'s flat climate.
140
- */
141
- type BlockPackBiomesFile = BiomeClimatePack;
142
- /** One flat sprite of an item's layer stack, in the order the client draws them. */
143
- interface ItemPackLayer {
144
- sprite: string;
145
- /**
146
- * Present when the item declares a tint at this layer, which is the client's own
147
- * rule: `ItemModelGenerator` passes each layer its own index as the tint index.
148
- */
149
- tintindex?: number;
150
- /**
151
- * The colour that tint resolves to in an item's default state, `#rrggbb`.
152
- *
153
- * Absent where it cannot be known from assets — a dyed leather boot or a potion
154
- * takes its colour from the stack's components, which no pack can carry. A
155
- * consumer drawing an absent tint untinted gets the mod's own artwork, which is
156
- * the same thing the icon renderer settles for.
157
- */
158
- tint?: string;
159
- }
160
- /** One flat item: everything there is to say about how the game draws it. */
161
- interface ItemPackEntry {
162
- layers: ItemPackLayer[];
163
- }
164
- /**
165
- * `items.json`. Self-contained rather than sharing `atlas.json`'s pages, so a
166
- * consumer that only draws blocks never fetches the item sheet at all — a world
167
- * viewer needs it only once it finds a dropped stack of something that is not a
168
- * block.
169
- *
170
- * Holds *only* items whose model is a flat sprite stack. An item absent from
171
- * `items` either draws from `blockstates.json` under the same id, or is in
172
- * `failures.json` saying why nothing can draw it.
173
- */
174
- interface BlockPackItemsFile {
175
- /** Edge-extended border per sprite, in pixels. */
176
- padding: number;
177
- pages: BlockPackAtlasPage[];
178
- sprites: Record<string, BlockPackSprite>;
179
- items: Record<string, ItemPackEntry>;
180
- }
181
- /**
182
- * One entity type: what to call it, and what colour it is.
183
- *
184
- * No geometry, because no jar has any — entity models are Java code at every version. What a consumer
185
- * can do with this is name the stand-in box it draws and tint it like the animal, which is the
186
- * difference between a field of arbitrary colours and a readable one.
187
- */
188
- interface EntityPackEntry {
189
- /** English display name, from the jar's own lang file. */
190
- name: string;
191
- /**
192
- * Mean colour of the opaque pixels of the entity's sheet, `#rrggbb`.
193
- *
194
- * Absent for everything that is not a mob — an item entity, a falling block, a marker, a display,
195
- * a thrown projectile — because those draw from an item or a block and have no sheet of their own.
196
- * None is invented for them.
197
- */
198
- color?: string;
199
- /**
200
- * The sheet the colour came from, and what the model's `uv` values address. A sprite id in
201
- * `entity-models.json`'s atlas once that file is present.
202
- */
203
- texture?: string;
204
- /** Key into `entity-models.json`'s `models`, when geometry was recovered for this entity. */
205
- model?: string;
206
- }
207
- /**
208
- * `entities.json`, by entity id. The registry read off the lang file, which is the closest thing a jar
209
- * carries to it. Absent from a pack whose namespaces register no entities.
210
- */
211
- type BlockPackEntitiesFile = Record<string, EntityPackEntry>;
212
- /** One box of a part, in the model's own space, exactly as the game's own builder stated it. */
213
- /** The six faces a box can carry its own texture rect on. */
214
- type EntityPackCubeFace = 'north' | 'south' | 'east' | 'west' | 'up' | 'down';
215
- interface EntityPackCube {
216
- /** Minimum corner. */
217
- origin: Vec3;
218
- size: Vec3;
219
- /** Texture offset in pixels on the entity's own sheet, as `texOffs` set it. */
220
- uv: [number, number];
221
- /** Grows the box on every side; `CubeDeformation`, or a builder's `delta`. */
222
- inflate?: number;
223
- mirror?: true;
224
- /**
225
- * Per-face texture rects, which replace the box unwrap `uv` implies wherever they are present.
226
- *
227
- * Java has no such thing, since `addBox` always unwraps the same way, but bedrock geometry does and
228
- * leans on it: 56% of the cubes across four GeckoLib mods state their faces individually. A consumer
229
- * that ignores this draws over half of every such mob from the wrong part of its sheet.
230
- */
231
- faces?: Partial<Record<EntityPackCubeFace, {
232
- uv: [number, number];
233
- size: [number, number];
234
- }>>;
235
- }
236
- /** One bone: where it pivots, what it is made of, and what hangs off it. */
237
- interface EntityPackPart {
238
- name: string;
239
- /** Pivot relative to the parent bone. */
240
- pivot: Vec3;
241
- /** Radians about x, y, z, as `PartPose.offsetAndRotation` states them. */
242
- rotation: Vec3;
243
- cubes: EntityPackCube[];
244
- children: EntityPackPart[];
245
- }
246
- /**
247
- * One entity model: a bone hierarchy of boxes, recovered from the client's own code.
248
- *
249
- * `textureSize` is the sheet the `uv` values are in, which is *not* the atlas page — a consumer maps
250
- * `uv` through it into the sprite's rect, exactly as it does for a block face.
251
- *
252
- * **Prefer the sprite's own `w`/`h` where the entity has one**, and keep this as the fallback. One
253
- * model can be drawn on two differently sized sheets: from 1.21.4 a boat and a chest boat are both a
254
- * `BoatModel`, on a 128x64 and a 128x128 sheet respectively, so no single value here is right for both.
255
- */
256
- interface EntityPackModel {
257
- textureSize: [number, number];
258
- parts: EntityPackPart[];
259
- /** Anything the extraction had to skip or assume, so a consumer can distrust it knowingly. */
260
- notes?: string[];
261
- }
262
- /**
263
- * `entity-models.json`. Self-contained like `items.json`, with its own atlas of entity sheets, so a
264
- * consumer that never draws a mob does not fetch any of it.
265
- *
266
- * `models` is keyed by the class the geometry came from, and `entities.json`'s `model` points at it —
267
- * several entities share one model (every zombie is a `HumanoidModel`), and keying by class is what
268
- * makes that one entry rather than twenty copies.
269
- */
270
- interface BlockPackEntityModelsFile {
271
- padding: number;
272
- pages: BlockPackAtlasPage[];
273
- sprites: Record<string, BlockPackSprite>;
274
- models: Record<string, EntityPackModel>;
275
- /** Worn armour, when the version's classes described any. Absent otherwise. */
276
- equipment?: EquipmentPack;
277
- }
278
- /** The armour slots the game dresses a humanoid in, in the order it layers them. */
279
- declare const EQUIPMENT_SLOTS: readonly ["feet", "legs", "chest", "head"];
280
- type EquipmentSlot = typeof EQUIPMENT_SLOTS[number];
281
- /**
282
- * Worn armour: one humanoid-shaped mesh, the two sizes it is drawn at, and a sheet per material.
283
- *
284
- * Armour is not geometry of its own — it is the wearer's own humanoid shape grown by a fixed amount,
285
- * which is why one mesh dresses a player, a zombie and an armour stand alike. The leggings are the
286
- * *inner* layer and everything else the *outer*, drawn a little larger so the two never fight.
287
- *
288
- * Everything a consumer needs to decide what to draw is stated here rather than derived, in keeping
289
- * with the rest of the pack: which parts a slot lights up, which sheet a material uses, and which
290
- * material an item is made of.
291
- */
292
- interface EquipmentPack {
293
- /** Key into `models`, holding the humanoid armour shape. */
294
- model: string;
295
- /** How much each layer grows the wearer's boxes by, in pixels. */
296
- inflate: {
297
- inner: number;
298
- outer: number;
299
- };
300
- /** Parts each slot shows. A slot lights up some of the one mesh rather than owning geometry. */
301
- slots: Record<EquipmentSlot, string[]>;
302
- /** Which layer a slot is drawn on, which decides the sheet as well as the size. */
303
- layerOf: Record<EquipmentSlot, 'inner' | 'outer'>;
304
- /** Sprite ids per material and layer, into this file's own `sprites`. */
305
- materials: Record<string, Partial<Record<'inner' | 'outer', string>>>;
306
- /**
307
- * The armour items themselves. Keyed by item id because that is what a world writes into an
308
- * entity's `equipment` compound, and nothing in the assets maps one to the other.
309
- */
310
- items: Record<string, {
311
- material: string;
312
- slot: EquipmentSlot;
313
- }>;
314
- /** Materials whose sheet is greyscale and takes the item's own dye colour. */
315
- dyeable: string[];
316
- /** Worn armour-trim sheets generated from the version's armour-trim atlas. */
317
- trims: {
318
- /** Sprite ids per pattern and material, into this file's own `sprites`. */
319
- patterns: Record<string, Record<string, Partial<Record<'inner' | 'outer', string>>>>;
320
- /** Material a trim falls back to when it matches the armour it is on. */
321
- darker: Record<string, string>;
322
- };
323
- }
324
- /** `meta.json`, written last because it hashes every other file. */
325
- interface BlockPackMetaFile {
326
- generator: string;
327
- version: string;
328
- namespaces: string[];
329
- counts: {
330
- blocks: number;
331
- models: number;
332
- sprites: number;
333
- pages: number;
334
- /** Biomes in `biomes.json`; `0` means the pack has none and the file is absent. */
335
- biomes: number;
336
- /** Flat items in `items.json`; `0` means the pack has none and the file is absent. */
337
- items: number;
338
- /** Entity types in `entities.json`; `0` means the pack has none and the file is absent. */
339
- entities: number;
340
- /** Distinct entity models in `entity-models.json`; `0` means the file is absent. */
341
- entityModels: number;
342
- /** Emitting blocks in `light.json`; `0` means the file is absent. */
343
- light: number;
344
- failures: number;
345
- };
346
- /** sha256 per file, enough to verify a cached copy without refetching it. */
347
- hashes: Record<string, string>;
348
- }
349
- //#endregion
350
- export { ItemPackLayer as A, EntityPackCubeFace as C, EquipmentPack as D, EntityPackPart as E, EquipmentSlot as O, EntityPackCube as S, EntityPackModel as T, BlockPackSprite as _, BlockPackBlockStatesFile as a, BlockPackVariant as b, BlockPackEntityModelsFile as c, BlockPackLight as d, BlockPackLightFile as f, BlockPackRenderLayer as g, BlockPackModelsFile as h, BlockPackBlockState as i, ItemPackEntry as k, BlockPackFace as l, BlockPackModel as m, BlockPackAtlasPage as n, BlockPackElement as o, BlockPackMetaFile as p, BlockPackBiomesFile as r, BlockPackEntitiesFile as s, BlockPackAtlasFile as t, BlockPackItemsFile as u, BlockPackSpriteFrame as v, EntityPackEntry as w, EQUIPMENT_SLOTS as x, BlockPackTintsFile as y };