@nodecraft/rendermite 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/{discovery-CmNYzKPr.d.ts → discovery-D89pVVJA.d.ts} +11 -2
- package/dist/{discovery-BzaOti7l.js → discovery-iph0P2F2.js} +3 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/items/discovery.d.ts +2 -2
- package/dist/items/discovery.js +1 -1
- package/dist/{run-BK7Q8WZ3.d.ts → run-BlSZw9Qk.d.ts} +6 -0
- package/dist/{run-B9T3PCg3.js → run-DI-cB38y.js} +2 -2
- package/dist/run.d.ts +1 -1
- package/dist/run.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { n as builtinPackPath, t as bedCompatPath } from "./builtin-C8GZEN40.js";
|
|
3
3
|
import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-dfI7b9N4.js";
|
|
4
4
|
import { t as JarResourceManager } from "./jar-Bt3i0ls4.js";
|
|
5
|
-
import { t as run } from "./run-
|
|
5
|
+
import { t as run } from "./run-DI-cB38y.js";
|
|
6
6
|
import { t as downloadClientJar } from "./download-D9aARBFp.js";
|
|
7
7
|
import { a as prepareVersionResources, i as eraForVersion, n as GEOMETRY_DONOR_VERSIONS } from "./prepare-DROxBZp1.js";
|
|
8
8
|
import path from "node:path";
|
|
@@ -7,7 +7,16 @@ interface DiscoveredItem {
|
|
|
7
7
|
id: string;
|
|
8
8
|
source: 'definition' | 'model';
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
interface ItemDiscoveryOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Drop classic item models that have no matching item/block translation.
|
|
13
|
+
* Enabled by default to avoid publishing state and template models from a
|
|
14
|
+
* raw mod jar. Prepared resource packs can disable it after applying their
|
|
15
|
+
* own registry-aware filtering, preserving renderchest's complete model scan.
|
|
16
|
+
*/
|
|
17
|
+
filterUntranslatedModels?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare function discoverItems(resources: ResourceManager, namespace: string, options?: ItemDiscoveryOptions): Promise<DiscoveredItem[]>;
|
|
11
20
|
/**
|
|
12
21
|
* Resolve an item id to the models to render. Definitions are evaluated with
|
|
13
22
|
* static-icon properties; plain model items render the model with no tints
|
|
@@ -15,4 +24,4 @@ declare function discoverItems(resources: ResourceManager, namespace: string): P
|
|
|
15
24
|
*/
|
|
16
25
|
declare function resolveItem(resources: ResourceManager, id: string, properties?: ItemProperties): Promise<ItemRenderInstruction[]>;
|
|
17
26
|
//#endregion
|
|
18
|
-
export { resolveItem as i,
|
|
27
|
+
export { resolveItem as a, discoverItems as i, ItemDiscoveryOptions as n, ItemResolutionError as r, DiscoveredItem as t };
|
|
@@ -9,7 +9,7 @@ import { o as evaluateItemModel } from "./definition-3MBm8ar_.js";
|
|
|
9
9
|
* the form `<ns>:<name>`.
|
|
10
10
|
*/
|
|
11
11
|
var ItemResolutionError = class extends Error {};
|
|
12
|
-
async function discoverItems(resources, namespace) {
|
|
12
|
+
async function discoverItems(resources, namespace, options = {}) {
|
|
13
13
|
const seen = /* @__PURE__ */ new Set();
|
|
14
14
|
const items = [];
|
|
15
15
|
for (const locator of await resources.listResources("itemDefinition", namespace)) {
|
|
@@ -22,7 +22,8 @@ async function discoverItems(resources, namespace) {
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const filterUntranslated = options.filterUntranslatedModels ?? true;
|
|
26
|
+
const registered = namespace === "minecraft" || !filterUntranslated ? null : await langRegistry(resources, namespace);
|
|
26
27
|
for (const locator of await resources.listResources("model", namespace)) {
|
|
27
28
|
if (!locator.path.startsWith("item/")) continue;
|
|
28
29
|
const name = locator.path.slice(5);
|
package/dist/index.d.ts
CHANGED
|
@@ -8,13 +8,13 @@ import { c as toFloatTexture, s as toByteTexture, t as FloatTexture } from "./bl
|
|
|
8
8
|
import { a as LightingProfileName, i as LightingProfile, r as LightSource, u as lightsForProfile } from "./lighting-3FGRC3Af.js";
|
|
9
9
|
import { a as pointResize, i as boxDownscale, n as RenderOptions, o as renderModel, r as RenderedFrames, s as renderModelFrames, t as ItemRenderError } from "./renderer-nbMCw1Pl.js";
|
|
10
10
|
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-BwX6Xxv0.js";
|
|
11
|
-
import {
|
|
11
|
+
import { a as resolveItem, i as discoverItems, n as ItemDiscoveryOptions, r as ItemResolutionError, t as DiscoveredItem } from "./discovery-D89pVVJA.js";
|
|
12
12
|
import { a as resolveTint, i as parseTintValue, n as InvalidTinterDefinitionError, o as resolveTints, t as DYE_COLORS } from "./tints-txt-8xI5.js";
|
|
13
13
|
import { i as EncodedIcon, n as EncodeOptions, o as encodeAnimatedIcon, r as EncodedAnimatedIcon, s as encodeIcon, t as AnimatedEncodeOptions } from "./encode-C5kdAm45.js";
|
|
14
14
|
import { t as minifyStylesheet } from "./minify-CIV6enbr.js";
|
|
15
15
|
import { a as compareVersions, o as eraForVersion, s as prepareVersionResources } from "./prepare-wfWtaz_X.js";
|
|
16
16
|
import { i as prepareModResources } from "./prepare-DnnGGv9k.js";
|
|
17
17
|
import { i as itemClass, n as StylesheetOptions, r as generateStylesheet, t as ItemStyle } from "./stylesheet-i-t_7sZ7.js";
|
|
18
|
-
import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-
|
|
18
|
+
import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-BlSZw9Qk.js";
|
|
19
19
|
import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-6T3xdgaL.js";
|
|
20
|
-
export { type AnimatedEncodeOptions, AnimatedTexture, type AtlasResolver, type AtlasSource, AtlasSourceError, DYE_COLORS, type DiscoveredItem, type EncodeOptions, type EncodedAnimatedIcon, type EncodedIcon, type FloatTexture, FolderResourceManager, InvalidItemDefinitionError, InvalidResourceLocatorError, InvalidTinterDefinitionError, type ItemFailure, type ItemProperties, ItemRenderError, type ItemRenderInstruction, ItemResolutionError, type ItemStyle, JarResourceManager, LayeredResourceManager, type LightSource, LightingProfile, type LightingProfileName, ModelLoader, ModelResolutionError, 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, UnsafeJarError, boxDownscale, builtinDynamicResources, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateItemModel, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, minifyStylesheet, parseAtlasSources, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture };
|
|
20
|
+
export { type AnimatedEncodeOptions, AnimatedTexture, type AtlasResolver, type AtlasSource, AtlasSourceError, DYE_COLORS, type DiscoveredItem, type EncodeOptions, type EncodedAnimatedIcon, type EncodedIcon, 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, ModelLoader, ModelResolutionError, 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, UnsafeJarError, boxDownscale, builtinDynamicResources, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateItemModel, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, minifyStylesheet, parseAtlasSources, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture };
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager }
|
|
|
4
4
|
import { o as createAtlasResolver, s as parseAtlasSources, t as AtlasSourceError } from "./sources-Bxk-WOzH.js";
|
|
5
5
|
import { a as builtinDynamicResources } from "./generators-CcVRG30y.js";
|
|
6
6
|
import { a as defaultProperties, i as UNKNOWN_MODEL, n as InvalidItemDefinitionError, o as evaluateItemModel } from "./definition-3MBm8ar_.js";
|
|
7
|
-
import { n as discoverItems, r as resolveItem, t as ItemResolutionError } from "./discovery-
|
|
7
|
+
import { n as discoverItems, r as resolveItem, t as ItemResolutionError } from "./discovery-iph0P2F2.js";
|
|
8
8
|
import { a as salvageJson, i as resolveTexture, n as ModelResolutionError, t as ModelLoader } from "./loader-A-BZa8J4.js";
|
|
9
9
|
import { o as toByteTexture, s as toFloatTexture } from "./blend-CHP2-j9U.js";
|
|
10
10
|
import { n as encodeIcon, t as encodeAnimatedIcon } from "./encode-3u49i-eD.js";
|
|
@@ -14,7 +14,7 @@ import { c as lightsForProfile, r as LightingProfile } from "./lighting--5myudVu
|
|
|
14
14
|
import { a as renderModelFrames, i as renderModel, n as boxDownscale, r as pointResize, t as ItemRenderError } from "./renderer-BeOinVC8.js";
|
|
15
15
|
import { a as resolveTints, i as resolveTint, n as InvalidTinterDefinitionError, r as parseTintValue, t as DYE_COLORS } from "./tints-BtbHegpI.js";
|
|
16
16
|
import { n as TextureLoader, r as TextureResolutionError, t as AnimatedTexture } from "./loader-CBzn3Koc.js";
|
|
17
|
-
import { t as run } from "./run-
|
|
17
|
+
import { t as run } from "./run-DI-cB38y.js";
|
|
18
18
|
import { a as prepareVersionResources, i as eraForVersion, r as compareVersions } from "./prepare-DROxBZp1.js";
|
|
19
19
|
import { n as prepareModResources } from "./prepare-Bvc5ve2m.js";
|
|
20
20
|
export { AnimatedTexture, AtlasSourceError, DYE_COLORS, FolderResourceManager, InvalidItemDefinitionError, InvalidResourceLocatorError, InvalidTinterDefinitionError, ItemRenderError, ItemResolutionError, JarResourceManager, LayeredResourceManager, LightingProfile, ModelLoader, ModelResolutionError, ResourceKind, ResourceLocator, TextureLoader, TextureResolutionError, UNKNOWN_MODEL, UnsafeJarError, boxDownscale, builtinDynamicResources, compareVersions, createAtlasResolver, defaultProperties, discoverItems, encodeAnimatedIcon, encodeIcon, eraForVersion, evaluateItemModel, generateStylesheet, isUnsafeEntryPath, itemClass, lightsForProfile, minifyStylesheet, parseAtlasSources, parseTintValue, pointResize, prepareModResources, prepareVersionResources, renderModel, renderModelFrames, resolveItem, resolveTexture, resolveTint, resolveTints, run, salvageJson, toByteTexture, toFloatTexture };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { DiscoveredItem, ItemResolutionError, discoverItems, resolveItem };
|
|
1
|
+
import { a as resolveItem, i as discoverItems, n as ItemDiscoveryOptions, r as ItemResolutionError, t as DiscoveredItem } from "../discovery-D89pVVJA.js";
|
|
2
|
+
export { DiscoveredItem, ItemDiscoveryOptions, ItemResolutionError, discoverItems, resolveItem };
|
package/dist/items/discovery.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as discoverItems, r as resolveItem, t as ItemResolutionError } from "../discovery-
|
|
1
|
+
import { n as discoverItems, r as resolveItem, t as ItemResolutionError } from "../discovery-iph0P2F2.js";
|
|
2
2
|
export { ItemResolutionError, discoverItems, resolveItem };
|
|
@@ -24,6 +24,12 @@ interface RunOptions {
|
|
|
24
24
|
minify?: boolean;
|
|
25
25
|
/** In-flight items (encode overlaps on libvips' threadpool; default 8). */
|
|
26
26
|
concurrency?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Drop classic item models with no matching translation (default true).
|
|
29
|
+
* Disable for a prepared asset tree whose own preprocessing has already
|
|
30
|
+
* filtered synthesized models and where every real model must be retained.
|
|
31
|
+
*/
|
|
32
|
+
filterUntranslatedModels?: boolean;
|
|
27
33
|
lightingProfile?: LightingProfileName;
|
|
28
34
|
itemList?: boolean;
|
|
29
35
|
onProgress?: (done: number, total: number, id: string, error?: string) => void;
|
|
@@ -3,7 +3,7 @@ import { n as LayeredResourceManager, t as FolderResourceManager } from "./manag
|
|
|
3
3
|
import { t as loadAtlasResolver } from "./registry-B9TcjVbs.js";
|
|
4
4
|
import { a as builtinDynamicResources } from "./generators-CcVRG30y.js";
|
|
5
5
|
import { a as defaultProperties } from "./definition-3MBm8ar_.js";
|
|
6
|
-
import { n as discoverItems, r as resolveItem } from "./discovery-
|
|
6
|
+
import { n as discoverItems, r as resolveItem } from "./discovery-iph0P2F2.js";
|
|
7
7
|
import { t as ModelLoader } from "./loader-A-BZa8J4.js";
|
|
8
8
|
import { s as toFloatTexture, t as blendPixel } from "./blend-CHP2-j9U.js";
|
|
9
9
|
import { r as encodeRasterAsset, t as encodeAnimatedIcon } from "./encode-3u49i-eD.js";
|
|
@@ -50,7 +50,7 @@ async function run(options) {
|
|
|
50
50
|
seen.add(placeholder);
|
|
51
51
|
ids.push(placeholder);
|
|
52
52
|
}
|
|
53
|
-
for (const namespace of namespaces) for (const item of await discoverItems(resources, namespace)) {
|
|
53
|
+
for (const namespace of namespaces) for (const item of await discoverItems(resources, namespace, { filterUntranslatedModels: options.filterUntranslatedModels })) {
|
|
54
54
|
if (seen.has(item.id)) continue;
|
|
55
55
|
if (options.builtin && !await itemExistsIn(options.resources, item.id)) continue;
|
|
56
56
|
seen.add(item.id);
|
package/dist/run.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { l as evaluateItemModel } from "./definition-BwX6Xxv0.js";
|
|
2
|
-
import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-
|
|
2
|
+
import { i as run, n as RunOptions, r as RunResult, t as ItemFailure } from "./run-BlSZw9Qk.js";
|
|
3
3
|
export { ItemFailure, RunOptions, RunResult, evaluateItemModel, run };
|
package/dist/run.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodecraft/rendermite",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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",
|