@nodecraft/rendermite 1.7.3 → 1.8.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/dist/atlas/registry.d.ts +1 -1
- package/dist/atlas/registry.js +1 -1
- package/dist/atlas/sources.d.ts +1 -1
- package/dist/atlas/sources.js +1 -1
- package/dist/blocks/cli.js +1 -1
- package/dist/blocks/ender-storage.d.ts +1 -1
- package/dist/blocks/entities.d.ts +1 -1
- package/dist/blocks/entity-models.d.ts +3 -3
- package/dist/blocks/entity-models.js +1 -1
- package/dist/blocks/export.d.ts +1 -1
- package/dist/blocks/export.js +1 -1
- package/dist/blocks/geo-blocks.d.ts +1 -1
- package/dist/blocks/item-sprites.d.ts +1 -1
- package/dist/blocks/light-bytecode.d.ts +174 -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 +38 -0
- package/dist/blocks/light.js +2 -0
- package/dist/blocks/pack-format.d.ts +2 -2
- package/dist/blocks/sprite-sheet.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-BuKutEzb.js → cli-Dw1Q5CPR.js} +5 -4
- package/dist/cli.js +5 -5
- package/dist/{descriptor-JyXhfd-c.js → descriptor-CmkIkDKL.js} +2 -2
- package/dist/entities/classfile.d.ts +1 -1
- package/dist/entities/classfile.js +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-BGiy3pey.js} +5 -5
- package/dist/{export-B8tPsf4K.d.ts → export-J13L9Lqu.d.ts} +3 -1
- package/dist/{export-CVXvPLv8.js → export-t8X_oRws.js} +23 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/{inherit-BYLi3Q28.js → inherit-BUn0Cve9.js} +2 -2
- package/dist/{jar-W2cV2ZVO.js → jar-CBYPMbw7.js} +1 -1
- package/dist/{jar-classes-3GVCJZT7.js → jar-classes-CSm7qq1R.js} +2 -2
- package/dist/light-CyRhYulM.js +582 -0
- package/dist/light-bytecode-Cpyuxo9b.js +1749 -0
- package/dist/light-eval-BsJJoSv4.js +23 -0
- package/dist/light-eval-D9x0ufZx.d.ts +13 -0
- package/dist/{link-5GmBLTzk.js → link-Cuhyrz07.js} +1 -1
- package/dist/{mappings-BEPVaiwE.js → mappings-Ep6ko0rg.js} +77 -9
- package/dist/{mappings-DxX4KoZl.d.ts → mappings-USwcjtcH.d.ts} +28 -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/mods/prepare.js +1 -1
- package/dist/mods/tints.js +1 -1
- package/dist/{pack-format-Baoc_aSZ.d.ts → pack-format-BqWf-DNc.d.ts} +23 -1
- package/dist/pack.d.ts +3 -2
- package/dist/pack.js +2 -1
- package/dist/{pipeline-Cci24Kb4.js → pipeline-CRTQGba7.js} +1 -1
- package/dist/{prepare-D49Gu4Lv.js → prepare-C61BcwFA.js} +2 -2
- package/dist/{prepare-Myd_ec4v.js → prepare-DxPEu9mo.js} +2 -2
- package/dist/{registry-DlduyjtM.js → registry-DafxsAhG.js} +1 -1
- package/dist/render/pipeline.js +1 -1
- package/dist/resources/descriptor.js +1 -1
- package/dist/resources/jar.js +1 -1
- package/dist/resources/zip-reader.js +1 -1
- package/dist/{run--oW_h01E.js → run-DYcem_Vv.js} +2 -2
- package/dist/run.js +1 -1
- package/dist/{sources-BlUriDCs.js → sources-DYY5Qu-t.js} +11 -2
- package/dist/{sources-DYYiyvRW.d.ts → sources-e5D09Jz_.d.ts} +7 -0
- package/dist/versions/prepare.js +1 -1
- package/dist/workers/render-worker.js +2 -2
- package/package.json +6 -6
- package/dist/{tints-BspVCz2G.js → tints-CWQz6UkM.js} +1 -1
- package/dist/{zip-reader-BSbJKUT1.js → zip-reader-zx3kdSq4.js} +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/blocks/light-eval.ts
|
|
2
|
+
/**
|
|
3
|
+
* The light a block emits in the given state, 0–15.
|
|
4
|
+
*
|
|
5
|
+
* A case applies when every property it names has that value on the state; the first that does wins,
|
|
6
|
+
* and `default` answers for the rest. A block absent from `light.json` emits nothing, so `undefined`
|
|
7
|
+
* is a valid entry and answers 0.
|
|
8
|
+
*/
|
|
9
|
+
function blockLightLevel(light, properties) {
|
|
10
|
+
if (light === void 0) return 0;
|
|
11
|
+
if (typeof light === "number") return light;
|
|
12
|
+
for (const entry of light.cases) {
|
|
13
|
+
let matches = true;
|
|
14
|
+
for (const [name, value] of Object.entries(entry.when)) if (properties?.[name] !== value) {
|
|
15
|
+
matches = false;
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
if (matches) return entry.level;
|
|
19
|
+
}
|
|
20
|
+
return light.default;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { blockLightLevel as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { n as BlockProperties } from "./blockstate-eval-BzznRcVY.js";
|
|
2
|
+
import { d as BlockPackLight } from "./pack-format-BqWf-DNc.js";
|
|
3
|
+
//#region src/blocks/light-eval.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The light a block emits in the given state, 0–15.
|
|
6
|
+
*
|
|
7
|
+
* A case applies when every property it names has that value on the state; the first that does wins,
|
|
8
|
+
* and `default` answers for the rest. A block absent from `light.json` emits nothing, so `undefined`
|
|
9
|
+
* is a valid entry and answers 0.
|
|
10
|
+
*/
|
|
11
|
+
declare function blockLightLevel(light: BlockPackLight | undefined, properties: BlockProperties | undefined): number;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { blockLightLevel as t };
|
|
@@ -27,6 +27,38 @@ import { existsSync } from "node:fs";
|
|
|
27
27
|
* than worked around.
|
|
28
28
|
*/
|
|
29
29
|
const VERSION_MANIFEST = "https://launchermeta.mojang.com/mc/game/version_manifest_v2.json";
|
|
30
|
+
const PRIMITIVE_DESCRIPTORS = {
|
|
31
|
+
void: "V",
|
|
32
|
+
boolean: "Z",
|
|
33
|
+
byte: "B",
|
|
34
|
+
char: "C",
|
|
35
|
+
short: "S",
|
|
36
|
+
int: "I",
|
|
37
|
+
long: "J",
|
|
38
|
+
float: "F",
|
|
39
|
+
double: "D"
|
|
40
|
+
};
|
|
41
|
+
/** A ProGuard type (`java.util.function.ToIntFunction`, `int[]`) as a JVM descriptor, class names untouched. */
|
|
42
|
+
function typeDescriptor(type) {
|
|
43
|
+
let dimensions = 0;
|
|
44
|
+
let base = type;
|
|
45
|
+
while (base.endsWith("[]")) {
|
|
46
|
+
base = base.slice(0, -2);
|
|
47
|
+
dimensions++;
|
|
48
|
+
}
|
|
49
|
+
const scalar = PRIMITIVE_DESCRIPTORS[base] ?? `L${base.replaceAll(".", "/")};`;
|
|
50
|
+
return `${"[".repeat(dimensions)}${scalar}`;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A descriptor with every class in it renamed through the map: `(Lnet/minecraft/…/Block;)V` on an
|
|
54
|
+
* obfuscated jar is `(Ldfy;)V`. Unmapped classes — `java/lang/String`, a mod's own — stay as they are.
|
|
55
|
+
*/
|
|
56
|
+
function remapDescriptor(descriptor, obfuscatedOf) {
|
|
57
|
+
return descriptor.replaceAll(/L([^;]+);/g, (whole, name) => {
|
|
58
|
+
const mapped = obfuscatedOf.get(name.replaceAll("/", "."));
|
|
59
|
+
return mapped ? `L${mapped.replaceAll(".", "/")};` : whole;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
30
62
|
var MappingsUnavailableError = class extends Error {
|
|
31
63
|
constructor(message, options) {
|
|
32
64
|
super(message, options);
|
|
@@ -58,23 +90,57 @@ async function downloadClientMappings(version, cacheDir) {
|
|
|
58
90
|
await rename(partial, target);
|
|
59
91
|
return target;
|
|
60
92
|
}
|
|
61
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* Parses a ProGuard mapping file: the class lines, and the member lines under each.
|
|
95
|
+
*
|
|
96
|
+
* Members were skipped for years because the geometry extractor works on descriptor shape rather
|
|
97
|
+
* than member names. Block light needs them: it follows a mod's `Blocks.TORCH` into the client jar,
|
|
98
|
+
* and that is a field rename the class map alone cannot make.
|
|
99
|
+
*
|
|
100
|
+
* A method line is `[start:end:]returnType name(paramTypes) -> obf`; the line numbers are dropped
|
|
101
|
+
* and the types become a JVM descriptor in the *original* names, which is how a mod's constant pool
|
|
102
|
+
* spells the reference and so is the key a lookup arrives with.
|
|
103
|
+
*/
|
|
62
104
|
function parseMappings(text) {
|
|
63
105
|
const obfuscatedOf = /* @__PURE__ */ new Map();
|
|
64
106
|
const originalOf = /* @__PURE__ */ new Map();
|
|
107
|
+
const fieldOf = /* @__PURE__ */ new Map();
|
|
108
|
+
const methodOf = /* @__PURE__ */ new Map();
|
|
109
|
+
let owner = "";
|
|
65
110
|
for (const line of text.split("\n")) {
|
|
66
|
-
if (line.length === 0 || line.startsWith("
|
|
111
|
+
if (line.length === 0 || line.startsWith("#")) continue;
|
|
67
112
|
const divider = line.indexOf(" -> ");
|
|
68
113
|
if (divider === -1) continue;
|
|
69
|
-
const original = line.slice(0, divider).trim();
|
|
70
114
|
const obfuscated = line.slice(divider + 4).trim().replace(/:$/, "");
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
|
|
115
|
+
if (obfuscated.length === 0) continue;
|
|
116
|
+
if (!line.startsWith(" ") && !line.startsWith(" ")) {
|
|
117
|
+
owner = line.slice(0, divider).trim();
|
|
118
|
+
if (owner.length > 0) {
|
|
119
|
+
obfuscatedOf.set(owner, obfuscated);
|
|
120
|
+
originalOf.set(obfuscated, owner);
|
|
121
|
+
}
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const member = line.slice(0, divider).trim().replace(/^\d+:\d+:/, "");
|
|
125
|
+
const space = member.indexOf(" ");
|
|
126
|
+
if (space === -1 || owner.length === 0) continue;
|
|
127
|
+
const returnType = member.slice(0, space);
|
|
128
|
+
const signature = member.slice(space + 1);
|
|
129
|
+
const open = signature.indexOf("(");
|
|
130
|
+
if (open === -1) {
|
|
131
|
+
fieldOf.set(`${owner}.${signature}`, obfuscated);
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
const name = signature.slice(0, open);
|
|
135
|
+
const params = signature.slice(open + 1, -1);
|
|
136
|
+
const descriptor = `(${params.length === 0 ? "" : params.split(",").map((param) => typeDescriptor(param.trim())).join("")})${typeDescriptor(returnType)}`;
|
|
137
|
+
methodOf.set(`${owner}.${name}${descriptor}`, obfuscated);
|
|
74
138
|
}
|
|
75
139
|
return {
|
|
76
140
|
obfuscatedOf,
|
|
77
|
-
originalOf
|
|
141
|
+
originalOf,
|
|
142
|
+
fieldOf,
|
|
143
|
+
methodOf
|
|
78
144
|
};
|
|
79
145
|
}
|
|
80
146
|
async function loadMappings(version, cacheDir) {
|
|
@@ -96,7 +162,9 @@ function identityMappings(internalNames) {
|
|
|
96
162
|
}
|
|
97
163
|
return {
|
|
98
164
|
obfuscatedOf,
|
|
99
|
-
originalOf
|
|
165
|
+
originalOf,
|
|
166
|
+
fieldOf: /* @__PURE__ */ new Map(),
|
|
167
|
+
methodOf: /* @__PURE__ */ new Map()
|
|
100
168
|
};
|
|
101
169
|
}
|
|
102
170
|
/**
|
|
@@ -136,4 +204,4 @@ async function resolveMappings(version, cacheDir, listClasses) {
|
|
|
136
204
|
}
|
|
137
205
|
}
|
|
138
206
|
//#endregion
|
|
139
|
-
export { loadMappings as a, isObfuscated as i, downloadClientMappings as n, parseMappings as o, identityMappings as r,
|
|
207
|
+
export { loadMappings as a, resolveMappings as c, isObfuscated as i, downloadClientMappings as n, parseMappings as o, identityMappings as r, remapDescriptor as s, MappingsUnavailableError as t };
|
|
@@ -29,7 +29,23 @@ interface Mappings {
|
|
|
29
29
|
obfuscatedOf: Map<string, string>;
|
|
30
30
|
/** `fvd` → `net.minecraft.client.model.CowModel`. */
|
|
31
31
|
originalOf: Map<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Members, for code that names the game's classes by their *original* names against a jar that
|
|
34
|
+
* does not: a mod compiled against Mojang mappings calls `BlockBehaviour$Properties.ofFullCopy` and
|
|
35
|
+
* reads `Blocks.TORCH`, and following either into an obfuscated client means renaming both.
|
|
36
|
+
*
|
|
37
|
+
* Fields by `owner.name`, methods by `owner.name(descriptor)` — original names throughout, the
|
|
38
|
+
* descriptor in JVM form with original class names. Empty for an identity mapping, where nothing
|
|
39
|
+
* needs renaming.
|
|
40
|
+
*/
|
|
41
|
+
fieldOf: Map<string, string>;
|
|
42
|
+
methodOf: Map<string, string>;
|
|
32
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* A descriptor with every class in it renamed through the map: `(Lnet/minecraft/…/Block;)V` on an
|
|
46
|
+
* obfuscated jar is `(Ldfy;)V`. Unmapped classes — `java/lang/String`, a mod's own — stay as they are.
|
|
47
|
+
*/
|
|
48
|
+
declare function remapDescriptor(descriptor: string, obfuscatedOf: Map<string, string>): string;
|
|
33
49
|
declare class MappingsUnavailableError extends Error {
|
|
34
50
|
constructor(message: string, options?: ErrorOptions);
|
|
35
51
|
}
|
|
@@ -40,7 +56,17 @@ declare class MappingsUnavailableError extends Error {
|
|
|
40
56
|
* and the difference between "this version publishes none" and "the network failed" is worth keeping.
|
|
41
57
|
*/
|
|
42
58
|
declare function downloadClientMappings(version: string, cacheDir: string): Promise<string>;
|
|
43
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Parses a ProGuard mapping file: the class lines, and the member lines under each.
|
|
61
|
+
*
|
|
62
|
+
* Members were skipped for years because the geometry extractor works on descriptor shape rather
|
|
63
|
+
* than member names. Block light needs them: it follows a mod's `Blocks.TORCH` into the client jar,
|
|
64
|
+
* and that is a field rename the class map alone cannot make.
|
|
65
|
+
*
|
|
66
|
+
* A method line is `[start:end:]returnType name(paramTypes) -> obf`; the line numbers are dropped
|
|
67
|
+
* and the types become a JVM descriptor in the *original* names, which is how a mod's constant pool
|
|
68
|
+
* spells the reference and so is the key a lookup arrives with.
|
|
69
|
+
*/
|
|
44
70
|
declare function parseMappings(text: string): Mappings;
|
|
45
71
|
declare function loadMappings(version: string, cacheDir: string): Promise<Mappings>;
|
|
46
72
|
/**
|
|
@@ -72,4 +98,4 @@ declare function resolveMappings(version: string, cacheDir: string, listClasses:
|
|
|
72
98
|
obfuscated: boolean;
|
|
73
99
|
}>;
|
|
74
100
|
//#endregion
|
|
75
|
-
export { isObfuscated as a,
|
|
101
|
+
export { isObfuscated as a, remapDescriptor as c, identityMappings as i, resolveMappings as l, MappingsUnavailableError as n, loadMappings as o, downloadClientMappings as r, parseMappings as s, Mappings as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as parseClassFile } from "./classfile-
|
|
1
|
+
import { t as parseClassFile } from "./classfile-CiIDF3vc.js";
|
|
2
2
|
import { a as mergeModels, r as cubesOf, t as buildsOwnMesh } from "./merge-DeHruviG.js";
|
|
3
3
|
//#region src/entities/model-bytecode.ts
|
|
4
4
|
/**
|
|
@@ -870,4 +870,4 @@ function extractModel(bytes, following) {
|
|
|
870
870
|
return model;
|
|
871
871
|
}
|
|
872
872
|
//#endregion
|
|
873
|
-
export { extractModel as n, extractArmourMesh as t };
|
|
873
|
+
export { extractModel as n, parseDescriptor as r, extractArmourMesh 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-DxPEu9mo.js";
|
|
2
2
|
export { LOADER_NAMESPACES, prepareModResources };
|
package/dist/mods/tints.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as harvestTintOverrides, t as curatedTintOverrides } from "../tints-
|
|
1
|
+
import { n as harvestTintOverrides, t as curatedTintOverrides } from "../tints-CWQz6UkM.js";
|
|
2
2
|
export { curatedTintOverrides, harvestTintOverrides };
|
|
@@ -113,6 +113,26 @@ type BlockPackBlockState = {
|
|
|
113
113
|
};
|
|
114
114
|
/** `tints.json`. */
|
|
115
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>;
|
|
116
136
|
/**
|
|
117
137
|
* `biomes.json`, present only when the pack has biomes to describe: vanilla's
|
|
118
138
|
* whole table, or the ones a mod's datapack declares. Absent is not empty — a
|
|
@@ -319,10 +339,12 @@ interface BlockPackMetaFile {
|
|
|
319
339
|
entities: number;
|
|
320
340
|
/** Distinct entity models in `entity-models.json`; `0` means the file is absent. */
|
|
321
341
|
entityModels: number;
|
|
342
|
+
/** Emitting blocks in `light.json`; `0` means the file is absent. */
|
|
343
|
+
light: number;
|
|
322
344
|
failures: number;
|
|
323
345
|
};
|
|
324
346
|
/** sha256 per file, enough to verify a cached copy without refetching it. */
|
|
325
347
|
hashes: Record<string, string>;
|
|
326
348
|
}
|
|
327
349
|
//#endregion
|
|
328
|
-
export {
|
|
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 };
|
package/dist/pack.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ 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-CQX8a1F0.js";
|
|
5
|
-
import { _ as
|
|
6
|
-
|
|
5
|
+
import { _ as BlockPackSprite, a as BlockPackBlockStatesFile, b as BlockPackVariant, d as BlockPackLight, f as BlockPackLightFile, g as BlockPackRenderLayer, h as BlockPackModelsFile, i as BlockPackBlockState, l as BlockPackFace, m as BlockPackModel, n as BlockPackAtlasPage, o as BlockPackElement, p as BlockPackMetaFile, r as BlockPackBiomesFile, t as BlockPackAtlasFile, v as BlockPackSpriteFrame, y as BlockPackTintsFile } from "./pack-format-BqWf-DNc.js";
|
|
6
|
+
import { t as blockLightLevel } from "./light-eval-D9x0ufZx.js";
|
|
7
|
+
export { type BiomeClimate, type BiomeClimatePack, type BlockModelVariant, type BlockPackAtlasFile, type BlockPackAtlasPage, type BlockPackBiomesFile, type BlockPackBlockState, type BlockPackBlockStatesFile, type BlockPackElement, type BlockPackFace, type BlockPackLight, type BlockPackLightFile, 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, blockLightLevel, evaluateBlockState, matchesCondition, weightedVariantIndex };
|
package/dist/pack.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { i as matchesCondition, o as weightedVariantIndex, r as evaluateBlockState } from "./blockstate-eval-CV_LwUwj.js";
|
|
2
|
-
|
|
2
|
+
import { t as blockLightLevel } from "./light-eval-BsJJoSv4.js";
|
|
3
|
+
export { blockLightLevel, evaluateBlockState, matchesCondition, weightedVariantIndex };
|
|
@@ -6,8 +6,8 @@ import { a as renderGeo, t as findGeoForItem } from "./geo-BoDxwvz5.js";
|
|
|
6
6
|
import { a as defaultProperties } from "./definition-ColsvWrH.js";
|
|
7
7
|
import { i as resolveItem } from "./discovery-CD0QqxSF.js";
|
|
8
8
|
import { a as resolveTints } from "./tints-B3WQcPtx.js";
|
|
9
|
-
import { t as loadAtlasResolver } from "./registry-DlduyjtM.js";
|
|
10
9
|
import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
|
|
10
|
+
import { t as loadAtlasResolver } from "./registry-DafxsAhG.js";
|
|
11
11
|
import { n as TextureLoader } from "./loader-CsgtBuBo.js";
|
|
12
12
|
import { t as encodeAnimatedIcon } from "./encode-LR9wxigC.js";
|
|
13
13
|
import { a as builtinDynamicResources } from "./generators-D6giKoab.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
2
|
-
import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
|
|
3
|
-
import { t as JarResourceManager } from "./jar-W2cV2ZVO.js";
|
|
4
2
|
import { n as MapResourceManager, t as KindFilteredResourceManager } from "./synthetic-rc9BPT4P.js";
|
|
5
3
|
import { t as reshapeLegacyAssets } from "./legacy-reshape-CcdstKyI.js";
|
|
4
|
+
import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
|
|
5
|
+
import { t as JarResourceManager } from "./jar-CBYPMbw7.js";
|
|
6
6
|
//#region src/versions/prepare.ts
|
|
7
7
|
/**
|
|
8
8
|
* Version-era detection and asset preparation, replacing the file-tree surgery
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as LayeredResourceManager } from "./manager-BNibYkmI.js";
|
|
2
|
-
import { n as UnsafeJarError, t as JarResourceManager } from "./jar-
|
|
2
|
+
import { n as UnsafeJarError, t as JarResourceManager } from "./jar-CBYPMbw7.js";
|
|
3
3
|
import { t as curatedModelOverrides } from "./models-CZjCOjs4.js";
|
|
4
4
|
import { t as synthesizeItemModels } from "./synthesize-jTjVjPAt.js";
|
|
5
|
-
import { n as harvestTintOverrides, t as curatedTintOverrides } from "./tints-
|
|
5
|
+
import { n as harvestTintOverrides, t as curatedTintOverrides } from "./tints-CWQz6UkM.js";
|
|
6
6
|
//#region src/mods/prepare.ts
|
|
7
7
|
/**
|
|
8
8
|
* Mod asset composition: mod jars layered under the vanilla base (vanilla wins
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
2
|
-
import { o as createAtlasResolver, r as PalettedPermutationsSource, s as parseAtlasSources } from "./sources-
|
|
2
|
+
import { o as createAtlasResolver, r as PalettedPermutationsSource, s as parseAtlasSources } from "./sources-DYY5Qu-t.js";
|
|
3
3
|
//#region src/atlas/registry.ts
|
|
4
4
|
/**
|
|
5
5
|
* Collects every `atlases/*.json` across namespaces into one resolver.
|
package/dist/render/pipeline.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ItemPipeline } from "../pipeline-
|
|
1
|
+
import { t as ItemPipeline } from "../pipeline-CRTQGba7.js";
|
|
2
2
|
export { ItemPipeline };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as restoreResources, t as describeResources } from "../descriptor-
|
|
1
|
+
import { n as restoreResources, t as describeResources } from "../descriptor-CmkIkDKL.js";
|
|
2
2
|
export { describeResources, restoreResources };
|
package/dist/resources/jar.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "../jar-
|
|
1
|
+
import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "../jar-CBYPMbw7.js";
|
|
2
2
|
export { JarResourceManager, UnsafeJarError, isUnsafeEntryPath };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as openZip } from "../zip-reader-
|
|
1
|
+
import { t as openZip } from "../zip-reader-zx3kdSq4.js";
|
|
2
2
|
export { openZip };
|
|
@@ -6,8 +6,8 @@ import { r as encodeRasterAsset } from "./encode-LR9wxigC.js";
|
|
|
6
6
|
import { t as classifyItemStyle } from "./item-styles-BAeneY1R.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-CRTQGba7.js";
|
|
10
|
+
import { t as describeResources } from "./descriptor-CmkIkDKL.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
|
@@ -84,9 +84,18 @@ var PalettedPermutationsSource = class PalettedPermutationsSource {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* 26.3 moved palettes out of the texture tree: atlas palette ids resolve
|
|
89
|
+
* under textures/palettes/ (palette_key "minecraft:trim_base" is
|
|
90
|
+
* textures/palettes/trim_base.png). Older packs keep full texture paths, so
|
|
91
|
+
* the direct lookup is tried first.
|
|
92
|
+
*/
|
|
93
|
+
async loadPalette(locator) {
|
|
94
|
+
return await this.loadTexture(locator) ?? await this.loadTexture(new ResourceLocator(locator.namespace, `palettes/${locator.path}`));
|
|
95
|
+
}
|
|
87
96
|
async getKeyPalette() {
|
|
88
97
|
if (this.keyPalette) return this.keyPalette;
|
|
89
|
-
const keyTexture = await this.
|
|
98
|
+
const keyTexture = await this.loadPalette(ResourceLocator.parse(this.settings.palette_key));
|
|
90
99
|
if (!keyTexture) throw new AtlasSourceError(`Missing palette key ${this.settings.palette_key}`);
|
|
91
100
|
const palette = /* @__PURE__ */ new Map();
|
|
92
101
|
for (let index = 0; index < keyTexture.width * keyTexture.height; index++) {
|
|
@@ -104,7 +113,7 @@ var PalettedPermutationsSource = class PalettedPermutationsSource {
|
|
|
104
113
|
if (!sprite) return null;
|
|
105
114
|
const base = await this.loadTexture(sprite.base);
|
|
106
115
|
if (!base) return null;
|
|
107
|
-
const permutation = await this.
|
|
116
|
+
const permutation = await this.loadPalette(sprite.palette);
|
|
108
117
|
if (!permutation) return null;
|
|
109
118
|
const keyPalette = await this.getKeyPalette();
|
|
110
119
|
const data = new Uint8ClampedArray(base.data);
|
|
@@ -63,6 +63,13 @@ declare class PalettedPermutationsSource implements AtlasSource {
|
|
|
63
63
|
private keyPalette;
|
|
64
64
|
private readonly loadTexture;
|
|
65
65
|
constructor(settings: PalettedPermutationsSettings, loadTexture: (locator: ResourceLocator) => Promise<Texture | null>);
|
|
66
|
+
/**
|
|
67
|
+
* 26.3 moved palettes out of the texture tree: atlas palette ids resolve
|
|
68
|
+
* under textures/palettes/ (palette_key "minecraft:trim_base" is
|
|
69
|
+
* textures/palettes/trim_base.png). Older packs keep full texture paths, so
|
|
70
|
+
* the direct lookup is tried first.
|
|
71
|
+
*/
|
|
72
|
+
private loadPalette;
|
|
66
73
|
private getKeyPalette;
|
|
67
74
|
has(locator: ResourceLocator): boolean;
|
|
68
75
|
resolve(locator: ResourceLocator): Promise<ResolvedSprite | null>;
|
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-C61BcwFA.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-CRTQGba7.js";
|
|
2
|
+
import { n as restoreResources } from "../descriptor-CmkIkDKL.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.8.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",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"lightningcss": "1.33.0",
|
|
61
|
-
"sharp": "0.35.
|
|
61
|
+
"sharp": "0.35.4",
|
|
62
62
|
"yauzl": "3.4.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
"@types/node": "24.13.3",
|
|
68
68
|
"@types/yauzl": "3.4.0",
|
|
69
69
|
"@types/yazl": "3.3.1",
|
|
70
|
-
"eslint": "10.
|
|
70
|
+
"eslint": "10.9.1",
|
|
71
71
|
"rimraf": "6.1.3",
|
|
72
|
-
"rolldown": "1.2.
|
|
72
|
+
"rolldown": "1.2.6",
|
|
73
73
|
"semantic-release": "25.0.9",
|
|
74
74
|
"tsdown": "0.22.14",
|
|
75
75
|
"typescript": "6.0.3",
|
|
76
|
-
"typescript-eslint": "8.
|
|
77
|
-
"vitest": "4.1.
|
|
76
|
+
"typescript-eslint": "8.68.0",
|
|
77
|
+
"vitest": "4.1.11",
|
|
78
78
|
"yazl": "3.3.1"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -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
3
|
import { a as defaultProperties, o as evaluateItemModel } from "./definition-ColsvWrH.js";
|
|
4
|
-
import { t as FolderResourceManager } from "./manager-BNibYkmI.js";
|
|
5
4
|
import { n as MapResourceManager } from "./synthetic-rc9BPT4P.js";
|
|
5
|
+
import { t as FolderResourceManager } from "./manager-BNibYkmI.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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { close, createReadStream, fstat, open, read } from "node:fs";
|
|
2
|
-
import { Readable } from "node:stream";
|
|
3
2
|
import { RandomAccessReader, fromRandomAccessReader, open as open$1 } from "yauzl";
|
|
3
|
+
import { Readable } from "node:stream";
|
|
4
4
|
//#region src/resources/zip-reader.ts
|
|
5
5
|
/**
|
|
6
6
|
* Opens a zip with its central directory held in memory.
|