@nodecraft/rendermite 1.7.4 → 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.
- package/README.md +8 -1
- package/dist/atlas/registry.d.ts +3 -3
- package/dist/atlas/sources.d.ts +1 -1
- package/dist/{atlas-pack-C56gzqAg.d.ts → atlas-pack-BUadroKy.d.ts} +1 -1
- package/dist/biomes-BGOF6gRM.js +1100 -0
- package/dist/biomes-CnnhDCnk.d.ts +59 -0
- package/dist/{blend-C5UYzink.d.ts → blend-mJAeQB3C.d.ts} +1 -1
- package/dist/block-behaviour-9Tj_GIUC.d.ts +632 -0
- package/dist/block-behaviour-D-SG2Xfp.js +155 -0
- package/dist/blocks/atlas-pack.d.ts +1 -1
- package/dist/blocks/biomes.d.ts +2 -2
- package/dist/blocks/biomes.js +2 -2
- package/dist/blocks/block-behaviour.d.ts +2 -0
- package/dist/blocks/block-behaviour.js +2 -0
- package/dist/blocks/block-entities.d.ts +3 -3
- package/dist/blocks/cli.js +1 -1
- package/dist/blocks/datapack.d.ts +2 -0
- package/dist/blocks/datapack.js +2 -0
- package/dist/blocks/ender-storage.d.ts +2 -2
- package/dist/blocks/entities.d.ts +3 -3
- package/dist/blocks/entity-geo.d.ts +1 -1
- package/dist/blocks/entity-models.d.ts +4 -4
- package/dist/blocks/entity-models.js +1 -1
- package/dist/blocks/entity-sizes.d.ts +25 -0
- package/dist/blocks/entity-sizes.js +2 -0
- package/dist/blocks/export.d.ts +1 -1
- package/dist/blocks/export.js +1 -1
- package/dist/blocks/game-rules.d.ts +2 -0
- package/dist/blocks/game-rules.js +2 -0
- package/dist/blocks/geo-blocks.d.ts +2 -2
- package/dist/blocks/item-sprites.d.ts +4 -4
- package/dist/blocks/light-bytecode.d.ts +2 -0
- package/dist/blocks/light-bytecode.js +2 -0
- package/dist/blocks/light-eval.d.ts +2 -0
- package/dist/blocks/light-eval.js +2 -0
- package/dist/blocks/light.d.ts +48 -0
- package/dist/blocks/light.js +2 -0
- package/dist/blocks/obj-mesh.d.ts +1 -1
- package/dist/blocks/pack-format.d.ts +2 -2
- package/dist/blocks/sprite-sheet.d.ts +3 -3
- package/dist/blocks/states.d.ts +2 -0
- package/dist/blocks/states.js +2 -0
- package/dist/blocks/tints.d.ts +1 -1
- package/dist/{classfile-Bo7FUrrD.js → classfile-CiIDF3vc.js} +23 -1
- package/dist/{classfile-BdLIk4Pe.d.ts → classfile-CsLXlh5z.d.ts} +23 -0
- package/dist/{cli-DBNuCnry.js → cli-xBcMuKA3.js} +11 -5
- package/dist/cli.js +7 -7
- package/dist/datapack-CmEg0Vko.d.ts +15 -0
- package/dist/datapack-D6eH46ay.js +71 -0
- package/dist/{descriptor-JyXhfd-c.js → descriptor-Dz2cR-BH.js} +2 -2
- package/dist/{discovery-Cmir3QfC.d.ts → discovery-DWe_kX8W.d.ts} +1 -1
- package/dist/dynamic/generators.d.ts +1 -1
- package/dist/{encode-Br_vPrd8.d.ts → encode-BNEYHHR0.d.ts} +1 -1
- package/dist/entities/classfile.d.ts +1 -1
- package/dist/entities/classfile.js +1 -1
- package/dist/entities/geo-model.d.ts +1 -1
- package/dist/entities/inherit.d.ts +2 -2
- package/dist/entities/inherit.js +1 -1
- package/dist/entities/jar-classes.js +1 -1
- package/dist/entities/link.d.ts +2 -2
- package/dist/entities/link.js +1 -1
- package/dist/entities/mappings.d.ts +2 -2
- package/dist/entities/mappings.js +2 -2
- package/dist/entities/model-bytecode.d.ts +7 -2
- package/dist/entities/model-bytecode.js +2 -2
- package/dist/entities/model-code.d.ts +1 -1
- package/dist/entities/model-code.js +1 -1
- package/dist/{entity-models-DUKiHpn1.js → entity-models-BYAxrTsk.js} +5 -5
- package/dist/entity-sizes-CpO1gA7p.js +194 -0
- package/dist/{export-Ds1EelMa.js → export-CbG2Rx3i.js} +73 -4
- package/dist/{export-B8tPsf4K.d.ts → export-HEoqcV-Y.d.ts} +19 -2
- package/dist/{face-DqEd9G_U.d.ts → face-uWXECGNr.d.ts} +2 -2
- package/dist/game-rules-DuLlFc7o.js +104 -0
- package/dist/game-rules-ThvdDG3B.d.ts +16 -0
- package/dist/{generators-BnIzAftW.d.ts → generators-hu_vk10m.d.ts} +1 -1
- package/dist/{geo-C9QYeLVN.d.ts → geo-DsWwuC5o.d.ts} +4 -4
- package/dist/index.d.ts +20 -20
- package/dist/index.js +8 -8
- package/dist/{inherit-BYLi3Q28.js → inherit-BUn0Cve9.js} +2 -2
- package/dist/items/blockstate.d.ts +1 -1
- package/dist/items/discovery.d.ts +1 -1
- package/dist/{jar-B5iRZQeL.d.ts → jar-4Jg7ufWK.d.ts} +1 -1
- package/dist/{jar-W2cV2ZVO.js → jar-DvofBm71.js} +2 -2
- package/dist/{jar-classes-3GVCJZT7.js → jar-classes-0wqWbTax.js} +2 -2
- package/dist/light-CC3VMsjl.js +614 -0
- package/dist/light-bytecode-DYxb6pJk.js +1799 -0
- package/dist/light-eval-BsJJoSv4.js +23 -0
- package/dist/light-eval-DMjK6xnb.d.ts +13 -0
- package/dist/{link-5GmBLTzk.js → link-Cuhyrz07.js} +1 -1
- package/dist/{loader-DSir1-P0.d.ts → loader-BYyPIs9f.d.ts} +1 -1
- package/dist/{loader-59_eMa8e.d.ts → loader-C4gsX_wO.d.ts} +1 -1
- package/dist/{manager-exOIcdyx.d.ts → manager-Ct0dEOMg.d.ts} +6 -0
- package/dist/{manager-BNibYkmI.js → manager-D6zXmFrO.js} +6 -0
- package/dist/{mappings-BEPVaiwE.js → mappings-DEl_7xxQ.js} +94 -9
- package/dist/{mappings-DxX4KoZl.d.ts → mappings-DhOPQTgV.d.ts} +33 -2
- package/dist/{model-bytecode-B43uSqet.js → model-bytecode-VaLUQfGO.js} +2 -2
- package/dist/{model-code-BY44ao27.d.ts → model-code-Csc3bs3h.d.ts} +1 -1
- package/dist/{model-code-1Vuk-zj_.js → model-code-DbN2uVhp.js} +1 -1
- package/dist/models/loader.d.ts +1 -1
- package/dist/{models-CZjCOjs4.js → models-BsYA-NZg.js} +1 -1
- package/dist/mods/models.d.ts +1 -1
- package/dist/mods/models.js +1 -1
- package/dist/mods/prepare.d.ts +1 -1
- package/dist/mods/prepare.js +1 -1
- package/dist/mods/synthesize.d.ts +2 -2
- package/dist/mods/tints.d.ts +2 -2
- package/dist/mods/tints.js +1 -1
- package/dist/{obj-mesh-ydhVfLKs.d.ts → obj-mesh-CzL0lOlJ.d.ts} +2 -2
- package/dist/output/encode.d.ts +1 -1
- package/dist/pack.d.ts +7 -5
- package/dist/pack.js +2 -1
- package/dist/{pipeline-DFuQa8ZT.d.ts → pipeline-DuPF3sap.d.ts} +3 -3
- package/dist/{pipeline-BTlk9-s5.js → pipeline-Q_185kY6.js} +1 -1
- package/dist/{prepare-OS7wL3jv.d.ts → prepare-BPzsZI_S.d.ts} +1 -1
- package/dist/{prepare-6pH3CNpg.d.ts → prepare-Ce5SpR7Y.d.ts} +1 -1
- package/dist/{prepare-D49Gu4Lv.js → prepare-DkJkZXuQ.js} +2 -2
- package/dist/{prepare-Myd_ec4v.js → prepare-sj36BP90.js} +4 -4
- package/dist/{rasterizer-C2wgJZ6J.d.ts → rasterizer-DjnurUgD.d.ts} +1 -1
- package/dist/render/blend.d.ts +1 -1
- package/dist/render/compose.d.ts +2 -2
- package/dist/render/entity-fallback.d.ts +6 -6
- package/dist/render/face.d.ts +1 -1
- package/dist/render/fluid-bucket.d.ts +2 -2
- package/dist/render/geo.d.ts +1 -1
- package/dist/render/legacy-tints.d.ts +2 -2
- package/dist/render/obj.d.ts +5 -5
- package/dist/render/pipeline.d.ts +1 -1
- package/dist/render/pipeline.js +1 -1
- package/dist/render/rasterizer.d.ts +1 -1
- package/dist/render/renderer.d.ts +1 -1
- package/dist/render/tints.d.ts +1 -1
- package/dist/{renderer-DbUmTFDb.d.ts → renderer-QgROYvPv.d.ts} +5 -5
- package/dist/resources/descriptor.d.ts +1 -1
- package/dist/resources/descriptor.js +1 -1
- package/dist/resources/entity-textures.d.ts +2 -2
- package/dist/resources/jar.d.ts +1 -1
- package/dist/resources/jar.js +1 -1
- package/dist/resources/manager.d.ts +1 -1
- package/dist/resources/manager.js +1 -1
- package/dist/resources/synthetic.d.ts +1 -1
- package/dist/resources/zip-reader.js +1 -1
- package/dist/{run-Ctt_1iTd.js → run-5yX5KRiI.js} +4 -4
- package/dist/{run-CLjF0N2d.d.ts → run-CxB1qabg.d.ts} +2 -2
- package/dist/run.d.ts +1 -1
- package/dist/run.js +1 -1
- package/dist/{sources-e5D09Jz_.d.ts → sources-sFtealLJ.d.ts} +1 -1
- package/dist/states-BvoZA-ql.js +40 -0
- package/dist/states-OzneeCTU.d.ts +25 -0
- package/dist/{synthetic-B3R7mW9k.d.ts → synthetic-CWtFtAkR.d.ts} +1 -1
- package/dist/textures/loader.d.ts +1 -1
- package/dist/textures/overlay.d.ts +1 -1
- package/dist/{tints-uLl1CIkC.d.ts → tints-B0a1K11c.d.ts} +2 -2
- package/dist/{tints-BspVCz2G.js → tints-CZeyKzMv.js} +2 -2
- package/dist/{tints-CQX8a1F0.d.ts → tints-DwFmEkf3.d.ts} +2 -2
- package/dist/versions/legacy-reshape.d.ts +1 -1
- package/dist/versions/prepare.d.ts +1 -1
- package/dist/versions/prepare.js +1 -1
- package/dist/workers/render-worker.d.ts +2 -2
- package/dist/workers/render-worker.js +2 -2
- package/dist/{zip-reader-BSbJKUT1.js → zip-reader-onwEVMea.js} +4 -4
- package/package.json +6 -6
- package/dist/biomes-5ZwYxMYe.js +0 -384
- package/dist/biomes-CJDJQqJb.d.ts +0 -38
- package/dist/pack-format-Baoc_aSZ.d.ts +0 -328
|
@@ -1,328 +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
|
-
* `biomes.json`, present only when the pack has biomes to describe: vanilla's
|
|
118
|
-
* whole table, or the ones a mod's datapack declares. Absent is not empty — a
|
|
119
|
-
* consumer with no file falls back to tinting at `tints.json`'s flat climate.
|
|
120
|
-
*/
|
|
121
|
-
type BlockPackBiomesFile = BiomeClimatePack;
|
|
122
|
-
/** One flat sprite of an item's layer stack, in the order the client draws them. */
|
|
123
|
-
interface ItemPackLayer {
|
|
124
|
-
sprite: string;
|
|
125
|
-
/**
|
|
126
|
-
* Present when the item declares a tint at this layer, which is the client's own
|
|
127
|
-
* rule: `ItemModelGenerator` passes each layer its own index as the tint index.
|
|
128
|
-
*/
|
|
129
|
-
tintindex?: number;
|
|
130
|
-
/**
|
|
131
|
-
* The colour that tint resolves to in an item's default state, `#rrggbb`.
|
|
132
|
-
*
|
|
133
|
-
* Absent where it cannot be known from assets — a dyed leather boot or a potion
|
|
134
|
-
* takes its colour from the stack's components, which no pack can carry. A
|
|
135
|
-
* consumer drawing an absent tint untinted gets the mod's own artwork, which is
|
|
136
|
-
* the same thing the icon renderer settles for.
|
|
137
|
-
*/
|
|
138
|
-
tint?: string;
|
|
139
|
-
}
|
|
140
|
-
/** One flat item: everything there is to say about how the game draws it. */
|
|
141
|
-
interface ItemPackEntry {
|
|
142
|
-
layers: ItemPackLayer[];
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* `items.json`. Self-contained rather than sharing `atlas.json`'s pages, so a
|
|
146
|
-
* consumer that only draws blocks never fetches the item sheet at all — a world
|
|
147
|
-
* viewer needs it only once it finds a dropped stack of something that is not a
|
|
148
|
-
* block.
|
|
149
|
-
*
|
|
150
|
-
* Holds *only* items whose model is a flat sprite stack. An item absent from
|
|
151
|
-
* `items` either draws from `blockstates.json` under the same id, or is in
|
|
152
|
-
* `failures.json` saying why nothing can draw it.
|
|
153
|
-
*/
|
|
154
|
-
interface BlockPackItemsFile {
|
|
155
|
-
/** Edge-extended border per sprite, in pixels. */
|
|
156
|
-
padding: number;
|
|
157
|
-
pages: BlockPackAtlasPage[];
|
|
158
|
-
sprites: Record<string, BlockPackSprite>;
|
|
159
|
-
items: Record<string, ItemPackEntry>;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* One entity type: what to call it, and what colour it is.
|
|
163
|
-
*
|
|
164
|
-
* No geometry, because no jar has any — entity models are Java code at every version. What a consumer
|
|
165
|
-
* can do with this is name the stand-in box it draws and tint it like the animal, which is the
|
|
166
|
-
* difference between a field of arbitrary colours and a readable one.
|
|
167
|
-
*/
|
|
168
|
-
interface EntityPackEntry {
|
|
169
|
-
/** English display name, from the jar's own lang file. */
|
|
170
|
-
name: string;
|
|
171
|
-
/**
|
|
172
|
-
* Mean colour of the opaque pixels of the entity's sheet, `#rrggbb`.
|
|
173
|
-
*
|
|
174
|
-
* Absent for everything that is not a mob — an item entity, a falling block, a marker, a display,
|
|
175
|
-
* a thrown projectile — because those draw from an item or a block and have no sheet of their own.
|
|
176
|
-
* None is invented for them.
|
|
177
|
-
*/
|
|
178
|
-
color?: string;
|
|
179
|
-
/**
|
|
180
|
-
* The sheet the colour came from, and what the model's `uv` values address. A sprite id in
|
|
181
|
-
* `entity-models.json`'s atlas once that file is present.
|
|
182
|
-
*/
|
|
183
|
-
texture?: string;
|
|
184
|
-
/** Key into `entity-models.json`'s `models`, when geometry was recovered for this entity. */
|
|
185
|
-
model?: string;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* `entities.json`, by entity id. The registry read off the lang file, which is the closest thing a jar
|
|
189
|
-
* carries to it. Absent from a pack whose namespaces register no entities.
|
|
190
|
-
*/
|
|
191
|
-
type BlockPackEntitiesFile = Record<string, EntityPackEntry>;
|
|
192
|
-
/** One box of a part, in the model's own space, exactly as the game's own builder stated it. */
|
|
193
|
-
/** The six faces a box can carry its own texture rect on. */
|
|
194
|
-
type EntityPackCubeFace = 'north' | 'south' | 'east' | 'west' | 'up' | 'down';
|
|
195
|
-
interface EntityPackCube {
|
|
196
|
-
/** Minimum corner. */
|
|
197
|
-
origin: Vec3;
|
|
198
|
-
size: Vec3;
|
|
199
|
-
/** Texture offset in pixels on the entity's own sheet, as `texOffs` set it. */
|
|
200
|
-
uv: [number, number];
|
|
201
|
-
/** Grows the box on every side; `CubeDeformation`, or a builder's `delta`. */
|
|
202
|
-
inflate?: number;
|
|
203
|
-
mirror?: true;
|
|
204
|
-
/**
|
|
205
|
-
* Per-face texture rects, which replace the box unwrap `uv` implies wherever they are present.
|
|
206
|
-
*
|
|
207
|
-
* Java has no such thing, since `addBox` always unwraps the same way, but bedrock geometry does and
|
|
208
|
-
* leans on it: 56% of the cubes across four GeckoLib mods state their faces individually. A consumer
|
|
209
|
-
* that ignores this draws over half of every such mob from the wrong part of its sheet.
|
|
210
|
-
*/
|
|
211
|
-
faces?: Partial<Record<EntityPackCubeFace, {
|
|
212
|
-
uv: [number, number];
|
|
213
|
-
size: [number, number];
|
|
214
|
-
}>>;
|
|
215
|
-
}
|
|
216
|
-
/** One bone: where it pivots, what it is made of, and what hangs off it. */
|
|
217
|
-
interface EntityPackPart {
|
|
218
|
-
name: string;
|
|
219
|
-
/** Pivot relative to the parent bone. */
|
|
220
|
-
pivot: Vec3;
|
|
221
|
-
/** Radians about x, y, z, as `PartPose.offsetAndRotation` states them. */
|
|
222
|
-
rotation: Vec3;
|
|
223
|
-
cubes: EntityPackCube[];
|
|
224
|
-
children: EntityPackPart[];
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* One entity model: a bone hierarchy of boxes, recovered from the client's own code.
|
|
228
|
-
*
|
|
229
|
-
* `textureSize` is the sheet the `uv` values are in, which is *not* the atlas page — a consumer maps
|
|
230
|
-
* `uv` through it into the sprite's rect, exactly as it does for a block face.
|
|
231
|
-
*
|
|
232
|
-
* **Prefer the sprite's own `w`/`h` where the entity has one**, and keep this as the fallback. One
|
|
233
|
-
* model can be drawn on two differently sized sheets: from 1.21.4 a boat and a chest boat are both a
|
|
234
|
-
* `BoatModel`, on a 128x64 and a 128x128 sheet respectively, so no single value here is right for both.
|
|
235
|
-
*/
|
|
236
|
-
interface EntityPackModel {
|
|
237
|
-
textureSize: [number, number];
|
|
238
|
-
parts: EntityPackPart[];
|
|
239
|
-
/** Anything the extraction had to skip or assume, so a consumer can distrust it knowingly. */
|
|
240
|
-
notes?: string[];
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* `entity-models.json`. Self-contained like `items.json`, with its own atlas of entity sheets, so a
|
|
244
|
-
* consumer that never draws a mob does not fetch any of it.
|
|
245
|
-
*
|
|
246
|
-
* `models` is keyed by the class the geometry came from, and `entities.json`'s `model` points at it —
|
|
247
|
-
* several entities share one model (every zombie is a `HumanoidModel`), and keying by class is what
|
|
248
|
-
* makes that one entry rather than twenty copies.
|
|
249
|
-
*/
|
|
250
|
-
interface BlockPackEntityModelsFile {
|
|
251
|
-
padding: number;
|
|
252
|
-
pages: BlockPackAtlasPage[];
|
|
253
|
-
sprites: Record<string, BlockPackSprite>;
|
|
254
|
-
models: Record<string, EntityPackModel>;
|
|
255
|
-
/** Worn armour, when the version's classes described any. Absent otherwise. */
|
|
256
|
-
equipment?: EquipmentPack;
|
|
257
|
-
}
|
|
258
|
-
/** The armour slots the game dresses a humanoid in, in the order it layers them. */
|
|
259
|
-
declare const EQUIPMENT_SLOTS: readonly ["feet", "legs", "chest", "head"];
|
|
260
|
-
type EquipmentSlot = typeof EQUIPMENT_SLOTS[number];
|
|
261
|
-
/**
|
|
262
|
-
* Worn armour: one humanoid-shaped mesh, the two sizes it is drawn at, and a sheet per material.
|
|
263
|
-
*
|
|
264
|
-
* Armour is not geometry of its own — it is the wearer's own humanoid shape grown by a fixed amount,
|
|
265
|
-
* which is why one mesh dresses a player, a zombie and an armour stand alike. The leggings are the
|
|
266
|
-
* *inner* layer and everything else the *outer*, drawn a little larger so the two never fight.
|
|
267
|
-
*
|
|
268
|
-
* Everything a consumer needs to decide what to draw is stated here rather than derived, in keeping
|
|
269
|
-
* with the rest of the pack: which parts a slot lights up, which sheet a material uses, and which
|
|
270
|
-
* material an item is made of.
|
|
271
|
-
*/
|
|
272
|
-
interface EquipmentPack {
|
|
273
|
-
/** Key into `models`, holding the humanoid armour shape. */
|
|
274
|
-
model: string;
|
|
275
|
-
/** How much each layer grows the wearer's boxes by, in pixels. */
|
|
276
|
-
inflate: {
|
|
277
|
-
inner: number;
|
|
278
|
-
outer: number;
|
|
279
|
-
};
|
|
280
|
-
/** Parts each slot shows. A slot lights up some of the one mesh rather than owning geometry. */
|
|
281
|
-
slots: Record<EquipmentSlot, string[]>;
|
|
282
|
-
/** Which layer a slot is drawn on, which decides the sheet as well as the size. */
|
|
283
|
-
layerOf: Record<EquipmentSlot, 'inner' | 'outer'>;
|
|
284
|
-
/** Sprite ids per material and layer, into this file's own `sprites`. */
|
|
285
|
-
materials: Record<string, Partial<Record<'inner' | 'outer', string>>>;
|
|
286
|
-
/**
|
|
287
|
-
* The armour items themselves. Keyed by item id because that is what a world writes into an
|
|
288
|
-
* entity's `equipment` compound, and nothing in the assets maps one to the other.
|
|
289
|
-
*/
|
|
290
|
-
items: Record<string, {
|
|
291
|
-
material: string;
|
|
292
|
-
slot: EquipmentSlot;
|
|
293
|
-
}>;
|
|
294
|
-
/** Materials whose sheet is greyscale and takes the item's own dye colour. */
|
|
295
|
-
dyeable: string[];
|
|
296
|
-
/** Worn armour-trim sheets generated from the version's armour-trim atlas. */
|
|
297
|
-
trims: {
|
|
298
|
-
/** Sprite ids per pattern and material, into this file's own `sprites`. */
|
|
299
|
-
patterns: Record<string, Record<string, Partial<Record<'inner' | 'outer', string>>>>;
|
|
300
|
-
/** Material a trim falls back to when it matches the armour it is on. */
|
|
301
|
-
darker: Record<string, string>;
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
/** `meta.json`, written last because it hashes every other file. */
|
|
305
|
-
interface BlockPackMetaFile {
|
|
306
|
-
generator: string;
|
|
307
|
-
version: string;
|
|
308
|
-
namespaces: string[];
|
|
309
|
-
counts: {
|
|
310
|
-
blocks: number;
|
|
311
|
-
models: number;
|
|
312
|
-
sprites: number;
|
|
313
|
-
pages: number;
|
|
314
|
-
/** Biomes in `biomes.json`; `0` means the pack has none and the file is absent. */
|
|
315
|
-
biomes: number;
|
|
316
|
-
/** Flat items in `items.json`; `0` means the pack has none and the file is absent. */
|
|
317
|
-
items: number;
|
|
318
|
-
/** Entity types in `entities.json`; `0` means the pack has none and the file is absent. */
|
|
319
|
-
entities: number;
|
|
320
|
-
/** Distinct entity models in `entity-models.json`; `0` means the file is absent. */
|
|
321
|
-
entityModels: number;
|
|
322
|
-
failures: number;
|
|
323
|
-
};
|
|
324
|
-
/** sha256 per file, enough to verify a cached copy without refetching it. */
|
|
325
|
-
hashes: Record<string, string>;
|
|
326
|
-
}
|
|
327
|
-
//#endregion
|
|
328
|
-
export { EntityPackModel as C, ItemPackEntry as D, EquipmentSlot as E, ItemPackLayer as O, EntityPackEntry as S, EquipmentPack as T, BlockPackTintsFile as _, BlockPackBlockStatesFile as a, EntityPackCube as b, BlockPackEntityModelsFile as c, BlockPackMetaFile as d, BlockPackModel as f, BlockPackSpriteFrame as g, BlockPackSprite as h, BlockPackBlockState as i, BlockPackFace as l, BlockPackRenderLayer as m, BlockPackAtlasPage as n, BlockPackElement as o, BlockPackModelsFile as p, BlockPackBiomesFile as r, BlockPackEntitiesFile as s, BlockPackAtlasFile as t, BlockPackItemsFile as u, BlockPackVariant as v, EntityPackPart as w, EntityPackCubeFace as x, EQUIPMENT_SLOTS as y };
|