@nodecraft/rendermite 1.0.6 → 1.1.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/assets/README.md +6 -2
- package/assets/builtin/renderchest/models/item/trident.json +372 -0
- package/assets/builtin-legacy/renderchest/models/item/trident.json +372 -0
- package/assets/mod-models/README.md +130 -0
- package/assets/mod-models/ad_astra/models/item/tier_1_rocket.json +4559 -0
- package/assets/mod-models/ad_astra/models/item/tier_1_rover.json +6021 -0
- package/assets/mod-models/ad_astra/models/item/tier_2_rocket.json +6832 -0
- package/assets/mod-models/ad_astra/models/item/tier_3_rocket.json +8522 -0
- package/assets/mod-models/ad_astra/models/item/tier_4_rocket.json +7498 -0
- package/assets/mod-models/botania/models/item/avatar.json +574 -0
- package/assets/mod-models/botania/models/item/bellows.json +423 -0
- package/assets/mod-models/botania/models/item/brewery.json +894 -0
- package/assets/mod-models/botania/models/item/corporea_index.json +349 -0
- package/assets/mod-models/botania/models/item/gaia_pylon.json +1057 -0
- package/assets/mod-models/botania/models/item/hourglass.json +502 -0
- package/assets/mod-models/botania/models/item/mana_pylon.json +741 -0
- package/assets/mod-models/botania/models/item/natura_pylon.json +1057 -0
- package/assets/mod-models/botania/models/item/teru_teru_bozu.json +347 -0
- package/assets/mod-models/mekanism/models/item/atomic_disassembler.json +1391 -0
- package/assets/mod-models/mekanism/models/item/flamethrower.json +1926 -0
- package/assets/mod-models/mekanism/models/item/free_runners.json +595 -0
- package/assets/mod-models/mekanism/models/item/jetpack.json +1767 -0
- package/assets/mod-models/mekanism/models/item/scuba_mask.json +2305 -0
- package/assets/mod-models/mekanism/models/item/scuba_tank.json +833 -0
- package/assets/mod-tints/README.md +19 -0
- package/assets/mod-tints/mysticalagriculture/items/absorption_i_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/absorption_ii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/absorption_iii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/absorption_iv_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/absorption_v_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/attack_aoe_i_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/attack_aoe_ii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/attack_aoe_iii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/blindness_resistance_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/fire_resistance_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/flight_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/haste_i_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/haste_ii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/haste_iii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/health_boost_i_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/health_boost_ii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/health_boost_iii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/health_boost_iv_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/health_boost_v_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/hunger_resistance_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/jump_boost_i_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/jump_boost_ii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/jump_boost_iii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/luck_i_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/luck_ii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/luck_iii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/mining_aoe_i_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/mining_aoe_ii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/mining_aoe_iii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/mining_aoe_iv_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/mining_fatigue_resistance_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/nausea_resistance_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/night_vision_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/pathing_aoe_i_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/pathing_aoe_ii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/pathing_aoe_iii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/pathing_aoe_iv_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/poison_resistance_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/slow_falling_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/slowness_resistance_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/speed_i_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/speed_ii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/speed_iii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/step_assist_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/strength_i_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/strength_ii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/strength_iii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/tilling_aoe_i_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/tilling_aoe_ii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/tilling_aoe_iii_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/tilling_aoe_iv_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/water_breathing_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/weakness_resistance_augment.json +16 -0
- package/assets/mod-tints/mysticalagriculture/items/wither_resistance_augment.json +16 -0
- package/dist/atlas/registry.js +1 -1
- package/dist/blend-8lnfxtLe.d.ts +79 -0
- package/dist/blend-KXMclcHk.js +199 -0
- package/dist/blockstate-CdstnW2-.js +104 -0
- package/dist/{builtin-caYjESh0.js → builtin-WkWjATeh.js} +5 -1
- package/dist/builtin.d.ts +3 -1
- package/dist/builtin.js +2 -2
- package/dist/cli.js +5 -3
- package/dist/{compose-CQCb2LVv.js → compose-BGsNFR12.js} +1 -1
- package/dist/{definition-3MBm8ar_.js → definition-ColsvWrH.js} +20 -1
- package/dist/{definition-BwX6Xxv0.d.ts → definition-ricL7Jqf.d.ts} +2 -0
- package/dist/{discovery-0SM0cTLw.js → discovery-B9aqV_Rz.js} +13 -3
- package/dist/{discovery-wiJBGryo.d.ts → discovery-BPSUtdm4.d.ts} +1 -1
- package/dist/{encode-DaNQF28M.d.ts → encode-DNcXXvYe.d.ts} +1 -1
- package/dist/{encode-D6dQu2dJ.js → encode-LR9wxigC.js} +28 -12
- package/dist/{entity-fallback-BRCeGKBT.js → entity-fallback-BnFMSHS6.js} +180 -10
- package/dist/{face-DmCiHUd5.js → face-CMJ3b3Ae.js} +44 -18
- package/dist/face-cQ-pVHoe.d.ts +44 -0
- package/dist/{fluid-bucket-D-GpUQjg.js → fluid-bucket-BzoLofB_.js} +7 -2
- package/dist/{geo-Diky41Tw.js → geo-w9HHIrb5.js} +87 -13
- package/dist/{geometry-uIDha8S4.js → geometry-Bi-Bf5rb.js} +7 -1
- package/dist/{geometry-BSVmKx5b.d.ts → geometry-w0yQbzDZ.d.ts} +5 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +10 -10
- package/dist/items/blockstate.d.ts +23 -0
- package/dist/items/blockstate.js +2 -0
- package/dist/items/definition.d.ts +1 -1
- package/dist/items/definition.js +1 -1
- package/dist/items/discovery.d.ts +1 -1
- package/dist/items/discovery.js +1 -1
- package/dist/{loader-D22zZME7.d.ts → loader-DD83d80u.d.ts} +2 -1
- package/dist/{loader-B8NJO7pR.js → loader-DwkA9LR5.js} +267 -15
- package/dist/{loader-CfXMxcEV.js → loader-Lb0ZeILz.js} +19 -7
- package/dist/models/loader.d.ts +1 -1
- package/dist/models/loader.js +1 -1
- package/dist/models/types.d.ts +1 -1
- package/dist/models-BKxGkPS7.js +18 -0
- package/dist/mods/models.d.ts +5 -0
- package/dist/mods/models.js +2 -0
- package/dist/mods/prepare.d.ts +1 -1
- package/dist/mods/prepare.js +1 -1
- package/dist/mods/tints.js +1 -1
- package/dist/output/encode.d.ts +1 -1
- package/dist/output/encode.js +1 -1
- package/dist/{pipeline-BIk1RRIp.js → pipeline-BVYj7OP0.js} +72 -19
- package/dist/{pipeline-zq-yU3Te.d.ts → pipeline-CJNiQG-1.d.ts} +15 -5
- package/dist/{prepare-BESRrh6K.js → prepare-D56Z-9cg.js} +7 -2
- package/dist/{prepare-CPxO0kKz.d.ts → prepare-Dce7-HAe.d.ts} +8 -0
- package/dist/{rasterizer-yqJkicm1.d.ts → rasterizer-BSQHEhJ-.d.ts} +4 -2
- package/dist/{rasterizer-76qO8TDh.js → rasterizer-DcVJzkxz.js} +13 -5
- package/dist/{registry-B9TcjVbs.js → registry-DS5PZ57l.js} +8 -1
- package/dist/render/blend.d.ts +2 -2
- package/dist/render/blend.js +2 -2
- package/dist/render/compose.d.ts +2 -2
- package/dist/render/compose.js +1 -1
- package/dist/render/entity-fallback.d.ts +19 -5
- package/dist/render/entity-fallback.js +2 -2
- package/dist/render/face.d.ts +2 -2
- package/dist/render/face.js +2 -2
- package/dist/render/fluid-bucket.js +1 -1
- package/dist/render/geo.d.ts +3 -3
- package/dist/render/geo.js +1 -1
- package/dist/render/geometry.d.ts +1 -1
- package/dist/render/geometry.js +1 -1
- package/dist/render/legacy-tints.d.ts +1 -1
- package/dist/render/obj.d.ts +5 -3
- package/dist/render/obj.js +1 -1
- 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/rasterizer.js +1 -1
- package/dist/render/renderer.d.ts +1 -1
- package/dist/render/renderer.js +1 -1
- package/dist/render/tints.d.ts +1 -1
- package/dist/render/tints.js +1 -1
- package/dist/{renderer-DVsZHAvf.d.ts → renderer-C79EQDSn.d.ts} +3 -3
- package/dist/{renderer-CjT19tHd.js → renderer-oi1MSF3Y.js} +36 -19
- package/dist/{run-BnICOF4I.js → run-C6AP3Bn8.js} +3 -3
- package/dist/{run-CKUtynTy.d.ts → run-uq8_hUx9.d.ts} +1 -1
- package/dist/run.d.ts +2 -2
- package/dist/run.js +2 -2
- package/dist/textures/loader.js +1 -1
- package/dist/{tints-BtbHegpI.js → tints-3VI_2SNy.js} +107 -1
- package/dist/{tints-B8UJmZMu.js → tints-CebmvjmP.js} +2 -2
- package/dist/{tints-DLBExVWN.d.ts → tints-Do9Sh3dg.d.ts} +2 -2
- package/dist/{types-COGbtA1t.d.ts → types-DpRSF9Vj.d.ts} +8 -0
- package/dist/workers/render-worker.d.ts +1 -1
- package/dist/workers/render-worker.js +1 -1
- package/package.json +1 -1
- package/dist/blend-CHP2-j9U.js +0 -90
- package/dist/blend-CyDIxCne.d.ts +0 -36
- package/dist/face-BIYg14TE.d.ts +0 -30
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { n as LayeredResourceManager } from "./manager-CkletR5K.js";
|
|
2
|
-
import {
|
|
2
|
+
import { t as curatedModelOverrides } from "./models-BKxGkPS7.js";
|
|
3
|
+
import { n as harvestTintOverrides, t as curatedTintOverrides } from "./tints-CebmvjmP.js";
|
|
3
4
|
import { n as UnsafeJarError, t as JarResourceManager } from "./jar-D9z-X7tA.js";
|
|
4
5
|
import { t as synthesizeItemModels } from "./synthesize-3Q0aaOnK.js";
|
|
5
6
|
//#region src/mods/prepare.ts
|
|
@@ -47,6 +48,7 @@ async function prepareModResources(options) {
|
|
|
47
48
|
const base = new LayeredResourceManager([
|
|
48
49
|
options.vanilla,
|
|
49
50
|
curatedTintOverrides(),
|
|
51
|
+
curatedModelOverrides(),
|
|
50
52
|
...jarLayers
|
|
51
53
|
]);
|
|
52
54
|
const namespaces = [];
|
|
@@ -89,7 +91,10 @@ async function prepareModResources(options) {
|
|
|
89
91
|
namespaces,
|
|
90
92
|
synthesized,
|
|
91
93
|
tintOverrides,
|
|
92
|
-
rejected
|
|
94
|
+
rejected,
|
|
95
|
+
close: async () => {
|
|
96
|
+
await Promise.all(jarLayers.map(async (jar) => jar.close().catch(() => {})));
|
|
97
|
+
}
|
|
93
98
|
};
|
|
94
99
|
}
|
|
95
100
|
//#endregion
|
|
@@ -15,6 +15,14 @@ interface ModPreparation {
|
|
|
15
15
|
jar: string;
|
|
16
16
|
reason: string;
|
|
17
17
|
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Releases the jars this opened. Jars are opened with `autoClose: false` and
|
|
20
|
+
* keep both a file descriptor and an entry index per archive, so anything
|
|
21
|
+
* preparing many trees in one process (a corpus survey) must call this —
|
|
22
|
+
* without it the descriptors and indexes accumulate until the process dies.
|
|
23
|
+
* A single-tree caller can skip it and let exit clean up.
|
|
24
|
+
*/
|
|
25
|
+
close(): Promise<void>;
|
|
18
26
|
}
|
|
19
27
|
interface PrepareModsOptions {
|
|
20
28
|
jars: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as FloatTexture, t as FaceShading } from "./blend-8lnfxtLe.js";
|
|
2
2
|
//#region src/render/rasterizer.d.ts
|
|
3
3
|
/** The rectangle of a buffer written since it was last cleared. */
|
|
4
4
|
interface DirtyRect {
|
|
@@ -64,6 +64,8 @@ declare class RowCursor {
|
|
|
64
64
|
}
|
|
65
65
|
/** PHP round(): half away from zero, unlike Math.round's half toward +Infinity. */
|
|
66
66
|
declare function phpRound(value: number): number;
|
|
67
|
-
declare function drawTexturedTriangle(p1in: RasterPoint, p2in: RasterPoint, p3in: RasterPoint, buffer: FaceBuffer, texture: FloatTexture, cursor?: RowCursor
|
|
67
|
+
declare function drawTexturedTriangle(p1in: RasterPoint, p2in: RasterPoint, p3in: RasterPoint, buffer: FaceBuffer, texture: FloatTexture, cursor?: RowCursor,
|
|
68
|
+
/** Applied per sample; null leaves the texel as-is. */
|
|
69
|
+
shading?: FaceShading | null): void;
|
|
68
70
|
//#endregion
|
|
69
71
|
export { clearFaceBuffer as a, drawTexturedTriangle as c, RowCursor as i, phpRound as l, FaceBuffer as n, compactFaceBuffer as o, RasterPoint as r, createFaceBuffer as s, DirtyRect as t };
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import { o as shadeTexel } from "./blend-KXMclcHk.js";
|
|
1
2
|
//#region src/render/rasterizer.ts
|
|
3
|
+
/**
|
|
4
|
+
* Faithful port of renderchest's TriangleRasterizer (scanline, nearest-neighbour
|
|
5
|
+
* sampling by truncation, 0.3 sub-texel start bias, 1px color overdraw with
|
|
6
|
+
* depth written only inside the span). See docs/research/renderchest-spec.md §4.4.
|
|
7
|
+
*/
|
|
2
8
|
function createFaceBuffer(width, height) {
|
|
3
9
|
return {
|
|
4
10
|
x: 0,
|
|
@@ -111,7 +117,7 @@ var RowCursor = class {
|
|
|
111
117
|
function phpRound(value) {
|
|
112
118
|
return value < 0 ? -Math.round(-value) : Math.round(value);
|
|
113
119
|
}
|
|
114
|
-
function drawTexturedTriangle(p1in, p2in, p3in, buffer, texture, cursor = new RowCursor()) {
|
|
120
|
+
function drawTexturedTriangle(p1in, p2in, p3in, buffer, texture, cursor = new RowCursor(), shading = null) {
|
|
115
121
|
const { width, height } = buffer;
|
|
116
122
|
const [p1, p2, p3] = [
|
|
117
123
|
p1in,
|
|
@@ -185,10 +191,12 @@ function drawTexturedTriangle(p1in, p2in, p3in, buffer, texture, cursor = new Ro
|
|
|
185
191
|
texY = texY < 0 ? 0 : texY >= texture.height ? texture.height - 1 : texY;
|
|
186
192
|
const src = (texY * texture.width + texX) * 4;
|
|
187
193
|
const dst = (rowOffset + x) * 4;
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
194
|
+
if (shading === null) {
|
|
195
|
+
buffer.colors[dst] = texture.data[src];
|
|
196
|
+
buffer.colors[dst + 1] = texture.data[src + 1];
|
|
197
|
+
buffer.colors[dst + 2] = texture.data[src + 2];
|
|
198
|
+
buffer.colors[dst + 3] = texture.data[src + 3];
|
|
199
|
+
} else shadeTexel(buffer.colors, dst, texture.data, src, shading, texX, texY);
|
|
192
200
|
}
|
|
193
201
|
if (x >= startX && x < endX && x >= 0 && x < width) {
|
|
194
202
|
const clamped = currentDepth < 0 ? 0 : Math.min(currentDepth, 1);
|
|
@@ -33,7 +33,14 @@ var InferredItemTrimSource = class {
|
|
|
33
33
|
const base = new ResourceLocator(locator.namespace, basePath);
|
|
34
34
|
if (!await this.resources.hasResource("texture", base)) return null;
|
|
35
35
|
const key = await this.firstTexture([new ResourceLocator(locator.namespace, "trims/color_palettes/trim_palette"), ResourceLocator.parse("minecraft:trims/color_palettes/trim_palette")]);
|
|
36
|
-
const
|
|
36
|
+
const separator = variant.indexOf("-");
|
|
37
|
+
const namespaced = (await this.resources.listNamespaces()).filter((namespace) => variant.startsWith(`${namespace}_`)).map((namespace) => new ResourceLocator(namespace, `trims/color_palettes/${variant.slice(namespace.length + 1)}`));
|
|
38
|
+
const palette = await this.firstTexture([
|
|
39
|
+
new ResourceLocator(locator.namespace, `trims/color_palettes/${variant}`),
|
|
40
|
+
ResourceLocator.parse(`minecraft:trims/color_palettes/${variant}`),
|
|
41
|
+
...separator > 0 ? [new ResourceLocator(variant.slice(0, separator), `trims/color_palettes/${variant.slice(separator + 1)}`)] : [],
|
|
42
|
+
...namespaced
|
|
43
|
+
]);
|
|
37
44
|
if (!key || !palette) return null;
|
|
38
45
|
return new PalettedPermutationsSource({
|
|
39
46
|
textures: [base.toString()],
|
package/dist/render/blend.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { FloatTexture, blendPixel, cloneFloatTexture, darkenTexture, q16, tintTexture, toByteTexture, toFloatTexture };
|
|
1
|
+
import { a as darkenTexture, c as shadeTexel, d as toFloatTexture, f as uvWindow, i as cloneFloatTexture, l as tintTexture, n as FloatTexture, o as q16, r as blendPixel, s as scaleTextureAlpha, t as FaceShading, u as toByteTexture } from "../blend-8lnfxtLe.js";
|
|
2
|
+
export { FaceShading, FloatTexture, blendPixel, cloneFloatTexture, darkenTexture, q16, scaleTextureAlpha, shadeTexel, tintTexture, toByteTexture, toFloatTexture, uvWindow };
|
package/dist/render/blend.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { blendPixel, cloneFloatTexture, darkenTexture, q16, tintTexture, toByteTexture, toFloatTexture };
|
|
1
|
+
import { a as scaleTextureAlpha, c as toByteTexture, i as q16, l as toFloatTexture, n as cloneFloatTexture, o as shadeTexel, r as darkenTexture, s as tintTexture, t as blendPixel, u as uvWindow } from "../blend-KXMclcHk.js";
|
|
2
|
+
export { blendPixel, cloneFloatTexture, darkenTexture, q16, scaleTextureAlpha, shadeTexel, tintTexture, toByteTexture, toFloatTexture, uvWindow };
|
package/dist/render/compose.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as FaceBuffer } from "../rasterizer-
|
|
1
|
+
import { n as FloatTexture } from "../blend-8lnfxtLe.js";
|
|
2
|
+
import { n as FaceBuffer } from "../rasterizer-BSQHEhJ-.js";
|
|
3
3
|
//#region src/render/compose.d.ts
|
|
4
4
|
declare function combineFaceBuffers(width: number, height: number, faces: FaceBuffer[]): FloatTexture;
|
|
5
5
|
//#endregion
|
package/dist/render/compose.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as combineFaceBuffers } from "../compose-
|
|
1
|
+
import { t as combineFaceBuffers } from "../compose-BGsNFR12.js";
|
|
2
2
|
export { combineFaceBuffers };
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import { a as ResourceManager } from "../manager-Cv1NeFyF.js";
|
|
2
2
|
import { i as TextureLoader } from "../loader-Myy22TDL.js";
|
|
3
|
-
import { t as ModelLoader } from "../loader-
|
|
4
|
-
import {
|
|
5
|
-
import { r as TintColor } from "../face-
|
|
6
|
-
import { i as RenderOptions } from "../renderer-
|
|
3
|
+
import { t as ModelLoader } from "../loader-DD83d80u.js";
|
|
4
|
+
import { n as FloatTexture } from "../blend-8lnfxtLe.js";
|
|
5
|
+
import { r as TintColor } from "../face-cQ-pVHoe.js";
|
|
6
|
+
import { i as RenderOptions } from "../renderer-C79EQDSn.js";
|
|
7
7
|
//#region src/render/entity-fallback.d.ts
|
|
8
|
+
/** The dye name a `<dye>_<thing>` mod item is prefixed with, or null. */
|
|
9
|
+
declare function dyeVariantName(id: string): string | null;
|
|
10
|
+
/**
|
|
11
|
+
* The dye color a `<dye>_<thing>` item name implies, or null. Mods that name
|
|
12
|
+
* variants after dyes sometimes register the matching DyeColor as the tint in
|
|
13
|
+
* client code, where no asset states it (waystones' sharestones call
|
|
14
|
+
* `DyeColor.getTextColor()`), so the name is the only record of it left.
|
|
15
|
+
*
|
|
16
|
+
* Only ever right for variants that SHARE one uncoloured sprite. A mod that
|
|
17
|
+
* draws each colour its own texture is already the right colour, and tinting it
|
|
18
|
+
* again multiplies the dye in — chipped's blue_paper_lantern came out near
|
|
19
|
+
* black. Callers must check the model's textures; see `dyeVariantName`.
|
|
20
|
+
*/
|
|
21
|
+
declare function dyedVariantTint(id: string): TintColor | null;
|
|
8
22
|
/**
|
|
9
23
|
* Dyed variants of vanilla items whose models mods generate at runtime (quark's
|
|
10
24
|
* `black_frame_empty` parents a block model that exists nowhere on disk): render
|
|
@@ -27,4 +41,4 @@ declare function spawnEggTints(id: string, resources: ResourceManager, textures:
|
|
|
27
41
|
*/
|
|
28
42
|
declare function renderEntityFallback(id: string, models: ModelLoader, textures: TextureLoader, resources: ResourceManager, options: RenderOptions): Promise<FloatTexture | null>;
|
|
29
43
|
//#endregion
|
|
30
|
-
export { renderDyedVariantFallback, renderEntityFallback, spawnEggTints };
|
|
44
|
+
export { dyeVariantName, dyedVariantTint, renderDyedVariantFallback, renderEntityFallback, spawnEggTints };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { renderDyedVariantFallback, renderEntityFallback, spawnEggTints };
|
|
1
|
+
import { a as spawnEggTints, i as renderEntityFallback, n as dyedVariantTint, r as renderDyedVariantFallback, t as dyeVariantName } from "../entity-fallback-BnFMSHS6.js";
|
|
2
|
+
export { dyeVariantName, dyedVariantTint, renderDyedVariantFallback, renderEntityFallback, spawnEggTints };
|
package/dist/render/face.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { FaceShadeCache, RenderableFace, TintColor, faceMaxZ, renderFace };
|
|
1
|
+
import { a as faceMaxZ, i as createShadeCache, n as RenderableFace, o as renderFace, r as TintColor, t as FaceShadeCache } from "../face-cQ-pVHoe.js";
|
|
2
|
+
export { FaceShadeCache, RenderableFace, TintColor, createShadeCache, faceMaxZ, renderFace };
|
package/dist/render/face.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as renderFace, t as
|
|
2
|
-
export { faceMaxZ, renderFace };
|
|
1
|
+
import { n as faceMaxZ, r as renderFace, t as createShadeCache } from "../face-CMJ3b3Ae.js";
|
|
2
|
+
export { createShadeCache, faceMaxZ, renderFace };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as paintBucketFluid } from "../fluid-bucket-
|
|
1
|
+
import { t as paintBucketFluid } from "../fluid-bucket-BzoLofB_.js";
|
|
2
2
|
export { paintBucketFluid };
|
package/dist/render/geo.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "../locator-jDbdUeTd.js";
|
|
2
2
|
import { a as ResourceManager } from "../manager-Cv1NeFyF.js";
|
|
3
3
|
import { i as TextureLoader } from "../loader-Myy22TDL.js";
|
|
4
|
-
import {
|
|
5
|
-
import { n as FaceGeometry } from "../geometry-
|
|
6
|
-
import { i as RenderOptions } from "../renderer-
|
|
4
|
+
import { n as FloatTexture } from "../blend-8lnfxtLe.js";
|
|
5
|
+
import { n as FaceGeometry } from "../geometry-w0yQbzDZ.js";
|
|
6
|
+
import { i as RenderOptions } from "../renderer-C79EQDSn.js";
|
|
7
7
|
//#region src/render/geo.d.ts
|
|
8
8
|
interface GeoCube {
|
|
9
9
|
origin?: number[];
|
package/dist/render/geo.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as renderGeo, n as geoToFaces, r as parseGeo, t as findGeoForItem } from "../geo-
|
|
1
|
+
import { i as renderGeo, n as geoToFaces, r as parseGeo, t as findGeoForItem } from "../geo-w9HHIrb5.js";
|
|
2
2
|
export { findGeoForItem, geoToFaces, parseGeo, renderGeo };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as buildElementFaces, n as FaceGeometry, r as applyElementRotation, t as FACE_NORMALS } from "../geometry-
|
|
1
|
+
import { i as buildElementFaces, n as FaceGeometry, r as applyElementRotation, t as FACE_NORMALS } from "../geometry-w0yQbzDZ.js";
|
|
2
2
|
export { FACE_NORMALS, FaceGeometry, applyElementRotation, buildElementFaces };
|
package/dist/render/geometry.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as applyElementRotation, r as buildElementFaces, t as FACE_NORMALS } from "../geometry-
|
|
1
|
+
import { n as applyElementRotation, r as buildElementFaces, t as FACE_NORMALS } from "../geometry-Bi-Bf5rb.js";
|
|
2
2
|
export { FACE_NORMALS, applyElementRotation, buildElementFaces };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as TextureLoader } from "../loader-Myy22TDL.js";
|
|
2
|
-
import { r as TintColor } from "../face-
|
|
2
|
+
import { r as TintColor } from "../face-cQ-pVHoe.js";
|
|
3
3
|
//#region src/render/legacy-tints.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tints for a model rendered without an item definition (pre-1.21.4 eras and
|
package/dist/render/obj.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { a as ResourceManager } from "../manager-Cv1NeFyF.js";
|
|
2
2
|
import { i as TextureLoader } from "../loader-Myy22TDL.js";
|
|
3
|
-
import { r as ResolvedModel } from "../loader-
|
|
4
|
-
import {
|
|
3
|
+
import { r as ResolvedModel } from "../loader-DD83d80u.js";
|
|
4
|
+
import { n as FloatTexture } from "../blend-8lnfxtLe.js";
|
|
5
5
|
import { n as Vec3 } from "../vector-DRKRi4--.js";
|
|
6
|
-
import { i as RenderOptions } from "../renderer-
|
|
6
|
+
import { i as RenderOptions } from "../renderer-C79EQDSn.js";
|
|
7
7
|
//#region src/render/obj.d.ts
|
|
8
8
|
interface ObjTriangle {
|
|
9
9
|
positions: [Vec3, Vec3, Vec3];
|
|
10
10
|
uvs: [[number, number], [number, number], [number, number]];
|
|
11
11
|
material: string;
|
|
12
|
+
/** The `o`/`g` name in effect, so a loader can draw one state of many. */
|
|
13
|
+
object: string;
|
|
12
14
|
}
|
|
13
15
|
interface ParsedObj {
|
|
14
16
|
triangles: ObjTriangle[];
|
package/dist/render/obj.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as renderObjModel, o as parseMtl, s as parseObj } from "../renderer-
|
|
1
|
+
import { c as renderObjModel, o as parseMtl, s as parseObj } from "../renderer-oi1MSF3Y.js";
|
|
2
2
|
export { parseMtl, parseObj, renderObjModel };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as RenderedFrames, n as ItemRenderOutcome, r as PipelineSettings, t as ItemPipeline } from "../pipeline-
|
|
1
|
+
import { i as RenderedFrames, n as ItemRenderOutcome, r as PipelineSettings, t as ItemPipeline } from "../pipeline-CJNiQG-1.js";
|
|
2
2
|
export { ItemPipeline, ItemRenderOutcome, PipelineSettings, RenderedFrames };
|
package/dist/render/pipeline.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ItemPipeline } from "../pipeline-
|
|
1
|
+
import { t as ItemPipeline } from "../pipeline-BVYj7OP0.js";
|
|
2
2
|
export { ItemPipeline };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as clearFaceBuffer, c as drawTexturedTriangle, i as RowCursor, l as phpRound, n as FaceBuffer, o as compactFaceBuffer, r as RasterPoint, s as createFaceBuffer, t as DirtyRect } from "../rasterizer-
|
|
1
|
+
import { a as clearFaceBuffer, c as drawTexturedTriangle, i as RowCursor, l as phpRound, n as FaceBuffer, o as compactFaceBuffer, r as RasterPoint, s as createFaceBuffer, t as DirtyRect } from "../rasterizer-BSQHEhJ-.js";
|
|
2
2
|
export { DirtyRect, FaceBuffer, RasterPoint, RowCursor, clearFaceBuffer, compactFaceBuffer, createFaceBuffer, drawTexturedTriangle, phpRound };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as drawTexturedTriangle, i as createFaceBuffer, n as clearFaceBuffer, o as phpRound, r as compactFaceBuffer, t as RowCursor } from "../rasterizer-
|
|
1
|
+
import { a as drawTexturedTriangle, i as createFaceBuffer, n as clearFaceBuffer, o as phpRound, r as compactFaceBuffer, t as RowCursor } from "../rasterizer-DcVJzkxz.js";
|
|
2
2
|
export { RowCursor, clearFaceBuffer, compactFaceBuffer, createFaceBuffer, drawTexturedTriangle, phpRound };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RenderedFrames, c as renderModel, i as RenderOptions, l as renderModelFrames, n as AnimationLimits, o as boxDownscale, r as ItemRenderError, s as pointResize, t as AnimationDiagnostics } from "../renderer-
|
|
1
|
+
import { a as RenderedFrames, c as renderModel, i as RenderOptions, l as renderModelFrames, n as AnimationLimits, o as boxDownscale, r as ItemRenderError, s as pointResize, t as AnimationDiagnostics } from "../renderer-C79EQDSn.js";
|
|
2
2
|
export { AnimationDiagnostics, AnimationLimits, ItemRenderError, RenderOptions, RenderedFrames, boxDownscale, pointResize, renderModel, renderModelFrames };
|
package/dist/render/renderer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as renderModelFrames, i as renderModel, n as boxDownscale, r as pointResize, t as ItemRenderError } from "../renderer-
|
|
1
|
+
import { a as renderModelFrames, i as renderModel, n as boxDownscale, r as pointResize, t as ItemRenderError } from "../renderer-oi1MSF3Y.js";
|
|
2
2
|
export { ItemRenderError, boxDownscale, pointResize, renderModel, renderModelFrames };
|
package/dist/render/tints.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveTint, i as parseTintValue, n as InvalidTinterDefinitionError, o as resolveTints, r as TintContext, t as DYE_COLORS } from "../tints-
|
|
1
|
+
import { a as resolveTint, i as parseTintValue, n as InvalidTinterDefinitionError, o as resolveTints, r as TintContext, t as DYE_COLORS } from "../tints-Do9Sh3dg.js";
|
|
2
2
|
export { DYE_COLORS, InvalidTinterDefinitionError, TintContext, parseTintValue, resolveTint, resolveTints };
|
package/dist/render/tints.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveTints, i as resolveTint, n as InvalidTinterDefinitionError, r as parseTintValue, t as DYE_COLORS } from "../tints-
|
|
1
|
+
import { a as resolveTints, i as resolveTint, n as InvalidTinterDefinitionError, r as parseTintValue, t as DYE_COLORS } from "../tints-3VI_2SNy.js";
|
|
2
2
|
export { DYE_COLORS, InvalidTinterDefinitionError, parseTintValue, resolveTint, resolveTints };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as ResourceManager } from "./manager-Cv1NeFyF.js";
|
|
2
2
|
import { i as TextureLoader } from "./loader-Myy22TDL.js";
|
|
3
|
-
import { r as ResolvedModel } from "./loader-
|
|
4
|
-
import {
|
|
3
|
+
import { r as ResolvedModel } from "./loader-DD83d80u.js";
|
|
4
|
+
import { n as FloatTexture } from "./blend-8lnfxtLe.js";
|
|
5
5
|
import { t as Mat4 } from "./vector-DRKRi4--.js";
|
|
6
6
|
import { a as LightingProfileName } from "./lighting-3FGRC3Af.js";
|
|
7
|
-
import { r as TintColor } from "./face-
|
|
7
|
+
import { r as TintColor } from "./face-cQ-pVHoe.js";
|
|
8
8
|
//#region src/render/renderer.d.ts
|
|
9
9
|
interface AnimationLimits {
|
|
10
10
|
/** Emitted frames per icon (default 128). */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
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";
|
|
2
1
|
import { n as ResourceLocator } from "./locator-ycZzh_6z.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
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 { l as toFloatTexture, n as cloneFloatTexture, r as darkenTexture, s as tintTexture, t as blendPixel } from "./blend-KXMclcHk.js";
|
|
4
|
+
import { t as combineFaceBuffers } from "./compose-BGsNFR12.js";
|
|
5
|
+
import { a as drawTexturedTriangle, i as createFaceBuffer, n as clearFaceBuffer, o as phpRound, t as RowCursor } from "./rasterizer-DcVJzkxz.js";
|
|
6
|
+
import { n as faceMaxZ, r as renderFace, t as createShadeCache } from "./face-CMJ3b3Ae.js";
|
|
7
|
+
import { t as paintBucketFluid } from "./fluid-bucket-BzoLofB_.js";
|
|
8
|
+
import { r as buildElementFaces } from "./geometry-Bi-Bf5rb.js";
|
|
9
9
|
import { c as lightsForProfile } from "./lighting--5myudVu.js";
|
|
10
|
-
import { i as resolveTexture } from "./loader-
|
|
10
|
+
import { i as resolveTexture } from "./loader-DwkA9LR5.js";
|
|
11
11
|
//#region src/render/obj.ts
|
|
12
12
|
/**
|
|
13
13
|
* Forge/NeoForge OBJ model rendering — the class the old pipeline left
|
|
@@ -23,6 +23,7 @@ function parseObj(text, flipV) {
|
|
|
23
23
|
const triangles = [];
|
|
24
24
|
const materialLibs = [];
|
|
25
25
|
let material = "";
|
|
26
|
+
let object = "";
|
|
26
27
|
for (const rawLine of text.split("\n")) {
|
|
27
28
|
const line = rawLine.trim();
|
|
28
29
|
if (line === "" || line.startsWith("#")) continue;
|
|
@@ -44,6 +45,10 @@ function parseObj(text, flipV) {
|
|
|
44
45
|
case "usemtl":
|
|
45
46
|
material = parts.slice(1).join(" ");
|
|
46
47
|
break;
|
|
48
|
+
case "o":
|
|
49
|
+
case "g":
|
|
50
|
+
object = parts.slice(1).join(" ");
|
|
51
|
+
break;
|
|
47
52
|
case "mtllib":
|
|
48
53
|
materialLibs.push(parts.slice(1).join(" "));
|
|
49
54
|
break;
|
|
@@ -71,7 +76,8 @@ function parseObj(text, flipV) {
|
|
|
71
76
|
corners[i - 1].uv,
|
|
72
77
|
corners[i].uv
|
|
73
78
|
],
|
|
74
|
-
material
|
|
79
|
+
material,
|
|
80
|
+
object
|
|
75
81
|
});
|
|
76
82
|
}
|
|
77
83
|
break;
|
|
@@ -112,6 +118,11 @@ async function renderObjModel(model, resources, textures, options) {
|
|
|
112
118
|
const objSource = await resources.getResource("raw", objLocator);
|
|
113
119
|
if (!objSource) throw new ItemRenderError(`OBJ file not found: ${model.obj.model} for ${model.locator}`);
|
|
114
120
|
const parsed = parseObj(objSource.toString("utf8"), model.obj.flipV);
|
|
121
|
+
const wanted = model.obj.objects;
|
|
122
|
+
if (wanted) {
|
|
123
|
+
const allowed = new Set(wanted);
|
|
124
|
+
parsed.triangles = parsed.triangles.filter((triangle) => allowed.has(triangle.object));
|
|
125
|
+
}
|
|
115
126
|
if (parsed.triangles.length === 0) throw new ItemRenderError(`OBJ has no faces: ${model.obj.model}`);
|
|
116
127
|
const materials = /* @__PURE__ */ new Map();
|
|
117
128
|
const objDirectory = objLocator.path.split("/").slice(0, -1).join("/");
|
|
@@ -441,7 +452,7 @@ function createSession() {
|
|
|
441
452
|
order: null,
|
|
442
453
|
transformation: null,
|
|
443
454
|
scratch: null,
|
|
444
|
-
shadeCache:
|
|
455
|
+
shadeCache: createShadeCache(),
|
|
445
456
|
floatTextures: /* @__PURE__ */ new Map(),
|
|
446
457
|
faceBuffers: []
|
|
447
458
|
};
|
|
@@ -529,14 +540,19 @@ async function renderElementModelWith(model, supplier, renderSize, options, sess
|
|
|
529
540
|
/** Nearest-neighbour resize matching Imagick FILTER_POINT (destination-center sampling). */
|
|
530
541
|
function pointResize(texture, width, height) {
|
|
531
542
|
const data = new Float64Array(width * height * 4);
|
|
543
|
+
const srcXs = new Int32Array(width);
|
|
544
|
+
for (let x = 0; x < width; x++) {
|
|
545
|
+
const srcX = Math.floor((x + .5) * texture.width / width);
|
|
546
|
+
srcXs[x] = srcX >= texture.width ? texture.width - 1 : srcX;
|
|
547
|
+
}
|
|
532
548
|
for (let y = 0; y < height; y++) {
|
|
533
549
|
let srcY = Math.floor((y + .5) * texture.height / height);
|
|
534
550
|
srcY = srcY >= texture.height ? texture.height - 1 : srcY;
|
|
551
|
+
const srcRow = srcY * texture.width;
|
|
552
|
+
const dstRow = y * width;
|
|
535
553
|
for (let x = 0; x < width; x++) {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
const src = (srcY * texture.width + srcX) * 4;
|
|
539
|
-
const dst = (y * width + x) * 4;
|
|
554
|
+
const src = (srcRow + srcXs[x]) * 4;
|
|
555
|
+
const dst = (dstRow + x) * 4;
|
|
540
556
|
data[dst] = texture.data[src];
|
|
541
557
|
data[dst + 1] = texture.data[src + 1];
|
|
542
558
|
data[dst + 2] = texture.data[src + 2];
|
|
@@ -562,6 +578,7 @@ function boxPass(texture, factor, isHorizontal) {
|
|
|
562
578
|
const width = isHorizontal ? Math.round(texture.width / factor) : texture.width;
|
|
563
579
|
const height = isHorizontal ? texture.height : Math.round(texture.height / factor);
|
|
564
580
|
const data = new Float64Array(width * height * 4);
|
|
581
|
+
const { data: src } = texture;
|
|
565
582
|
for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {
|
|
566
583
|
let r = 0;
|
|
567
584
|
let g = 0;
|
|
@@ -569,11 +586,11 @@ function boxPass(texture, factor, isHorizontal) {
|
|
|
569
586
|
let alphaSum = 0;
|
|
570
587
|
for (let i = 0; i < factor; i++) {
|
|
571
588
|
const srcX = isHorizontal ? x * factor + i : x;
|
|
572
|
-
const
|
|
573
|
-
const alpha = Math.round(
|
|
574
|
-
r += Math.round(
|
|
575
|
-
g += Math.round(
|
|
576
|
-
b += Math.round(
|
|
589
|
+
const srcOffset = ((isHorizontal ? y : y * factor + i) * texture.width + srcX) * 4;
|
|
590
|
+
const alpha = Math.round(src[srcOffset + 3] * 65535);
|
|
591
|
+
r += Math.round(src[srcOffset] * 65535) * alpha;
|
|
592
|
+
g += Math.round(src[srcOffset + 1] * 65535) * alpha;
|
|
593
|
+
b += Math.round(src[srcOffset + 2] * 65535) * alpha;
|
|
577
594
|
alphaSum += alpha;
|
|
578
595
|
}
|
|
579
596
|
const dst = (y * width + x) * 4;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "./locator-ycZzh_6z.js";
|
|
2
|
-
import { n as discoverItems } from "./discovery-
|
|
3
|
-
import { r as encodeRasterAsset } from "./encode-
|
|
2
|
+
import { n as discoverItems } from "./discovery-B9aqV_Rz.js";
|
|
3
|
+
import { r as encodeRasterAsset } from "./encode-LR9wxigC.js";
|
|
4
4
|
import { t as classifyItemStyle } from "./item-styles-upgEO1yP.js";
|
|
5
5
|
import { t as minifyStylesheet } from "./minify-bjMRmr5J.js";
|
|
6
6
|
import { t as generateStylesheet } from "./stylesheet-CovT3B2S.js";
|
|
7
|
-
import { t as ItemPipeline } from "./pipeline-
|
|
7
|
+
import { t as ItemPipeline } from "./pipeline-BVYj7OP0.js";
|
|
8
8
|
import { t as describeResources } from "./descriptor-DWebtkI1.js";
|
|
9
9
|
import { t as WorkerRenderPool } from "./pool-CKGp1qup.js";
|
|
10
10
|
import path from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as ResourceManager } from "./manager-Cv1NeFyF.js";
|
|
2
2
|
import { a as LightingProfileName } from "./lighting-3FGRC3Af.js";
|
|
3
|
-
import { n as AnimationLimits } from "./renderer-
|
|
3
|
+
import { n as AnimationLimits } from "./renderer-C79EQDSn.js";
|
|
4
4
|
//#region src/run.d.ts
|
|
5
5
|
interface RunOptions {
|
|
6
6
|
resources: ResourceManager;
|
package/dist/run.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { l as evaluateItemModel } from "./definition-
|
|
2
|
-
import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-
|
|
1
|
+
import { l as evaluateItemModel } from "./definition-ricL7Jqf.js";
|
|
2
|
+
import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-uq8_hUx9.js";
|
|
3
3
|
export { ItemFailure, RunOptions, RunResult, evaluateItemModel, run };
|
package/dist/run.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { o as evaluateItemModel } from "./definition-
|
|
2
|
-
import { t as run } from "./run-
|
|
1
|
+
import { o as evaluateItemModel } from "./definition-ColsvWrH.js";
|
|
2
|
+
import { t as run } from "./run-C6AP3Bn8.js";
|
|
3
3
|
export { evaluateItemModel, run };
|
package/dist/textures/loader.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TextureLoader, r as TextureResolutionError, t as AnimatedTexture } from "../loader-
|
|
1
|
+
import { n as TextureLoader, r as TextureResolutionError, t as AnimatedTexture } from "../loader-Lb0ZeILz.js";
|
|
2
2
|
export { AnimatedTexture, TextureLoader, TextureResolutionError };
|
|
@@ -61,6 +61,103 @@ const DEFAULT_READING_TYPES = /* @__PURE__ */ new Set([
|
|
|
61
61
|
"minecraft:map_color",
|
|
62
62
|
"minecraft:team"
|
|
63
63
|
]);
|
|
64
|
+
/**
|
|
65
|
+
* appeng.api.util.AEColor's dark/medium/bright variants, read out of the enum's
|
|
66
|
+
* static initialiser in AE2 26.1.10. Every `ae2:color` tint names one of these
|
|
67
|
+
* plus a variant, and nothing in the mod's assets states the values.
|
|
68
|
+
*/
|
|
69
|
+
const AE_COLORS = {
|
|
70
|
+
white: [
|
|
71
|
+
11842740,
|
|
72
|
+
14737632,
|
|
73
|
+
16382457
|
|
74
|
+
],
|
|
75
|
+
light_gray: [
|
|
76
|
+
8289918,
|
|
77
|
+
10526624,
|
|
78
|
+
12895428
|
|
79
|
+
],
|
|
80
|
+
gray: [
|
|
81
|
+
5197647,
|
|
82
|
+
7105388,
|
|
83
|
+
9736852
|
|
84
|
+
],
|
|
85
|
+
black: [
|
|
86
|
+
1250067,
|
|
87
|
+
2565927,
|
|
88
|
+
3881787
|
|
89
|
+
],
|
|
90
|
+
lime: [
|
|
91
|
+
5161038,
|
|
92
|
+
7397977,
|
|
93
|
+
11794541
|
|
94
|
+
],
|
|
95
|
+
yellow: [
|
|
96
|
+
16764736,
|
|
97
|
+
16769881,
|
|
98
|
+
16056192
|
|
99
|
+
],
|
|
100
|
+
orange: [
|
|
101
|
+
14252079,
|
|
102
|
+
15508028,
|
|
103
|
+
15907401
|
|
104
|
+
],
|
|
105
|
+
brown: [
|
|
106
|
+
7227922,
|
|
107
|
+
8281110,
|
|
108
|
+
9334298
|
|
109
|
+
],
|
|
110
|
+
red: [
|
|
111
|
+
11149611,
|
|
112
|
+
14106178,
|
|
113
|
+
15758949
|
|
114
|
+
],
|
|
115
|
+
pink: [
|
|
116
|
+
14184106,
|
|
117
|
+
16751035,
|
|
118
|
+
16501461
|
|
119
|
+
],
|
|
120
|
+
magenta: [
|
|
121
|
+
12669321,
|
|
122
|
+
13988252,
|
|
123
|
+
15113919
|
|
124
|
+
],
|
|
125
|
+
purple: [
|
|
126
|
+
7232696,
|
|
127
|
+
9526733,
|
|
128
|
+
11562973
|
|
129
|
+
],
|
|
130
|
+
blue: [
|
|
131
|
+
3375088,
|
|
132
|
+
3708159,
|
|
133
|
+
4243967
|
|
134
|
+
],
|
|
135
|
+
light_blue: [
|
|
136
|
+
6928895,
|
|
137
|
+
7394047,
|
|
138
|
+
8452095
|
|
139
|
+
],
|
|
140
|
+
cyan: [
|
|
141
|
+
2273454,
|
|
142
|
+
3132599,
|
|
143
|
+
6678729
|
|
144
|
+
],
|
|
145
|
+
green: [
|
|
146
|
+
498539,
|
|
147
|
+
1554541,
|
|
148
|
+
3332176
|
|
149
|
+
],
|
|
150
|
+
fluix: [
|
|
151
|
+
5916574,
|
|
152
|
+
9526733,
|
|
153
|
+
14853091
|
|
154
|
+
]
|
|
155
|
+
};
|
|
156
|
+
const VARIANT_INDEX = {
|
|
157
|
+
dark: 0,
|
|
158
|
+
medium: 1,
|
|
159
|
+
bright: 2
|
|
160
|
+
};
|
|
64
161
|
async function resolveTint(definition, context) {
|
|
65
162
|
const type = definition.type.includes(":") ? definition.type : `minecraft:${definition.type}`;
|
|
66
163
|
switch (type) {
|
|
@@ -75,9 +172,18 @@ async function resolveTint(definition, context) {
|
|
|
75
172
|
const index = context.randomIndex ?? Math.floor(Math.random() * DYE_COLORS.length);
|
|
76
173
|
return hexColor(DYE_COLORS[index % DYE_COLORS.length]);
|
|
77
174
|
}
|
|
175
|
+
case "ae2:storage_cell_state": return parseTintValue(65280);
|
|
176
|
+
case "ae2:portable_cell_color": return parseTintValue(8441855);
|
|
177
|
+
case "ae2:color": {
|
|
178
|
+
const named = String(definition.color ?? "");
|
|
179
|
+
const palette = AE_COLORS[named];
|
|
180
|
+
if (!palette) throw new InvalidTinterDefinitionError(`Unknown ae2:color colour: ${named}`);
|
|
181
|
+
const variant = String(definition.variant ?? "medium");
|
|
182
|
+
return parseTintValue(palette[VARIANT_INDEX[variant] ?? 1]);
|
|
183
|
+
}
|
|
78
184
|
default:
|
|
79
185
|
if (DEFAULT_READING_TYPES.has(type) || Object.hasOwn(definition, "default")) return parseTintValue(definition.default);
|
|
80
|
-
|
|
186
|
+
return null;
|
|
81
187
|
}
|
|
82
188
|
}
|
|
83
189
|
async function resolveTints(definitions, context) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as defaultProperties, o as evaluateItemModel } from "./definition-3MBm8ar_.js";
|
|
1
|
+
import { i as modTintPackPath } from "./builtin-WkWjATeh.js";
|
|
3
2
|
import { n as ResourceLocator } from "./locator-ycZzh_6z.js";
|
|
4
3
|
import { t as FolderResourceManager } from "./manager-CkletR5K.js";
|
|
4
|
+
import { a as defaultProperties, o as evaluateItemModel } from "./definition-ColsvWrH.js";
|
|
5
5
|
import { n as MapResourceManager } from "./synthetic-ZAUjXT7E.js";
|
|
6
6
|
//#region src/mods/tints.ts
|
|
7
7
|
/**
|