@nodecraft/rendermite 1.8.0 → 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/{pack-format-BqWf-DNc.d.ts → block-behaviour-9Tj_GIUC.d.ts} +287 -5
- 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 +3 -3
- 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 -174
- package/dist/blocks/light-bytecode.js +1 -1
- package/dist/blocks/light-eval.d.ts +1 -1
- package/dist/blocks/light.d.ts +11 -1
- package/dist/blocks/light.js +1 -1
- 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/{cli-Dw1Q5CPR.js → cli-xBcMuKA3.js} +10 -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-CmkIkDKL.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/geo-model.d.ts +1 -1
- package/dist/entities/inherit.d.ts +1 -1
- package/dist/entities/jar-classes.js +1 -1
- package/dist/entities/link.d.ts +1 -1
- package/dist/entities/mappings.d.ts +1 -1
- package/dist/entities/mappings.js +1 -1
- package/dist/entities/model-bytecode.d.ts +1 -1
- package/dist/{entity-models-BGiy3pey.js → entity-models-BYAxrTsk.js} +1 -1
- package/dist/entity-sizes-CpO1gA7p.js +194 -0
- package/dist/{export-t8X_oRws.js → export-CbG2Rx3i.js} +54 -5
- package/dist/{export-J13L9Lqu.d.ts → export-HEoqcV-Y.d.ts} +17 -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/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-CBYPMbw7.js → jar-DvofBm71.js} +2 -2
- package/dist/{jar-classes-CSm7qq1R.js → jar-classes-0wqWbTax.js} +2 -2
- package/dist/{light-CyRhYulM.js → light-CC3VMsjl.js} +37 -5
- package/dist/{light-bytecode-Cpyuxo9b.js → light-bytecode-DYxb6pJk.js} +80 -30
- package/dist/{light-eval-D9x0ufZx.d.ts → light-eval-DMjK6xnb.d.ts} +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-Ep6ko0rg.js → mappings-DEl_7xxQ.js} +18 -1
- package/dist/{mappings-USwcjtcH.d.ts → mappings-DhOPQTgV.d.ts} +5 -0
- 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 -6
- package/dist/{pipeline-DFuQa8ZT.d.ts → pipeline-DuPF3sap.d.ts} +3 -3
- package/dist/{pipeline-CRTQGba7.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-C61BcwFA.js → prepare-DkJkZXuQ.js} +2 -2
- package/dist/{prepare-DxPEu9mo.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-DYcem_Vv.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-CWQz6UkM.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-zx3kdSq4.js → zip-reader-onwEVMea.js} +4 -4
- package/package.json +1 -1
- package/dist/biomes-5ZwYxMYe.js +0 -384
- package/dist/biomes-CJDJQqJb.d.ts +0 -38
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { t as parseClassFile } from "./classfile-CiIDF3vc.js";
|
|
2
|
+
import { c as resolveMappings, t as MappingsUnavailableError } from "./mappings-DEl_7xxQ.js";
|
|
3
|
+
//#region src/blocks/entity-sizes.ts
|
|
4
|
+
/**
|
|
5
|
+
* Each entity type's hitbox, read out of the code that registers it.
|
|
6
|
+
*
|
|
7
|
+
* `EntityType.Builder.of(Cow::new, CREATURE).sized(0.9F, 1.4F)` is the only place a cow's size is
|
|
8
|
+
* stated, so a consumer drawing a stand-in box for a mob either reads it here or hardcodes a table
|
|
9
|
+
* that is a release behind. The two floats are always pushed right before the call, and the name is
|
|
10
|
+
* a string near it: before it in vanilla's `register("cow", …)`, after it in a mod's
|
|
11
|
+
* `build("name")`, or before the lambda a `DeferredRegister.register("name", () -> …)` was handed.
|
|
12
|
+
* A linear pass over each method finds all three without interpreting anything.
|
|
13
|
+
*
|
|
14
|
+
* 1.13 has no builder size (a mob set its own in its constructor) and no mappings to read the call by,
|
|
15
|
+
* so it gets none. Sizes are the base ones: a baby or a large slime scales its own at runtime.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* `sized` by every name a jar can call it: Mojang's (vanilla, NeoForge), Forge's SRG name, and
|
|
19
|
+
* Fabric's intermediary one, since a mod jar keeps whichever its loader compiles against.
|
|
20
|
+
*/
|
|
21
|
+
const SIZED_NAMES = /* @__PURE__ */ new Set([
|
|
22
|
+
"sized",
|
|
23
|
+
"m_20699_",
|
|
24
|
+
"method_17687"
|
|
25
|
+
]);
|
|
26
|
+
/** Operand bytes after each opcode that has a fixed number, for walking a method without decoding it. */
|
|
27
|
+
const OPERANDS = /* @__PURE__ */ new Map([
|
|
28
|
+
[16, 1],
|
|
29
|
+
[18, 1],
|
|
30
|
+
[21, 1],
|
|
31
|
+
[22, 1],
|
|
32
|
+
[23, 1],
|
|
33
|
+
[24, 1],
|
|
34
|
+
[25, 1],
|
|
35
|
+
[54, 1],
|
|
36
|
+
[55, 1],
|
|
37
|
+
[56, 1],
|
|
38
|
+
[57, 1],
|
|
39
|
+
[58, 1],
|
|
40
|
+
[169, 1],
|
|
41
|
+
[188, 1],
|
|
42
|
+
[17, 2],
|
|
43
|
+
[19, 2],
|
|
44
|
+
[20, 2],
|
|
45
|
+
[132, 2],
|
|
46
|
+
[167, 2],
|
|
47
|
+
[168, 2],
|
|
48
|
+
[198, 2],
|
|
49
|
+
[199, 2],
|
|
50
|
+
[178, 2],
|
|
51
|
+
[179, 2],
|
|
52
|
+
[180, 2],
|
|
53
|
+
[181, 2],
|
|
54
|
+
[182, 2],
|
|
55
|
+
[183, 2],
|
|
56
|
+
[184, 2],
|
|
57
|
+
[187, 2],
|
|
58
|
+
[189, 2],
|
|
59
|
+
[192, 2],
|
|
60
|
+
[193, 2],
|
|
61
|
+
[197, 3],
|
|
62
|
+
[185, 4],
|
|
63
|
+
[186, 4],
|
|
64
|
+
[200, 4],
|
|
65
|
+
[201, 4]
|
|
66
|
+
]);
|
|
67
|
+
/** Every instruction of a method, in order. */
|
|
68
|
+
function* instructions(code) {
|
|
69
|
+
let at = 0;
|
|
70
|
+
while (at < code.length) {
|
|
71
|
+
const op = code[at];
|
|
72
|
+
const start = at;
|
|
73
|
+
at++;
|
|
74
|
+
if (op >= 153 && op <= 166) at += 2;
|
|
75
|
+
else if (op === 170 || op === 171) {
|
|
76
|
+
at += (4 - at % 4) % 4;
|
|
77
|
+
const read = (offset) => code[offset] << 24 | code[offset + 1] << 16 | code[offset + 2] << 8 | code[offset + 3];
|
|
78
|
+
if (op === 170) {
|
|
79
|
+
const low = read(at + 4);
|
|
80
|
+
const high = read(at + 8);
|
|
81
|
+
at += 12 + (high - low + 1) * 4;
|
|
82
|
+
} else at += 8 + read(at + 4) * 8;
|
|
83
|
+
} else if (op === 196) at += code[at] === 132 ? 5 : 3;
|
|
84
|
+
else at += OPERANDS.get(op) ?? 0;
|
|
85
|
+
yield {
|
|
86
|
+
op,
|
|
87
|
+
index: op === 18 ? code[start + 1] : code[start + 1] << 8 | code[start + 2]
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function looksLikeId(text) {
|
|
92
|
+
return /^[a-z0-9_.\-/]+(?::[a-z0-9_.\-/]+)?$/.test(text) && text.length < 128;
|
|
93
|
+
}
|
|
94
|
+
/** A float as Java wrote it: `0.6F` widens to 0.6000000238418579, and 0.6 is what the code says. */
|
|
95
|
+
function float32(value) {
|
|
96
|
+
for (let digits = 1; digits < 10; digits++) {
|
|
97
|
+
const candidate = Number(value.toPrecision(digits));
|
|
98
|
+
if (Math.fround(candidate) === Math.fround(value)) return candidate;
|
|
99
|
+
}
|
|
100
|
+
return value;
|
|
101
|
+
}
|
|
102
|
+
async function collectEntitySizes(options) {
|
|
103
|
+
const sizes = /* @__PURE__ */ new Map();
|
|
104
|
+
const failures = [];
|
|
105
|
+
const names = await options.classes.list();
|
|
106
|
+
let mappings;
|
|
107
|
+
try {
|
|
108
|
+
({mappings} = await resolveMappings(options.version, options.cacheDir, async () => names));
|
|
109
|
+
} catch (err) {
|
|
110
|
+
if (!(err instanceof MappingsUnavailableError)) throw err;
|
|
111
|
+
failures.push({
|
|
112
|
+
id: options.version,
|
|
113
|
+
reason: `no entity sizes: ${err.message}`
|
|
114
|
+
});
|
|
115
|
+
return {
|
|
116
|
+
sizes,
|
|
117
|
+
failures
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const originalName = (owner, name, descriptor) => mappings.nameOf?.get(`${owner.replaceAll("/", ".")}.${name}${descriptor}`) ?? name;
|
|
121
|
+
const parsed = [];
|
|
122
|
+
for (const name of names) {
|
|
123
|
+
const bytes = await options.classes.read(name);
|
|
124
|
+
if (!bytes) continue;
|
|
125
|
+
try {
|
|
126
|
+
parsed.push(parseClassFile(bytes));
|
|
127
|
+
} catch {}
|
|
128
|
+
}
|
|
129
|
+
const keyNames = /* @__PURE__ */ new Map();
|
|
130
|
+
const lambdaNames = /* @__PURE__ */ new Map();
|
|
131
|
+
for (const classFile of parsed) for (const method of classFile.methods) {
|
|
132
|
+
if (!method.code) continue;
|
|
133
|
+
let last = null;
|
|
134
|
+
for (const { op, index } of instructions(method.code)) if (op === 18 || op === 19) {
|
|
135
|
+
const literal = classFile.literal(index);
|
|
136
|
+
if (typeof literal === "string" && looksLikeId(literal)) last = literal;
|
|
137
|
+
} else if (op === 179 && last !== null && method.name === "<clinit>") {
|
|
138
|
+
const field = classFile.reference(index);
|
|
139
|
+
if (field && /ResourceKey;$|^Ljava\/lang\/String;$/.test(field.descriptor)) keyNames.set(`${field.owner}.${field.name}`, last);
|
|
140
|
+
last = null;
|
|
141
|
+
} else if (op === 186 && last !== null) {
|
|
142
|
+
const target = classFile.lambdaTarget(index);
|
|
143
|
+
if (target) lambdaNames.set(`${target.owner}.${target.name}${target.descriptor}`, last);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
const idsByPath = /* @__PURE__ */ new Map();
|
|
147
|
+
for (const id of options.entityIds) {
|
|
148
|
+
const path = id.slice(id.indexOf(":") + 1);
|
|
149
|
+
idsByPath.set(path, [...idsByPath.get(path) ?? [], id]);
|
|
150
|
+
}
|
|
151
|
+
const vanillaClass = (name) => name.startsWith("net/minecraft/") || mappings.originalOf.has(name.replaceAll("/", "."));
|
|
152
|
+
const resolveId = (name, owner) => {
|
|
153
|
+
if (name.includes(":")) return options.entityIds.includes(name) ? name : null;
|
|
154
|
+
const candidates = idsByPath.get(name) ?? [];
|
|
155
|
+
const vanilla = vanillaClass(owner);
|
|
156
|
+
return candidates.find((id) => id.startsWith("minecraft:") === vanilla) ?? null;
|
|
157
|
+
};
|
|
158
|
+
for (const classFile of parsed) for (const method of classFile.methods) {
|
|
159
|
+
if (!method.code) continue;
|
|
160
|
+
let last = lambdaNames.get(`${classFile.thisClass}.${method.name}${method.descriptor}`) ?? null;
|
|
161
|
+
const floats = [];
|
|
162
|
+
let pending = null;
|
|
163
|
+
const settle = (name) => {
|
|
164
|
+
const id = pending && resolveId(name, classFile.thisClass);
|
|
165
|
+
if (pending && id && !sizes.has(id)) sizes.set(id, [float32(pending[0]), float32(pending[1])]);
|
|
166
|
+
pending = null;
|
|
167
|
+
};
|
|
168
|
+
for (const { op, index } of instructions(method.code)) if (op >= 11 && op <= 13) floats.push(op - 11);
|
|
169
|
+
else if (op === 18 || op === 19) {
|
|
170
|
+
const literal = classFile.literal(index);
|
|
171
|
+
if (typeof literal === "number" && classFile.constants[index]?.tag === "float") floats.push(literal);
|
|
172
|
+
else if (typeof literal === "string" && looksLikeId(literal)) {
|
|
173
|
+
if (pending) settle(literal);
|
|
174
|
+
last = literal;
|
|
175
|
+
}
|
|
176
|
+
} else if (op === 178) {
|
|
177
|
+
const field = classFile.reference(index);
|
|
178
|
+
const key = field && keyNames.get(`${field.owner}.${field.name}`);
|
|
179
|
+
if (key) last = key;
|
|
180
|
+
} else if (op === 182 || op === 185) {
|
|
181
|
+
const call = classFile.reference(index);
|
|
182
|
+
if (call && call.descriptor.startsWith("(FF)") && SIZED_NAMES.has(originalName(call.owner, call.name, call.descriptor)) && floats.length >= 2) {
|
|
183
|
+
pending = [floats.at(-2), floats.at(-1)];
|
|
184
|
+
if (last !== null) settle(last);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
sizes,
|
|
190
|
+
failures
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
//#endregion
|
|
194
|
+
export { instructions as n, collectEntitySizes as t };
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { r as buildBiomeClimates } from "./biomes-5ZwYxMYe.js";
|
|
2
1
|
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
2
|
+
import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-D6zXmFrO.js";
|
|
3
|
+
import { a as buildBiomeClimates } from "./biomes-BGOF6gRM.js";
|
|
3
4
|
import { n as blockEntityGeometry, r as synthesizeVariants, t as INVISIBLE_BLOCKS } from "./block-entities-C807EY2I.js";
|
|
4
5
|
import { a as parseBlockState, n as collectModels } from "./blockstate-eval-CV_LwUwj.js";
|
|
6
|
+
import { t as collectDatapack } from "./datapack-D6eH46ay.js";
|
|
5
7
|
import { a as salvageJson, i as resolveTexture, t as ModelLoader } from "./loader-qOH0Jynq.js";
|
|
6
8
|
import { t as enderStorageBlockModel } from "./ender-storage-Dgomp6r2.js";
|
|
7
9
|
import { t as collectEntities } from "./entities-rQ4TZjEo.js";
|
|
8
|
-
import { n as collectEntityGeometry } from "./entity-models-
|
|
10
|
+
import { n as collectEntityGeometry } from "./entity-models-BYAxrTsk.js";
|
|
11
|
+
import { t as collectEntitySizes } from "./entity-sizes-CpO1gA7p.js";
|
|
12
|
+
import { t as collectGameRules } from "./game-rules-DuLlFc7o.js";
|
|
9
13
|
import { t as geoBlockModel } from "./geo-blocks-W79q5A0f.js";
|
|
10
14
|
import { n as discoverItems } from "./discovery-CD0QqxSF.js";
|
|
11
15
|
import { t as collectItemSprites } from "./item-sprites-CwiEBEAJ.js";
|
|
12
|
-
import { n as
|
|
13
|
-
import { n as collectBlockLight } from "./light-CyRhYulM.js";
|
|
16
|
+
import { n as collectBlockLight } from "./light-CC3VMsjl.js";
|
|
14
17
|
import { n as buildObjMesh } from "./obj-mesh-BFhtTBXX.js";
|
|
15
18
|
import { n as buildSpriteSheet, t as MISSING_SPRITE } from "./sprite-sheet-LQAEtGkp.js";
|
|
19
|
+
import { t as readBlockStates } from "./states-BvoZA-ql.js";
|
|
16
20
|
import { n as buildBlockTints, t as UNREGISTERED_TINTS } from "./tints-Cl0r-Ol3.js";
|
|
17
21
|
import { t as loadAtlasResolver } from "./registry-DafxsAhG.js";
|
|
18
22
|
import { n as TextureLoader } from "./loader-CsgtBuBo.js";
|
|
@@ -695,6 +699,7 @@ async function exportBlockPack(options) {
|
|
|
695
699
|
}
|
|
696
700
|
}
|
|
697
701
|
let lightPack = {};
|
|
702
|
+
let behaviourPack = {};
|
|
698
703
|
if (options.classes) {
|
|
699
704
|
const collected = await collectBlockLight({
|
|
700
705
|
version,
|
|
@@ -709,9 +714,25 @@ async function exportBlockPack(options) {
|
|
|
709
714
|
kind: "light",
|
|
710
715
|
reason: failure.reason
|
|
711
716
|
});
|
|
717
|
+
behaviourPack = sortedByKey(collected.behaviour);
|
|
718
|
+
for (const failure of collected.behaviourFailures) failures.push({
|
|
719
|
+
id: failure.id,
|
|
720
|
+
kind: "behaviour",
|
|
721
|
+
reason: failure.reason
|
|
722
|
+
});
|
|
712
723
|
if (process.env.RENDERMITE_LIGHT_DEBUG) console.error(collected.notes.join("\n"));
|
|
713
724
|
}
|
|
714
|
-
const biomes = await buildBiomeClimates(resources, namespaces);
|
|
725
|
+
const biomes = await buildBiomeClimates(resources, namespaces, version);
|
|
726
|
+
const datapack = await collectDatapack(resources, namespaces);
|
|
727
|
+
for (const file of datapack.unreadable) failures.push({
|
|
728
|
+
id: file,
|
|
729
|
+
kind: "data",
|
|
730
|
+
reason: "datapack file is unreadable or not in the shape its folder implies; left out"
|
|
731
|
+
});
|
|
732
|
+
const tagCount = Object.values(datapack.tags).reduce((sum, registry) => sum + Object.keys(registry).length, 0);
|
|
733
|
+
const gameRules = options.classes && namespaces.includes("minecraft") ? await collectGameRules(options.classes) : {};
|
|
734
|
+
const states = options.reports === void 0 ? null : await readBlockStates(options.reports);
|
|
735
|
+
const statesPack = states === null ? null : Object.fromEntries(Object.entries(states).filter(([id]) => namespaces.includes(id.split(":", 1)[0])));
|
|
715
736
|
let itemPack = null;
|
|
716
737
|
let itemPages = [];
|
|
717
738
|
if (options.items ?? true) {
|
|
@@ -786,6 +807,21 @@ async function exportBlockPack(options) {
|
|
|
786
807
|
reason: failure.reason
|
|
787
808
|
});
|
|
788
809
|
if (options.classes) {
|
|
810
|
+
const sized = await collectEntitySizes({
|
|
811
|
+
classes: options.classes,
|
|
812
|
+
version,
|
|
813
|
+
cacheDir: options.cacheDir ?? output,
|
|
814
|
+
entityIds: Object.keys(collected.entities)
|
|
815
|
+
});
|
|
816
|
+
for (const [id, [width, height]] of sized.sizes) {
|
|
817
|
+
collected.entities[id].width = width;
|
|
818
|
+
collected.entities[id].height = height;
|
|
819
|
+
}
|
|
820
|
+
for (const failure of sized.failures) failures.push({
|
|
821
|
+
id: failure.id,
|
|
822
|
+
kind: "entity",
|
|
823
|
+
reason: failure.reason
|
|
824
|
+
});
|
|
789
825
|
const textureOf = /* @__PURE__ */ new Map();
|
|
790
826
|
for (const [id, entry] of Object.entries(collected.entities)) if (entry.texture) textureOf.set(id, entry.texture);
|
|
791
827
|
const geometry = await collectEntityGeometry({
|
|
@@ -904,7 +940,15 @@ async function exportBlockPack(options) {
|
|
|
904
940
|
await emit("blockstates.json", JSON.stringify(sortedByKey(blockStates)));
|
|
905
941
|
await emit("tints.json", JSON.stringify(tints.pack));
|
|
906
942
|
if (Object.keys(lightPack).length > 0) await emit("light.json", JSON.stringify(lightPack));
|
|
943
|
+
if (Object.keys(behaviourPack).length > 0) await emit("behaviour.json", JSON.stringify(behaviourPack));
|
|
907
944
|
if (Object.keys(biomes.pack).length > 0) await emit("biomes.json", JSON.stringify(sortedByKey(biomes.pack)));
|
|
945
|
+
if (tagCount > 0) {
|
|
946
|
+
const tags = Object.fromEntries(Object.entries(datapack.tags).map(([registry, entries]) => [registry, sortedByKey(entries)]));
|
|
947
|
+
await emit("tags.json", JSON.stringify(sortedByKey(tags)));
|
|
948
|
+
}
|
|
949
|
+
if (Object.keys(gameRules).length > 0) await emit("game-rules.json", JSON.stringify(sortedByKey(gameRules)));
|
|
950
|
+
if (statesPack !== null && Object.keys(statesPack).length > 0) await emit("states.json", JSON.stringify(sortedByKey(statesPack)));
|
|
951
|
+
if (Object.keys(datapack.advancements).length > 0) await emit("advancements.json", JSON.stringify(sortedByKey(datapack.advancements)));
|
|
908
952
|
for (const biome of biomes.unreadable) failures.push({
|
|
909
953
|
id: biome,
|
|
910
954
|
kind: "biome",
|
|
@@ -922,6 +966,11 @@ async function exportBlockPack(options) {
|
|
|
922
966
|
entities: Object.keys(entityPack ?? {}).length,
|
|
923
967
|
entityModels: Object.keys(entityModelPack?.models ?? {}).length,
|
|
924
968
|
light: Object.keys(lightPack).length,
|
|
969
|
+
behaviour: Object.keys(behaviourPack).length,
|
|
970
|
+
tags: tagCount,
|
|
971
|
+
advancements: Object.keys(datapack.advancements).length,
|
|
972
|
+
states: Object.keys(statesPack ?? {}).length,
|
|
973
|
+
gameRules: Object.keys(gameRules).length,
|
|
925
974
|
failures: failures.length
|
|
926
975
|
};
|
|
927
976
|
await emit("meta.json", JSON.stringify({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ResourceManager } from "./manager-
|
|
1
|
+
import { a as ResourceManager } from "./manager-Ct0dEOMg.js";
|
|
2
2
|
import { t as ClassSource } from "./jar-classes-CSRrPAUy.js";
|
|
3
3
|
//#region src/blocks/export.d.ts
|
|
4
4
|
interface ExportBlockPackOptions {
|
|
@@ -42,6 +42,11 @@ interface ExportBlockPackOptions {
|
|
|
42
42
|
classes?: ClassSource;
|
|
43
43
|
/** Where mappings cache; the jar cache directory. */
|
|
44
44
|
cacheDir?: string;
|
|
45
|
+
/**
|
|
46
|
+
* A data generator `reports` directory for this version (`java -jar server.jar --reports`). Its
|
|
47
|
+
* `blocks.json` becomes `states.json`; without it the pack has no full property sets or defaults.
|
|
48
|
+
*/
|
|
49
|
+
reports?: string;
|
|
45
50
|
onProgress?: (stage: string, done: number, total: number) => void;
|
|
46
51
|
}
|
|
47
52
|
interface BlockPackFailure {
|
|
@@ -50,7 +55,7 @@ interface BlockPackFailure {
|
|
|
50
55
|
* `intentional` is not a failure: it marks a block that is empty because the
|
|
51
56
|
* game draws nothing for it. Filter it out to get the real gaps.
|
|
52
57
|
*/
|
|
53
|
-
kind: 'blockstate' | 'model' | 'texture' | 'sprite' | 'geometry' | 'tint' | 'biome' | 'item' | 'entity' | 'light' | 'intentional';
|
|
58
|
+
kind: 'blockstate' | 'model' | 'texture' | 'sprite' | 'geometry' | 'tint' | 'biome' | 'item' | 'entity' | 'light' | 'behaviour' | 'data' | 'intentional';
|
|
54
59
|
reason: string;
|
|
55
60
|
}
|
|
56
61
|
interface BlockPackResult {
|
|
@@ -68,6 +73,16 @@ interface BlockPackResult {
|
|
|
68
73
|
entityModels: number;
|
|
69
74
|
/** Emitting blocks in `light.json`; `0` means the file was not written. */
|
|
70
75
|
light: number;
|
|
76
|
+
/** Blocks in `behaviour.json`; `0` means the file was not written. */
|
|
77
|
+
behaviour: number;
|
|
78
|
+
/** Tags across every registry in `tags.json`; `0` means the file was not written. */
|
|
79
|
+
tags: number;
|
|
80
|
+
/** Advancements in `advancements.json`; `0` means the file was not written. */
|
|
81
|
+
advancements: number;
|
|
82
|
+
/** Blocks in `states.json`; `0` means no reports were given and the file was not written. */
|
|
83
|
+
states: number;
|
|
84
|
+
/** Rules in `game-rules.json`; `0` means the file was not written. */
|
|
85
|
+
gameRules: number;
|
|
71
86
|
/** Files actually written — the only trustworthy success signal. */
|
|
72
87
|
writtenFiles: number;
|
|
73
88
|
failures: BlockPackFailure[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as FloatTexture } from "./blend-
|
|
1
|
+
import { n as FloatTexture } from "./blend-mJAeQB3C.js";
|
|
2
2
|
import { t as Mat4 } from "./vector-DRKRi4--.js";
|
|
3
3
|
import { n as FaceGeometry } from "./geometry--UzHu1Vh.js";
|
|
4
4
|
import { r as LightSource } from "./lighting-3FGRC3Af.js";
|
|
5
|
-
import { n as FaceBuffer } from "./rasterizer-
|
|
5
|
+
import { n as FaceBuffer } from "./rasterizer-DjnurUgD.js";
|
|
6
6
|
//#region src/render/face.d.ts
|
|
7
7
|
interface TintColor {
|
|
8
8
|
r: number;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { t as parseClassFile } from "./classfile-CiIDF3vc.js";
|
|
2
|
+
import { n as instructions } from "./entity-sizes-CpO1gA7p.js";
|
|
3
|
+
//#region src/blocks/game-rules.ts
|
|
4
|
+
/**
|
|
5
|
+
* The version's game rules: each one's name, whether it is on/off or a number, and its default.
|
|
6
|
+
*
|
|
7
|
+
* Rules are registered in `GameRules.<clinit>` and nowhere else, in three shapes over the years:
|
|
8
|
+
*
|
|
9
|
+
* - 1.13: `put("doFireTick", new Value("true", BOOLEAN_VALUE))`, the default a string.
|
|
10
|
+
* - 1.14–1.21: `register("doFireTick", UPDATES, BooleanValue.create(true))`.
|
|
11
|
+
* - 26.x: `registerBoolean("fire_spread_radius…", UPDATES, true)`, with the names now snake_case.
|
|
12
|
+
*
|
|
13
|
+
* All three push the name, then the default, then call something taking a `boolean` or an `int`, so a
|
|
14
|
+
* linear pass reads them without interpreting anything. The default is the *first* constant after
|
|
15
|
+
* the name because 26.x writes some as `DEBUG ? false : true`, whose second constant is the other arm.
|
|
16
|
+
*/
|
|
17
|
+
/** A rule every version has, spelled either way, to find the class that registers them. */
|
|
18
|
+
const MARKERS = /* @__PURE__ */ new Set(["keepInventory", "keep_inventory"]);
|
|
19
|
+
function isRuleName(text) {
|
|
20
|
+
return /^[a-z]\w*$/.test(text) && text.length < 64;
|
|
21
|
+
}
|
|
22
|
+
/** The first `boolean` or `int` a descriptor takes, which is the kind of value it was handed. */
|
|
23
|
+
function valueKind(descriptor) {
|
|
24
|
+
const args = descriptor.slice(1, descriptor.indexOf(")")).replaceAll(/L[^;]+;/g, "L");
|
|
25
|
+
if (args.includes("Z")) return "boolean";
|
|
26
|
+
return args.includes("I") ? "integer" : null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Every class naming a rule is a candidate, since a data fixer that renames them names them too; the
|
|
30
|
+
* one whose initialiser registers the most is the registry. Raw bytes are searched before anything is
|
|
31
|
+
* parsed, which keeps this to a handful of classes out of ten thousand.
|
|
32
|
+
*/
|
|
33
|
+
async function collectGameRules(classes) {
|
|
34
|
+
let best = {};
|
|
35
|
+
for (const name of await classes.list()) {
|
|
36
|
+
const bytes = await classes.read(name);
|
|
37
|
+
if (!bytes || ![...MARKERS].some((marker) => Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).includes(marker))) continue;
|
|
38
|
+
let classFile;
|
|
39
|
+
try {
|
|
40
|
+
classFile = parseClassFile(bytes);
|
|
41
|
+
} catch {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const rules = rulesRegisteredBy(classFile);
|
|
45
|
+
if (Object.keys(rules).length > Object.keys(best).length) best = rules;
|
|
46
|
+
}
|
|
47
|
+
return best;
|
|
48
|
+
}
|
|
49
|
+
/** Rules registered anywhere in the class: `<clinit>`, or the lambda 1.13 fills its map from. */
|
|
50
|
+
function rulesRegisteredBy(owner) {
|
|
51
|
+
const rules = {};
|
|
52
|
+
for (const method of owner.methods) if (method.code) Object.assign(rules, rulesIn(owner, method.code));
|
|
53
|
+
return rules;
|
|
54
|
+
}
|
|
55
|
+
function rulesIn(owner, code) {
|
|
56
|
+
const rules = {};
|
|
57
|
+
let name = null;
|
|
58
|
+
let first = null;
|
|
59
|
+
for (const { op, index } of instructions(code)) {
|
|
60
|
+
let constant = null;
|
|
61
|
+
if (op >= 2 && op <= 8) constant = op - 3;
|
|
62
|
+
else if (op === 16 || op === 17) constant = op === 16 ? index >> 8 << 24 >> 24 : index << 16 >> 16;
|
|
63
|
+
else if (op === 18 || op === 19) {
|
|
64
|
+
const literal = owner.literal(index);
|
|
65
|
+
if (typeof literal === "string" && (literal === "true" || literal === "false" || /^-?\d+$/.test(literal))) constant = literal;
|
|
66
|
+
else if (typeof literal === "string" && isRuleName(literal)) {
|
|
67
|
+
name = literal;
|
|
68
|
+
first = null;
|
|
69
|
+
continue;
|
|
70
|
+
} else if (typeof literal === "number") constant = literal;
|
|
71
|
+
}
|
|
72
|
+
if (constant !== null) {
|
|
73
|
+
first ??= constant;
|
|
74
|
+
if (name && typeof constant === "string") {
|
|
75
|
+
rules[name] = constant === "true" || constant === "false" ? {
|
|
76
|
+
type: "boolean",
|
|
77
|
+
default: constant === "true"
|
|
78
|
+
} : {
|
|
79
|
+
type: "integer",
|
|
80
|
+
default: Number(constant)
|
|
81
|
+
};
|
|
82
|
+
name = null;
|
|
83
|
+
}
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if ((op === 184 || op === 183) && name && first !== null) {
|
|
87
|
+
const call = owner.reference(index);
|
|
88
|
+
const kind = call ? valueKind(call.descriptor) : null;
|
|
89
|
+
if (kind) {
|
|
90
|
+
rules[name] = kind === "boolean" ? {
|
|
91
|
+
type: "boolean",
|
|
92
|
+
default: first !== 0
|
|
93
|
+
} : {
|
|
94
|
+
type: "integer",
|
|
95
|
+
default: Number(first)
|
|
96
|
+
};
|
|
97
|
+
name = null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return rules;
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
export { collectGameRules as t };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as ClassSource } from "./jar-classes-CSRrPAUy.js";
|
|
2
|
+
//#region src/blocks/game-rules.d.ts
|
|
3
|
+
interface GameRule {
|
|
4
|
+
type: 'boolean' | 'integer';
|
|
5
|
+
default: boolean | number;
|
|
6
|
+
}
|
|
7
|
+
/** `game-rules.json`: rule name, exactly as `level.dat` stores it, to its type and default. */
|
|
8
|
+
type GameRulePack = Record<string, GameRule>;
|
|
9
|
+
/**
|
|
10
|
+
* Every class naming a rule is a candidate, since a data fixer that renames them names them too; the
|
|
11
|
+
* one whose initialiser registers the most is the registry. Raw bytes are searched before anything is
|
|
12
|
+
* parsed, which keeps this to a handful of classes out of ten thousand.
|
|
13
|
+
*/
|
|
14
|
+
declare function collectGameRules(classes: ClassSource): Promise<GameRulePack>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { GameRulePack as n, collectGameRules as r, GameRule as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MapResourceManager } from "./synthetic-
|
|
1
|
+
import { n as MapResourceManager } from "./synthetic-CWtFtAkR.js";
|
|
2
2
|
//#region src/dynamic/generators.d.ts
|
|
3
3
|
declare const TRIM_MATERIALS: readonly ["quartz", "iron", "gold", "diamond", "netherite", "redstone", "copper", "emerald", "lapis", "amethyst", "resin"];
|
|
4
4
|
/** Materials with a darker variant used when the trim matches the armor metal. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "./locator-jDbdUeTd.js";
|
|
2
|
-
import { a as ResourceManager } from "./manager-
|
|
3
|
-
import { i as TextureLoader } from "./loader-
|
|
4
|
-
import { n as FloatTexture } from "./blend-
|
|
2
|
+
import { a as ResourceManager } from "./manager-Ct0dEOMg.js";
|
|
3
|
+
import { i as TextureLoader } from "./loader-C4gsX_wO.js";
|
|
4
|
+
import { n as FloatTexture } from "./blend-mJAeQB3C.js";
|
|
5
5
|
import { n as FaceGeometry } from "./geometry--UzHu1Vh.js";
|
|
6
|
-
import { i as RenderOptions } from "./renderer-
|
|
6
|
+
import { i as RenderOptions } from "./renderer-QgROYvPv.js";
|
|
7
7
|
//#region src/render/geo.d.ts
|
|
8
8
|
interface GeoCube {
|
|
9
9
|
origin?: number[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { n as ResourceLocator, t as InvalidResourceLocatorError } from "./locator-jDbdUeTd.js";
|
|
2
|
-
import { a as ResourceManager, i as ResourceKindName, n as LayeredResourceManager, r as ResourceKind, t as FolderResourceManager } from "./manager-
|
|
3
|
-
import { a as TextureMeta, i as TextureLoader, o as TextureResolutionError, r as Texture, t as AnimatedTexture } from "./loader-
|
|
4
|
-
import { d as parseAtlasSources, n as AtlasSource, r as AtlasSourceError, s as ResolvedSprite, t as AtlasResolver, u as createAtlasResolver } from "./sources-
|
|
5
|
-
import { a as PackedRect, i as PackedPage, n as PackOptions, o as packAtlas, r as PackedAtlas, t as PackEntry } from "./atlas-pack-
|
|
6
|
-
import {
|
|
7
|
-
import { a as resolveTexture, n as ModelResolutionError, o as salvageJson, r as ResolvedModel, t as ModelLoader } from "./loader-DSir1-P0.js";
|
|
2
|
+
import { a as ResourceManager, i as ResourceKindName, n as LayeredResourceManager, r as ResourceKind, t as FolderResourceManager } from "./manager-Ct0dEOMg.js";
|
|
3
|
+
import { a as TextureMeta, i as TextureLoader, o as TextureResolutionError, r as Texture, t as AnimatedTexture } from "./loader-C4gsX_wO.js";
|
|
4
|
+
import { d as parseAtlasSources, n as AtlasSource, r as AtlasSourceError, s as ResolvedSprite, t as AtlasResolver, u as createAtlasResolver } from "./sources-sFtealLJ.js";
|
|
5
|
+
import { a as PackedRect, i as PackedPage, n as PackOptions, o as packAtlas, r as PackedAtlas, t as PackEntry } from "./atlas-pack-BUadroKy.js";
|
|
6
|
+
import { c as buildBiomeClimates, i as LEGACY_BIOMES, l as parseBiomeClimate, n as BiomeClimatePack, o as PRE_JAR_BIOMES, r as DEFAULT_WATER_COLOR, s as VANILLA_BIOME_CLIMATES, t as BiomeClimate, u as vanillaBiomesFor } from "./biomes-CnnhDCnk.js";
|
|
8
7
|
import { a as BlockStateMultipartCase, d as matchesCondition, f as parseBlockState, i as BlockStateError, l as collectModels, 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";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { a as resolveTexture, n as ModelResolutionError, o as salvageJson, r as ResolvedModel, t as ModelLoader } from "./loader-BYyPIs9f.js";
|
|
9
|
+
import { i as buildObjMesh, n as ObjMesh, r as ObjMeshError, t as MeshGroup } from "./obj-mesh-CzL0lOlJ.js";
|
|
10
|
+
import { a as buildBlockTints, i as UNREGISTERED_TINTS, n as BlockTintPack, t as BlockTint } from "./tints-DwFmEkf3.js";
|
|
11
|
+
import { i as exportBlockPack, n as BlockPackResult, r as ExportBlockPackOptions, t as BlockPackFailure } from "./export-HEoqcV-Y.js";
|
|
12
|
+
import { s as builtinDynamicResources } from "./generators-hu_vk10m.js";
|
|
13
|
+
import { d as toFloatTexture, n as FloatTexture, u as toByteTexture } from "./blend-mJAeQB3C.js";
|
|
14
14
|
import { a as LightingProfileName, i as LightingProfile, r as LightSource, u as lightsForProfile } from "./lighting-3FGRC3Af.js";
|
|
15
|
-
import { a as RenderedFrames, c as renderModel, i as RenderOptions, l as renderModelFrames, o as boxDownscale, r as ItemRenderError, s as pointResize } from "./renderer-
|
|
15
|
+
import { a as RenderedFrames, c as renderModel, i as RenderOptions, l as renderModelFrames, o as boxDownscale, r as ItemRenderError, s as pointResize } from "./renderer-QgROYvPv.js";
|
|
16
16
|
import { c as defaultProperties, i as ItemRenderInstruction, l as evaluateItemModel, n as InvalidItemDefinitionError, o as TintDefinition, r as ItemProperties, s as UNKNOWN_MODEL } from "./definition-ricL7Jqf.js";
|
|
17
|
-
import { i as discoverItems, n as ItemDiscoveryOptions, o as resolveItem, r as ItemResolutionError, t as DiscoveredItem } from "./discovery-
|
|
18
|
-
import { a as resolveTint, i as parseTintValue, n as InvalidTinterDefinitionError, o as resolveTints, t as DYE_COLORS } from "./tints-
|
|
19
|
-
import { i as EncodedIcon, n as EncodeOptions, o as encodeAnimatedIcon, r as EncodedAnimatedIcon, s as encodeIcon, t as AnimatedEncodeOptions } from "./encode-
|
|
17
|
+
import { i as discoverItems, n as ItemDiscoveryOptions, o as resolveItem, r as ItemResolutionError, t as DiscoveredItem } from "./discovery-DWe_kX8W.js";
|
|
18
|
+
import { a as resolveTint, i as parseTintValue, n as InvalidTinterDefinitionError, o as resolveTints, t as DYE_COLORS } from "./tints-B0a1K11c.js";
|
|
19
|
+
import { i as EncodedIcon, n as EncodeOptions, o as encodeAnimatedIcon, r as EncodedAnimatedIcon, s as encodeIcon, t as AnimatedEncodeOptions } from "./encode-BNEYHHR0.js";
|
|
20
20
|
import { t as minifyStylesheet } from "./minify-CIV6enbr.js";
|
|
21
|
-
import { a as compareVersions, o as eraForVersion, s as prepareVersionResources } from "./prepare-
|
|
22
|
-
import { i as prepareModResources } from "./prepare-
|
|
21
|
+
import { a as compareVersions, o as eraForVersion, s as prepareVersionResources } from "./prepare-Ce5SpR7Y.js";
|
|
22
|
+
import { i as prepareModResources } from "./prepare-BPzsZI_S.js";
|
|
23
23
|
import { i as itemClass, n as StylesheetOptions, r as generateStylesheet, t as ItemStyle } from "./stylesheet-i-t_7sZ7.js";
|
|
24
|
-
import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-
|
|
25
|
-
import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-
|
|
26
|
-
export { type AnimatedEncodeOptions, AnimatedTexture, type AtlasResolver, type AtlasSource, AtlasSourceError, type BiomeClimate, type BiomeClimatePack, type BlockModelVariant, type BlockPackFailure, type BlockPackResult, type BlockProperties, type BlockStateDefinition, BlockStateError, type BlockStateMultipartCase, type BlockStateVariantCase, type BlockTint, type BlockTintPack, DEFAULT_WATER_COLOR, DYE_COLORS, type DiscoveredItem, type EncodeOptions, type EncodedAnimatedIcon, type EncodedIcon, type ExportBlockPackOptions, type FloatTexture, FolderResourceManager, InvalidItemDefinitionError, InvalidResourceLocatorError, InvalidTinterDefinitionError, type ItemDiscoveryOptions, type ItemFailure, type ItemProperties, ItemRenderError, type ItemRenderInstruction, ItemResolutionError, type ItemStyle, JarResourceManager, LayeredResourceManager, type LightSource, LightingProfile, type LightingProfileName, type MeshGroup, ModelLoader, ModelResolutionError, type MultipartCondition, type ObjMesh, ObjMeshError, type PackEntry, type PackOptions, type PackedAtlas, type PackedPage, type PackedRect, type RenderOptions, type RenderedFrames, type ResolvedModel, type ResolvedSprite, ResourceKind, type ResourceKindName, ResourceLocator, type ResourceManager, type RunOptions, type RunResult, type StylesheetOptions, type Texture, TextureLoader, type TextureMeta, TextureResolutionError, type TintDefinition, UNKNOWN_MODEL, UNREGISTERED_TINTS, UnsafeJarError, VANILLA_BIOME_CLIMATES, boxDownscale, buildBiomeClimates, buildBlockTints, buildObjMesh, builtinDynamicResources, collectModels, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateBlockState, evaluateItemModel, exportBlockPack, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, matchesCondition, minifyStylesheet, packAtlas, parseAtlasSources, parseBiomeClimate, parseBlockState, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture, weightedVariantIndex };
|
|
24
|
+
import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-CxB1qabg.js";
|
|
25
|
+
import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-4Jg7ufWK.js";
|
|
26
|
+
export { type AnimatedEncodeOptions, AnimatedTexture, type AtlasResolver, type AtlasSource, AtlasSourceError, type BiomeClimate, type BiomeClimatePack, type BlockModelVariant, type BlockPackFailure, type BlockPackResult, type BlockProperties, type BlockStateDefinition, BlockStateError, type BlockStateMultipartCase, type BlockStateVariantCase, type BlockTint, type BlockTintPack, DEFAULT_WATER_COLOR, DYE_COLORS, type DiscoveredItem, type EncodeOptions, type EncodedAnimatedIcon, type EncodedIcon, type ExportBlockPackOptions, type FloatTexture, FolderResourceManager, InvalidItemDefinitionError, InvalidResourceLocatorError, InvalidTinterDefinitionError, type ItemDiscoveryOptions, type ItemFailure, type ItemProperties, ItemRenderError, type ItemRenderInstruction, ItemResolutionError, type ItemStyle, JarResourceManager, LEGACY_BIOMES, LayeredResourceManager, type LightSource, LightingProfile, type LightingProfileName, type MeshGroup, ModelLoader, ModelResolutionError, type MultipartCondition, type ObjMesh, ObjMeshError, PRE_JAR_BIOMES, type PackEntry, type PackOptions, type PackedAtlas, type PackedPage, type PackedRect, type RenderOptions, type RenderedFrames, type ResolvedModel, type ResolvedSprite, ResourceKind, type ResourceKindName, ResourceLocator, type ResourceManager, type RunOptions, type RunResult, type StylesheetOptions, type Texture, TextureLoader, type TextureMeta, TextureResolutionError, type TintDefinition, UNKNOWN_MODEL, UNREGISTERED_TINTS, UnsafeJarError, VANILLA_BIOME_CLIMATES, boxDownscale, buildBiomeClimates, buildBlockTints, buildObjMesh, builtinDynamicResources, collectModels, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateBlockState, evaluateItemModel, exportBlockPack, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, matchesCondition, minifyStylesheet, packAtlas, parseAtlasSources, parseBiomeClimate, parseBlockState, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture, vanillaBiomesFor, weightedVariantIndex };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { i as parseBiomeClimate, n as VANILLA_BIOME_CLIMATES, r as buildBiomeClimates, t as DEFAULT_WATER_COLOR } from "./biomes-5ZwYxMYe.js";
|
|
2
1
|
import { n as ResourceLocator, t as InvalidResourceLocatorError } from "./locator-COMEtEn9.js";
|
|
2
|
+
import { n as LayeredResourceManager, r as ResourceKind, t as FolderResourceManager } from "./manager-D6zXmFrO.js";
|
|
3
|
+
import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-DvofBm71.js";
|
|
4
|
+
import { a as prepareVersionResources, i as eraForVersion, r as compareVersions } from "./prepare-DkJkZXuQ.js";
|
|
5
|
+
import { a as buildBiomeClimates, i as VANILLA_BIOME_CLIMATES, n as LEGACY_BIOMES, o as parseBiomeClimate, r as PRE_JAR_BIOMES, s as vanillaBiomesFor, t as DEFAULT_WATER_COLOR } from "./biomes-BGOF6gRM.js";
|
|
3
6
|
import { a as parseBlockState, i as matchesCondition, n as collectModels, o as weightedVariantIndex, r as evaluateBlockState, t as BlockStateError } from "./blockstate-eval-CV_LwUwj.js";
|
|
4
7
|
import { c as toByteTexture, l as toFloatTexture } from "./blend-KXMclcHk.js";
|
|
5
8
|
import { c as lightsForProfile, r as LightingProfile } from "./lighting--5myudVu.js";
|
|
@@ -8,19 +11,16 @@ import { a as ItemRenderError, c as renderModel, l as renderModelFrames, o as bo
|
|
|
8
11
|
import { a as defaultProperties, i as UNKNOWN_MODEL, n as InvalidItemDefinitionError, o as evaluateItemModel } from "./definition-ColsvWrH.js";
|
|
9
12
|
import { i as resolveItem, n as discoverItems, t as ItemResolutionError } from "./discovery-CD0QqxSF.js";
|
|
10
13
|
import { a as resolveTints, i as resolveTint, n as InvalidTinterDefinitionError, r as parseTintValue, t as DYE_COLORS } from "./tints-B3WQcPtx.js";
|
|
11
|
-
import { n as LayeredResourceManager, r as ResourceKind, t as FolderResourceManager } from "./manager-BNibYkmI.js";
|
|
12
|
-
import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-CBYPMbw7.js";
|
|
13
|
-
import { a as prepareVersionResources, i as eraForVersion, r as compareVersions } from "./prepare-C61BcwFA.js";
|
|
14
14
|
import { n as buildObjMesh, t as ObjMeshError } from "./obj-mesh-BFhtTBXX.js";
|
|
15
15
|
import { t as packAtlas } from "./atlas-pack-CoOih7By.js";
|
|
16
16
|
import { n as buildBlockTints, t as UNREGISTERED_TINTS } from "./tints-Cl0r-Ol3.js";
|
|
17
17
|
import { o as createAtlasResolver, s as parseAtlasSources, t as AtlasSourceError } from "./sources-DYY5Qu-t.js";
|
|
18
18
|
import { n as TextureLoader, r as TextureResolutionError, t as AnimatedTexture } from "./loader-CsgtBuBo.js";
|
|
19
|
-
import { t as exportBlockPack } from "./export-
|
|
20
|
-
import { n as prepareModResources } from "./prepare-
|
|
19
|
+
import { t as exportBlockPack } from "./export-CbG2Rx3i.js";
|
|
20
|
+
import { n as prepareModResources } from "./prepare-sj36BP90.js";
|
|
21
21
|
import { n as encodeIcon, t as encodeAnimatedIcon } from "./encode-LR9wxigC.js";
|
|
22
22
|
import { a as builtinDynamicResources } from "./generators-D6giKoab.js";
|
|
23
23
|
import { t as minifyStylesheet } from "./minify-bjMRmr5J.js";
|
|
24
24
|
import { n as itemClass, t as generateStylesheet } from "./stylesheet-CovT3B2S.js";
|
|
25
|
-
import { t as run } from "./run-
|
|
26
|
-
export { AnimatedTexture, AtlasSourceError, BlockStateError, DEFAULT_WATER_COLOR, DYE_COLORS, FolderResourceManager, InvalidItemDefinitionError, InvalidResourceLocatorError, InvalidTinterDefinitionError, ItemRenderError, ItemResolutionError, JarResourceManager, LayeredResourceManager, LightingProfile, ModelLoader, ModelResolutionError, ObjMeshError, ResourceKind, ResourceLocator, TextureLoader, TextureResolutionError, UNKNOWN_MODEL, UNREGISTERED_TINTS, UnsafeJarError, VANILLA_BIOME_CLIMATES, boxDownscale, buildBiomeClimates, buildBlockTints, buildObjMesh, builtinDynamicResources, collectModels, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateBlockState, evaluateItemModel, exportBlockPack, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, matchesCondition, minifyStylesheet, packAtlas, parseAtlasSources, parseBiomeClimate, parseBlockState, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture, weightedVariantIndex };
|
|
25
|
+
import { t as run } from "./run-5yX5KRiI.js";
|
|
26
|
+
export { AnimatedTexture, AtlasSourceError, BlockStateError, DEFAULT_WATER_COLOR, DYE_COLORS, FolderResourceManager, InvalidItemDefinitionError, InvalidResourceLocatorError, InvalidTinterDefinitionError, ItemRenderError, ItemResolutionError, JarResourceManager, LEGACY_BIOMES, LayeredResourceManager, LightingProfile, ModelLoader, ModelResolutionError, ObjMeshError, PRE_JAR_BIOMES, ResourceKind, ResourceLocator, TextureLoader, TextureResolutionError, UNKNOWN_MODEL, UNREGISTERED_TINTS, UnsafeJarError, VANILLA_BIOME_CLIMATES, boxDownscale, buildBiomeClimates, buildBlockTints, buildObjMesh, builtinDynamicResources, collectModels, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateBlockState, evaluateItemModel, exportBlockPack, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, matchesCondition, minifyStylesheet, packAtlas, parseAtlasSources, parseBiomeClimate, parseBlockState, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture, vanillaBiomesFor, weightedVariantIndex };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "../locator-jDbdUeTd.js";
|
|
2
|
-
import { a as ResourceManager } from "../manager-
|
|
2
|
+
import { a as ResourceManager } from "../manager-Ct0dEOMg.js";
|
|
3
3
|
import { t as Mat4 } from "../vector-DRKRi4--.js";
|
|
4
4
|
//#region src/items/blockstate.d.ts
|
|
5
5
|
interface ResolvedBlockState {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as langRegistry, i as discoverItems, n as ItemDiscoveryOptions, o as resolveItem, r as ItemResolutionError, t as DiscoveredItem } from "../discovery-
|
|
1
|
+
import { a as langRegistry, i as discoverItems, n as ItemDiscoveryOptions, o as resolveItem, r as ItemResolutionError, t as DiscoveredItem } from "../discovery-DWe_kX8W.js";
|
|
2
2
|
export { DiscoveredItem, ItemDiscoveryOptions, ItemResolutionError, discoverItems, langRegistry, resolveItem };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "./locator-jDbdUeTd.js";
|
|
2
|
-
import { a as ResourceManager, i as ResourceKindName, s as ResourceDescriptor } from "./manager-
|
|
2
|
+
import { a as ResourceManager, i as ResourceKindName, s as ResourceDescriptor } from "./manager-Ct0dEOMg.js";
|
|
3
3
|
//#region src/resources/jar.d.ts
|
|
4
4
|
/** Jar entries that could escape the archive get the whole jar rejected. */
|
|
5
5
|
declare function isUnsafeEntryPath(entryPath: string): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
2
|
-
import { r as ResourceKind } from "./manager-
|
|
3
|
-
import { t as openZip } from "./zip-reader-
|
|
2
|
+
import { r as ResourceKind } from "./manager-D6zXmFrO.js";
|
|
3
|
+
import { t as openZip } from "./zip-reader-onwEVMea.js";
|
|
4
4
|
//#region src/resources/jar.ts
|
|
5
5
|
/**
|
|
6
6
|
* Reads resources directly out of a jar/zip — no extraction step, unlike the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as openZip } from "./zip-reader-
|
|
2
|
-
import { n as UnsafeJarError, r as isUnsafeEntryPath } from "./jar-
|
|
1
|
+
import { t as openZip } from "./zip-reader-onwEVMea.js";
|
|
2
|
+
import { n as UnsafeJarError, r as isUnsafeEntryPath } from "./jar-DvofBm71.js";
|
|
3
3
|
//#region src/entities/jar-classes.ts
|
|
4
4
|
/**
|
|
5
5
|
* Reading `.class` entries out of a jar.
|