@nodecraft/rendermite 1.5.0 → 1.6.1
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 +2 -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 +45 -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 +1 -1
- package/dist/blocks/obj-mesh.js +1 -1
- package/dist/blocks/pack-format.d.ts +2 -2
- package/dist/blocks/sprite-sheet.d.ts +1 -1
- package/dist/classfile-BdLIk4Pe.d.ts +67 -0
- package/dist/classfile-Bo7FUrrD.js +287 -0
- package/dist/{cli-DMTaIbDI.js → cli-D2KJc_yl.js} +28 -4
- package/dist/cli.js +4 -4
- 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 +2 -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-DutR9Hdz.js → entity-fallback-Bth0fa7m.js} +1 -1
- package/dist/entity-geo-B2CkuMWx.js +100 -0
- package/dist/entity-models-_EZ3PVtN.js +127 -0
- package/dist/{export-wvt0Fryo.d.ts → export-B8tPsf4K.d.ts} +22 -1
- package/dist/{export-sadR0pWp.js → export-BfEIwSxY.js} +93 -1
- package/dist/geo-CmjrXu0G.d.ts +59 -0
- package/dist/{geo-BC8jtG5Q.js → geo-Desq-gRC.js} +6 -5
- package/dist/geo-model-Bo1gpEwX.js +163 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/inherit-ByHjOJX3.js +77 -0
- package/dist/jar-classes-CSRrPAUy.d.ts +41 -0
- package/dist/jar-classes-DCtELr1i.js +102 -0
- package/dist/link-5GmBLTzk.js +355 -0
- package/dist/mappings-BEPVaiwE.js +139 -0
- package/dist/mappings-DxX4KoZl.d.ts +75 -0
- package/dist/merge-NDYxpmL8.js +48 -0
- package/dist/model-PnQ4gV0-.d.ts +49 -0
- package/dist/model-bytecode-gWy5_uCj.js +742 -0
- package/dist/model-code-1Vuk-zj_.js +49 -0
- package/dist/model-code-BY44ao27.d.ts +16 -0
- package/dist/mods/prepare.js +1 -1
- package/dist/{obj-BaGvPUbb.js → obj-CJHEHpki.js} +5 -5
- package/dist/{obj-mesh-CazmV8ya.js → obj-mesh-JwPkZEWL.js} +1 -1
- package/dist/{pack-format-oRExIeD3.d.ts → pack-format-QcVFxG_b.d.ts} +100 -1
- package/dist/pack.d.ts +1 -1
- package/dist/{pipeline-AAfohoHU.js → pipeline-BUIMzMzg.js} +4 -4
- 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-UKgVb-kW.js → run-BQJkqc5f.js} +2 -2
- package/dist/run.js +1 -1
- package/dist/versions/prepare.js +1 -1
- package/dist/workers/render-worker.js +2 -2
- package/package.json +1 -1
- package/dist/{descriptor-D7VKgeGT.js → descriptor-JyXhfd-c.js} +1 -1
- package/dist/{face-CMJ3b3Ae.js → face-B2JjWT46.js} +1 -1
- package/dist/{prepare-8LswFoS-.js → prepare-D49Gu4Lv.js} +1 -1
- package/dist/{prepare-B_tRy9lB.js → prepare-Myd_ec4v.js} +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { t as parseClassFile } from "./classfile-Bo7FUrrD.js";
|
|
2
|
+
//#region src/entities/model-code.ts
|
|
3
|
+
/**
|
|
4
|
+
* Which classes in a jar count as model code, and their parsed form.
|
|
5
|
+
*
|
|
6
|
+
* The interpreter follows calls into model code and models the builder API abstractly instead, so the
|
|
7
|
+
* line between the two has to be drawn somewhere. It is drawn by name: everything with `model` in its
|
|
8
|
+
* path except the `client.model.geom` package, which is `CubeListBuilder`, `PartDefinition`, `PartPose`
|
|
9
|
+
* and friends. Following `CubeListBuilder.addBox` into its real implementation would interpret a list
|
|
10
|
+
* append and lose the box.
|
|
11
|
+
*
|
|
12
|
+
* The name tested is the *original* one, so an obfuscated jar needs its mappings. Which is fine: they
|
|
13
|
+
* are already loaded to find the model classes at all.
|
|
14
|
+
*/
|
|
15
|
+
function isModelCode(name) {
|
|
16
|
+
const lower = name.toLowerCase();
|
|
17
|
+
return lower.includes("model") && !lower.includes("geom");
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reads every model class in a jar, ready to interpret.
|
|
21
|
+
*
|
|
22
|
+
* Read up front because interpretation is synchronous and a call's target is only known once it is
|
|
23
|
+
* reached. Parsing stays lazy: a jar has a few hundred of these and a model only ever calls a handful.
|
|
24
|
+
*/
|
|
25
|
+
async function loadModelCode(names, read, originalOf) {
|
|
26
|
+
const code = /* @__PURE__ */ new Map();
|
|
27
|
+
for (const name of names) {
|
|
28
|
+
if (!isModelCode(originalOf?.(name) ?? name)) continue;
|
|
29
|
+
const bytes = await read(name);
|
|
30
|
+
if (bytes) code.set(name.replaceAll(".", "/"), bytes);
|
|
31
|
+
}
|
|
32
|
+
const parsed = /* @__PURE__ */ new Map();
|
|
33
|
+
return { resolve: (name) => {
|
|
34
|
+
const internalName = name.replaceAll(".", "/");
|
|
35
|
+
if (!parsed.has(internalName)) {
|
|
36
|
+
const bytes = code.get(internalName);
|
|
37
|
+
let classFile;
|
|
38
|
+
try {
|
|
39
|
+
classFile = bytes ? parseClassFile(bytes) : null;
|
|
40
|
+
} catch {
|
|
41
|
+
classFile = null;
|
|
42
|
+
}
|
|
43
|
+
parsed.set(internalName, classFile);
|
|
44
|
+
}
|
|
45
|
+
return parsed.get(internalName) ?? null;
|
|
46
|
+
} };
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { loadModelCode as n, isModelCode as t };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as ClassFile } from "./classfile-BdLIk4Pe.js";
|
|
2
|
+
//#region src/entities/model-code.d.ts
|
|
3
|
+
interface ModelCode {
|
|
4
|
+
/** The parsed class, when it is model code a call may be followed into. */
|
|
5
|
+
resolve: (internalName: string) => ClassFile | null;
|
|
6
|
+
}
|
|
7
|
+
declare function isModelCode(name: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Reads every model class in a jar, ready to interpret.
|
|
10
|
+
*
|
|
11
|
+
* Read up front because interpretation is synchronous and a call's target is only known once it is
|
|
12
|
+
* reached. Parsing stays lazy: a jar has a few hundred of these and a model only ever calls a handful.
|
|
13
|
+
*/
|
|
14
|
+
declare function loadModelCode(names: Iterable<string>, read: (internalName: string) => Promise<Uint8Array | null>, originalOf?: (internalName: string) => string): Promise<ModelCode>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { isModelCode as n, loadModelCode as r, ModelCode as t };
|
package/dist/mods/prepare.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as prepareModResources, t as LOADER_NAMESPACES } from "../prepare-
|
|
1
|
+
import { n as prepareModResources, t as LOADER_NAMESPACES } from "../prepare-Myd_ec4v.js";
|
|
2
2
|
export { LOADER_NAMESPACES, prepareModResources };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
2
|
-
import { c as normalize, g as transformVector, m as sub, n as displayMatrix, o as identity, r as dot, s as multiply, t as cross } from "./vector-CCxLae_T.js";
|
|
3
|
-
import { i as resolveTexture } from "./loader-C-NuJaEi.js";
|
|
4
2
|
import { l as toFloatTexture, n as cloneFloatTexture, r as darkenTexture, s as tintTexture, t as blendPixel } from "./blend-KXMclcHk.js";
|
|
5
|
-
import { c as lightsForProfile } from "./lighting--5myudVu.js";
|
|
6
|
-
import { a as drawTexturedTriangle, i as createFaceBuffer, n as clearFaceBuffer, o as phpRound, t as RowCursor } from "./rasterizer-DcVJzkxz.js";
|
|
7
3
|
import { t as combineFaceBuffers } from "./compose-BGsNFR12.js";
|
|
8
|
-
import { n as
|
|
4
|
+
import { a as drawTexturedTriangle, i as createFaceBuffer, n as clearFaceBuffer, o as phpRound, t as RowCursor } from "./rasterizer-DcVJzkxz.js";
|
|
5
|
+
import { c as normalize, g as transformVector, m as sub, n as displayMatrix, o as identity, r as dot, s as multiply, t as cross } from "./vector-CCxLae_T.js";
|
|
6
|
+
import { n as faceMaxZ, r as renderFace, t as createShadeCache } from "./face-B2JjWT46.js";
|
|
7
|
+
import { c as lightsForProfile } from "./lighting--5myudVu.js";
|
|
8
|
+
import { i as resolveTexture } from "./loader-C-NuJaEi.js";
|
|
9
9
|
import { t as paintBucketFluid } from "./fluid-bucket-B-I4ZYHl.js";
|
|
10
10
|
import { r as buildElementFaces } from "./geometry-Bi-Bf5rb.js";
|
|
11
11
|
//#region src/render/renderer.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
2
|
-
import { n as parseMtl, r as parseObj, t as materialTexture } from "./obj-
|
|
2
|
+
import { n as parseMtl, r as parseObj, t as materialTexture } from "./obj-CJHEHpki.js";
|
|
3
3
|
//#region src/blocks/obj-mesh.ts
|
|
4
4
|
/**
|
|
5
5
|
* OBJ geometry as pack data.
|
|
@@ -158,6 +158,101 @@ interface BlockPackItemsFile {
|
|
|
158
158
|
sprites: Record<string, BlockPackSprite>;
|
|
159
159
|
items: Record<string, ItemPackEntry>;
|
|
160
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
|
+
}
|
|
161
256
|
/** `meta.json`, written last because it hashes every other file. */
|
|
162
257
|
interface BlockPackMetaFile {
|
|
163
258
|
generator: string;
|
|
@@ -172,10 +267,14 @@ interface BlockPackMetaFile {
|
|
|
172
267
|
biomes: number;
|
|
173
268
|
/** Flat items in `items.json`; `0` means the pack has none and the file is absent. */
|
|
174
269
|
items: number;
|
|
270
|
+
/** Entity types in `entities.json`; `0` means the pack has none and the file is absent. */
|
|
271
|
+
entities: number;
|
|
272
|
+
/** Distinct entity models in `entity-models.json`; `0` means the file is absent. */
|
|
273
|
+
entityModels: number;
|
|
175
274
|
failures: number;
|
|
176
275
|
};
|
|
177
276
|
/** sha256 per file, enough to verify a cached copy without refetching it. */
|
|
178
277
|
hashes: Record<string, string>;
|
|
179
278
|
}
|
|
180
279
|
//#endregion
|
|
181
|
-
export {
|
|
280
|
+
export { EntityPackPart as C, EntityPackModel as S, ItemPackLayer as T, BlockPackTintsFile as _, BlockPackBlockStatesFile as a, EntityPackCubeFace 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, ItemPackEntry as w, EntityPackEntry as x, EntityPackCube as y };
|
package/dist/pack.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { n as BiomeClimatePack, t as BiomeClimate } from "./biomes-CJDJQqJb.js";
|
|
|
2
2
|
import { a as BlockStateMultipartCase, d as matchesCondition, n as BlockProperties, o as BlockStateVariantCase, p as weightedVariantIndex, r as BlockStateDefinition, s as MultipartCondition, t as BlockModelVariant, u as evaluateBlockState } from "./blockstate-eval-BzznRcVY.js";
|
|
3
3
|
import { n as ObjMesh, t as MeshGroup } from "./obj-mesh-ydhVfLKs.js";
|
|
4
4
|
import { n as BlockTintPack, t as BlockTint } from "./tints-DoBv5S9v.js";
|
|
5
|
-
import { a as BlockPackBlockStatesFile, d as
|
|
5
|
+
import { _ as BlockPackTintsFile, a as BlockPackBlockStatesFile, d as BlockPackMetaFile, f as BlockPackModel, g as BlockPackSpriteFrame, h as BlockPackSprite, i as BlockPackBlockState, l as BlockPackFace, m as BlockPackRenderLayer, n as BlockPackAtlasPage, o as BlockPackElement, p as BlockPackModelsFile, r as BlockPackBiomesFile, t as BlockPackAtlasFile, v as BlockPackVariant } from "./pack-format-QcVFxG_b.js";
|
|
6
6
|
export { type BiomeClimate, type BiomeClimatePack, type BlockModelVariant, type BlockPackAtlasFile, type BlockPackAtlasPage, type BlockPackBiomesFile, type BlockPackBlockState, type BlockPackBlockStatesFile, type BlockPackElement, type BlockPackFace, type BlockPackMetaFile, type BlockPackModel, type BlockPackModelsFile, type BlockPackRenderLayer, type BlockPackSprite, type BlockPackSpriteFrame, type BlockPackTintsFile, type BlockPackVariant, type BlockProperties, type BlockStateDefinition, type BlockStateMultipartCase, type BlockStateVariantCase, type BlockTint, type BlockTintPack, type MeshGroup, type MultipartCondition, type ObjMesh, evaluateBlockState, matchesCondition, weightedVariantIndex };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
2
|
+
import { l as toFloatTexture, t as blendPixel } from "./blend-KXMclcHk.js";
|
|
3
|
+
import { a as renderGeo, t as findGeoForItem } from "./geo-Desq-gRC.js";
|
|
2
4
|
import { a as defaultProperties } from "./definition-ColsvWrH.js";
|
|
3
5
|
import { i as resolveItem } from "./discovery-CD0QqxSF.js";
|
|
4
6
|
import { t as ModelLoader } from "./loader-C-NuJaEi.js";
|
|
5
7
|
import { a as resolveTints } from "./tints-B3WQcPtx.js";
|
|
6
|
-
import { l as
|
|
7
|
-
import { c as renderModel, l as renderModelFrames, o as boxDownscale, s as pointResize } from "./obj-BaGvPUbb.js";
|
|
8
|
+
import { c as renderModel, l as renderModelFrames, o as boxDownscale, s as pointResize } from "./obj-CJHEHpki.js";
|
|
8
9
|
import { t as loadAtlasResolver } from "./registry-DlduyjtM.js";
|
|
9
10
|
import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
|
|
10
11
|
import { n as TextureLoader } from "./loader-C18GpurU.js";
|
|
11
12
|
import { t as encodeAnimatedIcon } from "./encode-LR9wxigC.js";
|
|
12
13
|
import { a as builtinDynamicResources } from "./generators-BCZVlWig.js";
|
|
13
|
-
import { a as spawnEggTints, i as renderEntityFallback, n as dyedVariantTint, r as renderDyedVariantFallback, t as dyeVariantName } from "./entity-fallback-
|
|
14
|
-
import { i as renderGeo, t as findGeoForItem } from "./geo-BC8jtG5Q.js";
|
|
14
|
+
import { a as spawnEggTints, i as renderEntityFallback, n as dyedVariantTint, r as renderDyedVariantFallback, t as dyeVariantName } from "./entity-fallback-Bth0fa7m.js";
|
|
15
15
|
import { t as legacyTintsForChain } from "./legacy-tints-l-541wgI.js";
|
|
16
16
|
import { n as defaultBlockStateModel, t as blockStateTransform } from "./blockstate-DVb8Mhxc.js";
|
|
17
17
|
import path from "node:path";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as spawnEggTints, i as renderEntityFallback, n as dyedVariantTint, r as renderDyedVariantFallback, t as dyeVariantName } from "../entity-fallback-
|
|
1
|
+
import { a as spawnEggTints, i as renderEntityFallback, n as dyedVariantTint, r as renderDyedVariantFallback, t as dyeVariantName } from "../entity-fallback-Bth0fa7m.js";
|
|
2
2
|
export { dyeVariantName, dyedVariantTint, renderDyedVariantFallback, renderEntityFallback, spawnEggTints };
|
package/dist/render/face.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as faceMaxZ, r as renderFace, t as createShadeCache } from "../face-
|
|
1
|
+
import { n as faceMaxZ, r as renderFace, t as createShadeCache } from "../face-B2JjWT46.js";
|
|
2
2
|
export { createShadeCache, faceMaxZ, renderFace };
|
package/dist/render/geo.d.ts
CHANGED
|
@@ -1,54 +1,2 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
|
|
3
|
-
import { i as TextureLoader } from "../loader-DUlx29PC.js";
|
|
4
|
-
import { n as FloatTexture } from "../blend-eT64Z6qm.js";
|
|
5
|
-
import { n as FaceGeometry } from "../geometry-Bkur58Vi.js";
|
|
6
|
-
import { i as RenderOptions } from "../renderer-C_DFi8DF.js";
|
|
7
|
-
//#region src/render/geo.d.ts
|
|
8
|
-
interface GeoCube {
|
|
9
|
-
origin?: number[];
|
|
10
|
-
size?: number[];
|
|
11
|
-
uv?: number[] | Record<string, {
|
|
12
|
-
uv: number[];
|
|
13
|
-
uv_size?: number[];
|
|
14
|
-
}>;
|
|
15
|
-
inflate?: number;
|
|
16
|
-
pivot?: number[];
|
|
17
|
-
rotation?: number[];
|
|
18
|
-
}
|
|
19
|
-
interface GeoBone {
|
|
20
|
-
name?: string;
|
|
21
|
-
parent?: string;
|
|
22
|
-
pivot?: number[];
|
|
23
|
-
rotation?: number[];
|
|
24
|
-
cubes?: GeoCube[];
|
|
25
|
-
}
|
|
26
|
-
interface GeoDescription {
|
|
27
|
-
texture_width?: number;
|
|
28
|
-
texture_height?: number;
|
|
29
|
-
}
|
|
30
|
-
interface GeoFile {
|
|
31
|
-
'minecraft:geometry'?: Array<{
|
|
32
|
-
description?: GeoDescription;
|
|
33
|
-
bones?: GeoBone[];
|
|
34
|
-
}>;
|
|
35
|
-
[key: string]: unknown;
|
|
36
|
-
}
|
|
37
|
-
interface ParsedGeo {
|
|
38
|
-
textureWidth: number;
|
|
39
|
-
textureHeight: number;
|
|
40
|
-
bones: GeoBone[];
|
|
41
|
-
}
|
|
42
|
-
/** Handles both the modern (1.12+) and legacy (`geometry.name` keyed) layouts. */
|
|
43
|
-
declare function parseGeo(json: GeoFile): ParsedGeo | null;
|
|
44
|
-
/** Convert a parsed geo into face geometry, unit-cube fitted with gui pose. */
|
|
45
|
-
declare function geoToFaces(geo: ParsedGeo): FaceGeometry[];
|
|
46
|
-
/** Conventional locations GeckoLib mods keep item geometry and textures. */
|
|
47
|
-
declare function findGeoForItem(resources: ResourceManager, id: string): Promise<{
|
|
48
|
-
geo: ParsedGeo;
|
|
49
|
-
texture: ResourceLocator;
|
|
50
|
-
} | null>;
|
|
51
|
-
/** Render a parsed geo with the standard block gui pose. */
|
|
52
|
-
declare function renderGeo(geo: ParsedGeo, texture: ResourceLocator, textures: TextureLoader, options: RenderOptions): Promise<FloatTexture | null>;
|
|
53
|
-
//#endregion
|
|
54
|
-
export { findGeoForItem, geoToFaces, parseGeo, renderGeo };
|
|
1
|
+
import { a as parseGeo, i as nameTokens, n as findGeoForItem, o as renderGeo, r as geoToFaces, t as ParsedGeo } from "../geo-CmjrXu0G.js";
|
|
2
|
+
export { ParsedGeo, findGeoForItem, geoToFaces, nameTokens, parseGeo, renderGeo };
|
package/dist/render/geo.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { findGeoForItem, geoToFaces, parseGeo, renderGeo };
|
|
1
|
+
import { a as renderGeo, i as parseGeo, n as geoToFaces, r as nameTokens, t as findGeoForItem } from "../geo-Desq-gRC.js";
|
|
2
|
+
export { findGeoForItem, geoToFaces, nameTokens, parseGeo, renderGeo };
|
package/dist/render/obj.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as renderObjModel, n as parseMtl, r as parseObj, t as materialTexture } from "../obj-
|
|
1
|
+
import { i as renderObjModel, n as parseMtl, r as parseObj, t as materialTexture } from "../obj-CJHEHpki.js";
|
|
2
2
|
export { materialTexture, parseMtl, parseObj, renderObjModel };
|
package/dist/render/pipeline.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ItemPipeline } from "../pipeline-
|
|
1
|
+
import { t as ItemPipeline } from "../pipeline-BUIMzMzg.js";
|
|
2
2
|
export { ItemPipeline };
|
package/dist/render/renderer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ItemRenderError, c as renderModel, l as renderModelFrames, o as boxDownscale, s as pointResize } from "../obj-
|
|
1
|
+
import { a as ItemRenderError, c as renderModel, l as renderModelFrames, o as boxDownscale, s as pointResize } from "../obj-CJHEHpki.js";
|
|
2
2
|
export { ItemRenderError, boxDownscale, pointResize, renderModel, renderModelFrames };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as restoreResources, t as describeResources } from "../descriptor-
|
|
1
|
+
import { n as restoreResources, t as describeResources } from "../descriptor-JyXhfd-c.js";
|
|
2
2
|
export { describeResources, restoreResources };
|
|
@@ -6,8 +6,8 @@ import { r as encodeRasterAsset } from "./encode-LR9wxigC.js";
|
|
|
6
6
|
import { t as classifyItemStyle } from "./item-styles-DjYRdyHi.js";
|
|
7
7
|
import { t as minifyStylesheet } from "./minify-bjMRmr5J.js";
|
|
8
8
|
import { t as generateStylesheet } from "./stylesheet-CovT3B2S.js";
|
|
9
|
-
import { t as ItemPipeline } from "./pipeline-
|
|
10
|
-
import { t as describeResources } from "./descriptor-
|
|
9
|
+
import { t as ItemPipeline } from "./pipeline-BUIMzMzg.js";
|
|
10
|
+
import { t as describeResources } from "./descriptor-JyXhfd-c.js";
|
|
11
11
|
import { t as WorkerRenderPool } from "./pool-CKGp1qup.js";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import os from "node:os";
|
package/dist/run.js
CHANGED
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.1",
|
|
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,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
|
-
import { c as normalize, g as transformVector, h as transformDirection, m as sub, r as dot, t as cross } from "./vector-CCxLae_T.js";
|
|
2
1
|
import { a as scaleTextureAlpha, n as cloneFloatTexture, r as darkenTexture, s as tintTexture, u as uvWindow } from "./blend-KXMclcHk.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 { n as LayeredResourceManager } from "./manager-BNibYkmI.js";
|
|
2
|
+
import { n as UnsafeJarError, t as JarResourceManager } from "./jar-W2cV2ZVO.js";
|
|
2
3
|
import { t as curatedModelOverrides } from "./models-CZjCOjs4.js";
|
|
3
4
|
import { t as synthesizeItemModels } from "./synthesize-jTjVjPAt.js";
|
|
4
5
|
import { n as harvestTintOverrides, t as curatedTintOverrides } from "./tints-BspVCz2G.js";
|
|
5
|
-
import { n as UnsafeJarError, t as JarResourceManager } from "./jar-W2cV2ZVO.js";
|
|
6
6
|
//#region src/mods/prepare.ts
|
|
7
7
|
/**
|
|
8
8
|
* Mod asset composition: mod jars layered under the vanilla base (vanilla wins
|