@nodecraft/rendermite 1.4.1 → 1.6.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 +3 -0
- package/dist/blocks/cli.js +1 -1
- package/dist/blocks/entities.d.ts +30 -0
- package/dist/blocks/entities.js +2 -0
- package/dist/blocks/entity-geo.d.ts +18 -0
- package/dist/blocks/entity-geo.js +2 -0
- package/dist/blocks/entity-models.d.ts +2 -0
- package/dist/blocks/entity-models.js +2 -0
- package/dist/blocks/export.d.ts +1 -1
- package/dist/blocks/export.js +1 -1
- package/dist/blocks/item-sprites.d.ts +34 -0
- package/dist/blocks/item-sprites.js +2 -0
- package/dist/blocks/obj-mesh.js +1 -1
- package/dist/blocks/pack-format.d.ts +2 -2
- package/dist/blocks/sprite-sheet.d.ts +59 -0
- package/dist/blocks/sprite-sheet.js +2 -0
- package/dist/classfile-BwaQjnUM.d.ts +51 -0
- package/dist/classfile-CAhS5qNf.js +255 -0
- package/dist/{cli-DqJtT-Ms.js → cli-BSKnXBPr.js} +31 -4
- package/dist/cli.js +5 -5
- package/dist/{discovery-CsZu08re.js → discovery-CD0QqxSF.js} +1 -1
- package/dist/{discovery-C5ZR4aoG.d.ts → discovery-Cmir3QfC.d.ts} +8 -1
- package/dist/entities/classfile.d.ts +2 -0
- package/dist/entities/classfile.js +2 -0
- package/dist/entities/geo-model.d.ts +13 -0
- package/dist/entities/geo-model.js +2 -0
- package/dist/entities/inherit.d.ts +29 -0
- package/dist/entities/inherit.js +2 -0
- package/dist/entities/jar-classes.d.ts +26 -0
- package/dist/entities/jar-classes.js +2 -0
- package/dist/entities/link.d.ts +71 -0
- package/dist/entities/link.js +2 -0
- package/dist/entities/mappings.d.ts +2 -0
- package/dist/entities/mappings.js +2 -0
- package/dist/entities/merge.d.ts +18 -0
- package/dist/entities/merge.js +2 -0
- package/dist/entities/model-bytecode.d.ts +31 -0
- package/dist/entities/model-bytecode.js +2 -0
- package/dist/entities/model-code.d.ts +2 -0
- package/dist/entities/model-code.js +2 -0
- package/dist/entities/model.d.ts +2 -0
- package/dist/entities/model.js +1 -0
- package/dist/entities-DvmA9fEV.js +175 -0
- package/dist/{entity-fallback-BTkM8j0V.js → entity-fallback-Bth0fa7m.js} +1 -1
- package/dist/entity-geo-B2CkuMWx.js +100 -0
- package/dist/entity-models-B6-0r2gR.js +123 -0
- package/dist/entity-models-c2HpfdWV.d.ts +49 -0
- package/dist/{export-Bllg8Fw7.d.ts → export-D8fLC1wS.d.ts} +30 -1
- package/dist/{export-kMoMes_a.js → export-DT_drDoI.js} +182 -160
- package/dist/geo-CmjrXu0G.d.ts +59 -0
- package/dist/{geo-BguldlU-.js → geo-Desq-gRC.js} +5 -4
- package/dist/geo-model-Bo1gpEwX.js +163 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10 -10
- package/dist/inherit-KkDsM2N_.js +77 -0
- package/dist/item-sprites-G-yikdfV.js +126 -0
- package/dist/items/discovery.d.ts +2 -2
- package/dist/items/discovery.js +2 -2
- package/dist/jar-classes-Bj15hjdr.js +75 -0
- package/dist/link-Bm5oQYh6.js +331 -0
- package/dist/mappings-BEPVaiwE.js +139 -0
- package/dist/mappings-DxX4KoZl.d.ts +75 -0
- package/dist/merge-3HkeQ_6A.js +46 -0
- package/dist/model-PnQ4gV0-.d.ts +49 -0
- package/dist/model-bytecode-C1nw2G8O.js +732 -0
- package/dist/model-code-B7jSFQqd.d.ts +16 -0
- package/dist/model-code-BKMEMXxF.js +49 -0
- package/dist/mods/prepare.js +1 -1
- package/dist/mods/tints.js +1 -1
- package/dist/{obj-bvs3gwex.js → obj-CJHEHpki.js} +4 -4
- package/dist/{obj-mesh-rnYbSbpv.js → obj-mesh-JwPkZEWL.js} +1 -1
- package/dist/pack-format-QcVFxG_b.d.ts +280 -0
- package/dist/pack.d.ts +1 -1
- package/dist/{pipeline-B8e6x8Hh.js → pipeline-BUIMzMzg.js} +6 -6
- package/dist/{prepare-C9gjqQTt.js → prepare-Myd_ec4v.js} +2 -2
- package/dist/render/entity-fallback.js +1 -1
- package/dist/render/face.js +1 -1
- package/dist/render/geo.d.ts +2 -54
- package/dist/render/geo.js +2 -2
- package/dist/render/obj.js +1 -1
- package/dist/render/pipeline.js +1 -1
- package/dist/render/renderer.js +1 -1
- package/dist/resources/descriptor.js +1 -1
- package/dist/{run-B_JAUbXe.js → run-BQJkqc5f.js} +3 -3
- package/dist/run.js +1 -1
- package/dist/sprite-sheet-LQAEtGkp.js +185 -0
- package/dist/versions/prepare.js +1 -1
- package/dist/workers/render-worker.js +2 -2
- package/package.json +1 -1
- package/dist/pack-format-BVC_B-ZW.d.ts +0 -140
- package/dist/{descriptor-D7VKgeGT.js → descriptor-JyXhfd-c.js} +1 -1
- package/dist/{face-CKHboPfh.js → face-B2JjWT46.js} +1 -1
- package/dist/{prepare-8LswFoS-.js → prepare-D49Gu4Lv.js} +1 -1
- package/dist/{tints-C1tT6pKk.js → tints-BspVCz2G.js} +1 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
2
|
+
import { t as packAtlas } from "./atlas-pack-CoOih7By.js";
|
|
3
|
+
//#region src/blocks/sprite-sheet.ts
|
|
4
|
+
/**
|
|
5
|
+
* Turning a set of texture ids into a stitched atlas plus the JSON that
|
|
6
|
+
* addresses it, which is the same problem whether the sprites came from block
|
|
7
|
+
* models or from item models.
|
|
8
|
+
*
|
|
9
|
+
* Extracted from `export.ts` when the item sprites arrived, unchanged: the
|
|
10
|
+
* fiddly parts — an animation strip becoming one rect per physical frame, a
|
|
11
|
+
* `.mcmeta` claiming more frames than an atlas can hold, a sprite too large for
|
|
12
|
+
* a page, alpha deciding the render layer — are all things it would be a mistake
|
|
13
|
+
* to write twice and let drift.
|
|
14
|
+
*
|
|
15
|
+
* Nothing here knows what names the sprites. Callers that need a guaranteed
|
|
16
|
+
* fallback sprite pass `includeMissing`; callers that do not (an item sheet, where
|
|
17
|
+
* a missing sprite means the consumer draws a box instead) leave it off.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Vanilla's own id for the missing-texture sprite. A face whose texture does
|
|
21
|
+
* not resolve is drawn by the game in black and magenta rather than skipped —
|
|
22
|
+
* Blockbench leaves `"texture": "#missing"` on unassigned faces and mods ship
|
|
23
|
+
* models naming textures they forgot to include. Dropping those faces would
|
|
24
|
+
* put holes in geometry the player can see, and would read as our bug rather
|
|
25
|
+
* than the mod's.
|
|
26
|
+
*/
|
|
27
|
+
const MISSING_SPRITE = "minecraft:missingno";
|
|
28
|
+
/**
|
|
29
|
+
* A sprite whose strip is longer than this exports as its first frame only.
|
|
30
|
+
* A broken `.mcmeta` can claim thousands of frames, and packing them would
|
|
31
|
+
* blow the atlas out for one texture.
|
|
32
|
+
*/
|
|
33
|
+
const MAX_FRAMES_PER_SPRITE = 256;
|
|
34
|
+
/** `MissingTextureAtlasSprite`: 16x16, black and magenta in 8px quarters. */
|
|
35
|
+
function missingTexture() {
|
|
36
|
+
const size = 16;
|
|
37
|
+
const data = /* @__PURE__ */ new Uint8ClampedArray(1024);
|
|
38
|
+
for (let y = 0; y < size; y++) for (let x = 0; x < size; x++) {
|
|
39
|
+
const magenta = x < 8 !== y < 8;
|
|
40
|
+
const offset = (y * size + x) * 4;
|
|
41
|
+
data[offset] = magenta ? 248 : 0;
|
|
42
|
+
data[offset + 1] = 0;
|
|
43
|
+
data[offset + 2] = magenta ? 248 : 0;
|
|
44
|
+
data[offset + 3] = 255;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
width: size,
|
|
48
|
+
height: size,
|
|
49
|
+
data
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Alpha decides the render layer: vanilla assets do not state cutout versus
|
|
54
|
+
* translucent (`render_type` is a loader extension adopted only recently), and
|
|
55
|
+
* inferring it covers mods for free.
|
|
56
|
+
*/
|
|
57
|
+
function inferRenderLayer(frames) {
|
|
58
|
+
let sawHole = false;
|
|
59
|
+
for (const frame of frames) for (let offset = 3; offset < frame.data.length; offset += 4) {
|
|
60
|
+
const alpha = frame.data[offset];
|
|
61
|
+
if (alpha === 0) sawHole = true;
|
|
62
|
+
else if (alpha !== 255) return "translucent";
|
|
63
|
+
}
|
|
64
|
+
return sawHole ? "cutout" : "solid";
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Loads every id, packs the frames, and returns the sheet plus everything that
|
|
68
|
+
* did not make it. Ids are packed in sorted order so an unchanged input produces
|
|
69
|
+
* a byte-identical atlas.
|
|
70
|
+
*/
|
|
71
|
+
async function buildSpriteSheet(ids, textures, options = {}) {
|
|
72
|
+
const wanted = new Set(ids);
|
|
73
|
+
if (options.includeMissing) wanted.delete(MISSING_SPRITE);
|
|
74
|
+
const failures = [];
|
|
75
|
+
const missing = /* @__PURE__ */ new Set();
|
|
76
|
+
const loaded = [];
|
|
77
|
+
let done = 0;
|
|
78
|
+
for (const id of [...wanted].toSorted((left, right) => left.localeCompare(right))) {
|
|
79
|
+
options.onProgress?.(++done, wanted.size);
|
|
80
|
+
let animated;
|
|
81
|
+
try {
|
|
82
|
+
animated = await textures.loadAnimated(ResourceLocator.parse(id));
|
|
83
|
+
} catch (err) {
|
|
84
|
+
failures.push({
|
|
85
|
+
id,
|
|
86
|
+
reason: err.message
|
|
87
|
+
});
|
|
88
|
+
missing.add(id);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (!animated) {
|
|
92
|
+
failures.push({
|
|
93
|
+
id,
|
|
94
|
+
reason: "texture not found"
|
|
95
|
+
});
|
|
96
|
+
missing.add(id);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const overlong = animated.frameCount > MAX_FRAMES_PER_SPRITE;
|
|
100
|
+
if (overlong) failures.push({
|
|
101
|
+
id,
|
|
102
|
+
reason: `${animated.frameCount} frames exceeds the ${MAX_FRAMES_PER_SPRITE} cap; exported static`
|
|
103
|
+
});
|
|
104
|
+
const starts = overlong ? [0] : animated.frameStartTicks();
|
|
105
|
+
const total = overlong ? 1 : animated.tickLength;
|
|
106
|
+
const sequence = starts.map((start, index) => {
|
|
107
|
+
return {
|
|
108
|
+
frame: animated.resolveFrame(start).frame,
|
|
109
|
+
time: (index + 1 < starts.length ? starts[index + 1] : total) - start
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
const frames = /* @__PURE__ */ new Map();
|
|
113
|
+
for (const entry of sequence) if (!frames.has(entry.frame)) frames.set(entry.frame, animated.frame(entry.frame));
|
|
114
|
+
loaded.push({
|
|
115
|
+
id,
|
|
116
|
+
frames,
|
|
117
|
+
sequence,
|
|
118
|
+
interpolate: animated.interpolated
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (options.includeMissing) loaded.push({
|
|
122
|
+
id: MISSING_SPRITE,
|
|
123
|
+
frames: /* @__PURE__ */ new Map([[0, missingTexture()]]),
|
|
124
|
+
sequence: [{
|
|
125
|
+
frame: 0,
|
|
126
|
+
time: 1
|
|
127
|
+
}],
|
|
128
|
+
interpolate: false
|
|
129
|
+
});
|
|
130
|
+
const packed = packAtlas(loaded.flatMap((sprite) => [...sprite.frames].map(([index, texture]) => {
|
|
131
|
+
return {
|
|
132
|
+
key: `${sprite.id}#${index}`,
|
|
133
|
+
texture
|
|
134
|
+
};
|
|
135
|
+
})), {
|
|
136
|
+
padding: options.padding,
|
|
137
|
+
maxPageSize: options.maxPageSize
|
|
138
|
+
});
|
|
139
|
+
for (const key of packed.oversized) {
|
|
140
|
+
const id = key.split("#", 1)[0];
|
|
141
|
+
if (!missing.has(id)) {
|
|
142
|
+
failures.push({
|
|
143
|
+
id,
|
|
144
|
+
reason: "sprite is larger than one atlas page; drawn as the missing texture"
|
|
145
|
+
});
|
|
146
|
+
missing.add(id);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (options.includeMissing && missing.has("minecraft:missingno")) throw new Error("the missing-texture sprite does not fit an atlas page; maxPageSize is too small");
|
|
150
|
+
const rects = new Map(packed.rects.map((rect) => [rect.key, rect]));
|
|
151
|
+
const sprites = {};
|
|
152
|
+
for (const sprite of loaded) {
|
|
153
|
+
const first = rects.get(`${sprite.id}#${sprite.sequence[0].frame}`);
|
|
154
|
+
if (!first) continue;
|
|
155
|
+
const frames = [];
|
|
156
|
+
for (const entry of sprite.sequence) {
|
|
157
|
+
const rect = rects.get(`${sprite.id}#${entry.frame}`);
|
|
158
|
+
if (rect) frames.push({
|
|
159
|
+
page: rect.page,
|
|
160
|
+
x: rect.x,
|
|
161
|
+
y: rect.y,
|
|
162
|
+
time: entry.time
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
sprites[sprite.id] = {
|
|
166
|
+
page: first.page,
|
|
167
|
+
x: first.x,
|
|
168
|
+
y: first.y,
|
|
169
|
+
w: first.width,
|
|
170
|
+
h: first.height,
|
|
171
|
+
layer: inferRenderLayer(sprite.frames.values().toArray()),
|
|
172
|
+
...frames.length === sprite.sequence.length && frames.length > 1 && { frames },
|
|
173
|
+
...sprite.interpolate && { interpolate: true }
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
pages: packed.pages,
|
|
178
|
+
sprites,
|
|
179
|
+
missing,
|
|
180
|
+
failures,
|
|
181
|
+
padding: packed.padding
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
//#endregion
|
|
185
|
+
export { missingTexture as i, buildSpriteSheet as n, inferRenderLayer as r, MISSING_SPRITE as t };
|
package/dist/versions/prepare.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as prepareVersionResources, i as eraForVersion, n as GEOMETRY_DONOR_VERSIONS, r as compareVersions, t as Era } from "../prepare-
|
|
1
|
+
import { a as prepareVersionResources, i as eraForVersion, n as GEOMETRY_DONOR_VERSIONS, r as compareVersions, t as Era } from "../prepare-D49Gu4Lv.js";
|
|
2
2
|
export { Era, GEOMETRY_DONOR_VERSIONS, compareVersions, eraForVersion, prepareVersionResources };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ItemPipeline } from "../pipeline-
|
|
2
|
-
import { n as restoreResources } from "../descriptor-
|
|
1
|
+
import { t as ItemPipeline } from "../pipeline-BUIMzMzg.js";
|
|
2
|
+
import { n as restoreResources } from "../descriptor-JyXhfd-c.js";
|
|
3
3
|
import sharp from "sharp";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
5
|
//#region src/workers/render-worker.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodecraft/rendermite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Minecraft item icon renderer: renders inventory-identical item icons from vanilla and modded assets across game versions, outputting optimized PNG/WebP/AVIF plus CSS and a JSON item library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,140 +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-DoBv5S9v.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
|
-
/** `meta.json`, written last because it hashes every other file. */
|
|
123
|
-
interface BlockPackMetaFile {
|
|
124
|
-
generator: string;
|
|
125
|
-
version: string;
|
|
126
|
-
namespaces: string[];
|
|
127
|
-
counts: {
|
|
128
|
-
blocks: number;
|
|
129
|
-
models: number;
|
|
130
|
-
sprites: number;
|
|
131
|
-
pages: number;
|
|
132
|
-
/** Biomes in `biomes.json`; `0` means the pack has none and the file is absent. */
|
|
133
|
-
biomes: number;
|
|
134
|
-
failures: number;
|
|
135
|
-
};
|
|
136
|
-
/** sha256 per file, enough to verify a cached copy without refetching it. */
|
|
137
|
-
hashes: Record<string, string>;
|
|
138
|
-
}
|
|
139
|
-
//#endregion
|
|
140
|
-
export { BlockPackBlockStatesFile as a, BlockPackMetaFile as c, BlockPackRenderLayer as d, BlockPackSprite as f, BlockPackVariant as h, BlockPackBlockState as i, BlockPackModel as l, BlockPackTintsFile as m, BlockPackAtlasPage as n, BlockPackElement as o, BlockPackSpriteFrame as p, BlockPackBiomesFile as r, BlockPackFace as s, BlockPackAtlasFile as t, BlockPackModelsFile as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
|
|
2
|
-
import { n as MapResourceManager, t as KindFilteredResourceManager } from "./synthetic-rc9BPT4P.js";
|
|
3
2
|
import { t as JarResourceManager } from "./jar-W2cV2ZVO.js";
|
|
3
|
+
import { n as MapResourceManager, t as KindFilteredResourceManager } from "./synthetic-rc9BPT4P.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,6 +1,6 @@
|
|
|
1
1
|
import { a as scaleTextureAlpha, n as cloneFloatTexture, r as darkenTexture, s as tintTexture, u as uvWindow } from "./blend-KXMclcHk.js";
|
|
2
|
-
import { c as normalize, g as transformVector, h as transformDirection, m as sub, r as dot, t as cross } from "./vector-CCxLae_T.js";
|
|
3
2
|
import { a as drawTexturedTriangle, i as createFaceBuffer, n as clearFaceBuffer, o as phpRound, r as compactFaceBuffer, t as RowCursor } from "./rasterizer-DcVJzkxz.js";
|
|
3
|
+
import { c as normalize, g as transformVector, h as transformDirection, m as sub, r as dot, t as cross } from "./vector-CCxLae_T.js";
|
|
4
4
|
//#region src/render/face.ts
|
|
5
5
|
/**
|
|
6
6
|
* Face rendering: cull, transform, project, tint, darken, rasterize — a faithful
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
2
2
|
import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
|
|
3
|
-
import { n as MapResourceManager, t as KindFilteredResourceManager } from "./synthetic-rc9BPT4P.js";
|
|
4
3
|
import { t as JarResourceManager } from "./jar-W2cV2ZVO.js";
|
|
4
|
+
import { n as MapResourceManager, t as KindFilteredResourceManager } from "./synthetic-rc9BPT4P.js";
|
|
5
5
|
import { t as reshapeLegacyAssets } from "./legacy-reshape-CcdstKyI.js";
|
|
6
6
|
//#region src/versions/prepare.ts
|
|
7
7
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as modTintPackPath } from "./builtin-WkWjATeh.js";
|
|
2
2
|
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
3
|
+
import { a as defaultProperties, o as evaluateItemModel } from "./definition-ColsvWrH.js";
|
|
3
4
|
import { t as FolderResourceManager } from "./manager-BNibYkmI.js";
|
|
4
5
|
import { n as MapResourceManager } from "./synthetic-rc9BPT4P.js";
|
|
5
|
-
import { a as defaultProperties, o as evaluateItemModel } from "./definition-ColsvWrH.js";
|
|
6
6
|
//#region src/mods/tints.ts
|
|
7
7
|
/**
|
|
8
8
|
* Tints for mod items whose colors live in client code rather than asset JSON.
|