@nodecraft/rendermite 1.10.1 → 1.11.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 -7
- package/dist/{block-behaviour-CzK3KVLx.d.ts → block-behaviour-D1qC9_cc.d.ts} +5 -0
- package/dist/{block-overrides-XtxICunI.js → block-overrides-BhuJIxKC.js} +1 -1
- package/dist/blocks/block-behaviour.d.ts +1 -1
- package/dist/blocks/block-overrides.d.ts +1 -1
- package/dist/blocks/block-overrides.js +1 -1
- package/dist/blocks/cli.js +1 -1
- package/dist/blocks/ender-storage.d.ts +1 -1
- package/dist/blocks/ender-storage.js +1 -1
- package/dist/blocks/entities.d.ts +1 -1
- package/dist/blocks/entity-geo.js +1 -1
- package/dist/blocks/entity-models.d.ts +1 -1
- package/dist/blocks/entity-models.js +1 -1
- package/dist/blocks/entity-sizes.js +1 -1
- package/dist/blocks/export.d.ts +1 -1
- package/dist/blocks/export.js +1 -1
- package/dist/blocks/game-rules.js +1 -1
- package/dist/blocks/geo-blocks.d.ts +1 -1
- package/dist/blocks/geo-blocks.js +1 -1
- package/dist/blocks/item-sprites.d.ts +1 -1
- package/dist/blocks/light-bytecode.d.ts +1 -1
- package/dist/blocks/light-bytecode.js +1 -1
- package/dist/blocks/light-eval.d.ts +1 -1
- package/dist/blocks/light.d.ts +7 -2
- package/dist/blocks/light.js +2 -2
- package/dist/blocks/obj-mesh.js +1 -1
- package/dist/blocks/pack-format.d.ts +1 -1
- package/dist/blocks/sprite-sheet.d.ts +1 -1
- package/dist/blocks/sprite-sheet.js +1 -1
- package/dist/cached-BOX3n1Dl.js +54 -0
- package/dist/{cli-2mzPC8cy.js → cli-BsEk_aEv.js} +16 -2
- package/dist/cli.js +2 -2
- package/dist/{compose-BGsNFR12.js → compose-CuIKcRpx.js} +1 -1
- package/dist/{encode-LR9wxigC.js → encode-TzYXOEId.js} +5 -4
- package/dist/{ender-storage-Dgomp6r2.js → ender-storage-CKDiYgYc.js} +1 -1
- package/dist/entities/mappings.js +1 -1
- package/dist/entities/model-code.js +1 -1
- package/dist/{entity-fallback-BucEf6WB.js → entity-fallback-BEzCbJq0.js} +1 -1
- package/dist/{entity-geo-DbTtMlPL.js → entity-geo-DcrcN8TE.js} +1 -1
- package/dist/{entity-models-vFl_EwfA.js → entity-models-D6AMLAy6.js} +3 -3
- package/dist/{entity-sizes-DspxgSUA.js → entity-sizes-Dmr4w0vu.js} +4 -3
- package/dist/{export-DgB0e5sB.js → export-BdHar0ND.js} +36 -14
- package/dist/{export-CqeTinYL.d.ts → export-CnKiSTiu.d.ts} +8 -0
- package/dist/{face-DbyyYmzp.js → face-D6SfTISC.js} +1 -1
- package/dist/{game-rules-BDPTopVW.js → game-rules-Dehe210A.js} +4 -3
- package/dist/{geo-BoDxwvz5.js → geo-BOYYFFQn.js} +3 -3
- package/dist/{geo-blocks-W79q5A0f.js → geo-blocks-BQqFfAQT.js} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/{light-BnaYFouC.js → light-Culwie4W.js} +26 -10
- package/dist/{light-bytecode-hhkkjMVi.js → light-bytecode-Bx3XLTRI.js} +1 -1
- package/dist/{light-eval-B4q-aVcf.d.ts → light-eval-Cl2L3RBz.d.ts} +1 -1
- package/dist/{mappings-DEl_7xxQ.js → mappings-CTB7_uZa.js} +16 -1
- package/dist/{model-code-BmA5ilgt.js → model-code-C5Au_FKU.js} +4 -3
- package/dist/{obj-DPEK_xee.js → obj-NxBaySXt.js} +67 -33
- package/dist/{obj-mesh-BFhtTBXX.js → obj-mesh-BBSLG2Fv.js} +1 -1
- package/dist/output/encode.js +1 -1
- package/dist/output/item-styles.d.ts +1 -1
- package/dist/output/stylesheet.d.ts +1 -1
- package/dist/output/stylesheet.js +1 -1
- package/dist/pack.d.ts +2 -2
- package/dist/{pipeline-Q_185kY6.js → pipeline-CCfkRth7.js} +7 -6
- package/dist/{rasterizer-DcVJzkxz.js → rasterizer-M9Y7mn-W.js} +13 -5
- package/dist/read-ahead-BlSzTexs.js +31 -0
- package/dist/render/compose.js +1 -1
- package/dist/render/entity-fallback.js +1 -1
- package/dist/render/face.js +1 -1
- package/dist/render/geo.js +1 -1
- package/dist/render/obj.js +1 -1
- package/dist/render/pipeline.js +1 -1
- package/dist/render/rasterizer.js +1 -1
- package/dist/render/renderer.js +1 -1
- package/dist/resources/cached.d.ts +27 -0
- package/dist/resources/cached.js +2 -0
- package/dist/resources/read-ahead.d.ts +12 -0
- package/dist/resources/read-ahead.js +2 -0
- package/dist/{run-5yX5KRiI.js → run-Bf5TLTJw.js} +7 -6
- package/dist/run.js +1 -1
- package/dist/{sprite-sheet-LQAEtGkp.js → sprite-sheet-BWsLl0Vd.js} +4 -2
- package/dist/{stylesheet-CovT3B2S.js → stylesheet-C61VrCAV.js} +6 -4
- package/dist/{stylesheet-i-t_7sZ7.d.ts → stylesheet-DxHkk4qA.d.ts} +2 -0
- package/dist/workers/render-worker.js +1 -1
- package/package.json +1 -1
|
@@ -2,11 +2,11 @@ import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
|
2
2
|
import { n as LayeredResourceManager } from "./manager-D6zXmFrO.js";
|
|
3
3
|
import { n as discoverItems } from "./discovery-CD0QqxSF.js";
|
|
4
4
|
import { t as curatedModelOverrides } from "./models-BsYA-NZg.js";
|
|
5
|
-
import { r as encodeRasterAsset } from "./encode-
|
|
5
|
+
import { r as encodeRasterAsset } from "./encode-TzYXOEId.js";
|
|
6
6
|
import { t as classifyItemStyle } from "./item-styles-BAeneY1R.js";
|
|
7
7
|
import { t as minifyStylesheet } from "./minify-bjMRmr5J.js";
|
|
8
|
-
import { t as generateStylesheet } from "./stylesheet-
|
|
9
|
-
import { t as ItemPipeline } from "./pipeline-
|
|
8
|
+
import { t as generateStylesheet } from "./stylesheet-C61VrCAV.js";
|
|
9
|
+
import { t as ItemPipeline } from "./pipeline-CCfkRth7.js";
|
|
10
10
|
import { t as describeResources } from "./descriptor-Dz2cR-BH.js";
|
|
11
11
|
import { t as WorkerRenderPool } from "./pool-CKGp1qup.js";
|
|
12
12
|
import path from "node:path";
|
|
@@ -62,8 +62,8 @@ async function run(options) {
|
|
|
62
62
|
});
|
|
63
63
|
const { resources } = pipeline;
|
|
64
64
|
const glint = await resolveEnchantmentGlint(resources);
|
|
65
|
-
if (!glint)
|
|
66
|
-
const encodedGlint = await encodeRasterAsset(glint, fallback ? ["png", format] : [format]);
|
|
65
|
+
if (!glint) options.onProgress?.(0, 0, "enchantment glint", "Missing enchantment glint texture (minecraft:misc/enchanted_glint_item or enchanted_item_glint); the stylesheet has no glint overlay");
|
|
66
|
+
const encodedGlint = glint ? await encodeRasterAsset(glint, fallback ? ["png", format] : [format]) : /* @__PURE__ */ new Map();
|
|
67
67
|
const ids = [];
|
|
68
68
|
const seen = /* @__PURE__ */ new Set();
|
|
69
69
|
if (options.builtin) for (const placeholder of ["renderchest:unknown", "renderchest:empty"]) {
|
|
@@ -164,7 +164,8 @@ async function run(options) {
|
|
|
164
164
|
const stylesheet = generateStylesheet(styles, {
|
|
165
165
|
prefix,
|
|
166
166
|
format,
|
|
167
|
-
fallback
|
|
167
|
+
fallback,
|
|
168
|
+
glint: glint !== null
|
|
168
169
|
});
|
|
169
170
|
const finalStylesheet = options.minify === false ? stylesheet : minifyStylesheet(stylesheet, (message) => options.onProgress?.(0, 0, "stylesheet", message));
|
|
170
171
|
await writeFile(path.join(options.output, `${prefix}${namespaces[0]}-${size}.css`), finalStylesheet);
|
package/dist/run.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
2
|
+
import { t as readAhead } from "./read-ahead-BlSzTexs.js";
|
|
2
3
|
import { t as packAtlas } from "./atlas-pack-CoOih7By.js";
|
|
3
4
|
//#region src/blocks/sprite-sheet.ts
|
|
4
5
|
/**
|
|
@@ -75,11 +76,12 @@ async function buildSpriteSheet(ids, textures, options = {}) {
|
|
|
75
76
|
const missing = /* @__PURE__ */ new Set();
|
|
76
77
|
const loaded = [];
|
|
77
78
|
let done = 0;
|
|
78
|
-
|
|
79
|
+
const sorted = [...wanted].toSorted((left, right) => left.localeCompare(right));
|
|
80
|
+
for (const [id, pending] of readAhead(sorted, async (name) => textures.loadAnimated(ResourceLocator.parse(name)))) {
|
|
79
81
|
options.onProgress?.(++done, wanted.size);
|
|
80
82
|
let animated;
|
|
81
83
|
try {
|
|
82
|
-
animated = await
|
|
84
|
+
animated = await pending;
|
|
83
85
|
} catch (err) {
|
|
84
86
|
failures.push({
|
|
85
87
|
id,
|
|
@@ -60,10 +60,12 @@ function generateStylesheet(items, options = {}) {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
if (options.glint ?? true) {
|
|
64
|
+
const glintSelectors = [...enchantedSelectors, `.${prefix}enchanted:after`];
|
|
65
|
+
const glint = `${glintSelectors.join(",\n")} {\n position: absolute;\n width: 200%;\n height: 200%;\n top: -50%;\n left: -50%;\n image-rendering: pixelated;\n mix-blend-mode: screen;\n content: '';\n opacity: 0.6;\n background-image: ${url(`${prefix}enchantment.${baseExtension}`, urlPrefix)};\n background-size: 512px 512px;\n filter: blur(2px) contrast(200%);\n transform: rotate(-8deg);\n animation-name: ${prefix}enchanted;\n animation-duration: 32s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}`;
|
|
66
|
+
blocks.push(glint);
|
|
67
|
+
upgrade.push(`${glintSelectors.join(", ")} { background-image: ${url(`${prefix}enchantment.${format}`, urlPrefix)}; }`);
|
|
68
|
+
}
|
|
67
69
|
if (fallback) blocks.push(`@media (min-resolution: 1dpi) {\n${upgrade.map((rule) => ` ${rule}`).join("\n")}\n}`);
|
|
68
70
|
return blocks.join("\n\n");
|
|
69
71
|
}
|
|
@@ -14,6 +14,8 @@ interface StylesheetOptions {
|
|
|
14
14
|
format?: 'webp' | 'avif';
|
|
15
15
|
/** Emit the base rules in png plus a media-query upgrade block. */
|
|
16
16
|
fallback?: boolean;
|
|
17
|
+
/** Emit the enchant glint overlay (default true); off when there is no glint image to point it at. */
|
|
18
|
+
glint?: boolean;
|
|
17
19
|
}
|
|
18
20
|
interface ItemStyle {
|
|
19
21
|
/** Item id, e.g. `minecraft:stone`. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ItemPipeline } from "../pipeline-
|
|
1
|
+
import { t as ItemPipeline } from "../pipeline-CCfkRth7.js";
|
|
2
2
|
import { n as restoreResources } from "../descriptor-Dz2cR-BH.js";
|
|
3
3
|
import sharp from "sharp";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodecraft/rendermite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Minecraft item icon renderer: renders inventory-identical item icons from vanilla and modded assets across game versions, outputting optimized PNG/WebP/AVIF plus CSS and a JSON item library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|