@nodecraft/rendermite 1.6.3 → 1.6.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/blocks/cli.js +1 -1
- package/dist/blocks/export.js +1 -1
- package/dist/blocks/geo-blocks.d.ts +7 -0
- package/dist/blocks/geo-blocks.js +2 -0
- package/dist/{cli-B2-DjSYI.js → cli-DUWWH_Rc.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/{export-BFcXFTX6.js → export-CBXWRbBw.js} +10 -0
- package/dist/geo-blocks-CzkfL4Li.js +63 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/blocks/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as runBlocksCli } from "../cli-
|
|
1
|
+
import { t as runBlocksCli } from "../cli-DUWWH_Rc.js";
|
|
2
2
|
export { runBlocksCli };
|
package/dist/blocks/export.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as exportBlockPack } from "../export-
|
|
1
|
+
import { t as exportBlockPack } from "../export-CBXWRbBw.js";
|
|
2
2
|
export { exportBlockPack };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a as ResourceManager } from "../manager-exOIcdyx.js";
|
|
2
|
+
import { f as BlockPackModel } from "../pack-format-QcVFxG_b.js";
|
|
3
|
+
//#region src/blocks/geo-blocks.d.ts
|
|
4
|
+
/** Converts the already-flattened Gecko quads into the block pack's 0–16 triangle mesh. */
|
|
5
|
+
declare function geoBlockModel(blockId: string, resources: ResourceManager): Promise<BlockPackModel | null>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { geoBlockModel };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as builtinPackPath } from "./builtin-WkWjATeh.js";
|
|
2
2
|
import { n as LayeredResourceManager, t as FolderResourceManager } from "./manager-BNibYkmI.js";
|
|
3
|
-
import { t as exportBlockPack } from "./export-
|
|
3
|
+
import { t as exportBlockPack } from "./export-CBXWRbBw.js";
|
|
4
4
|
import { n as layeredClasses, t as JarClassReader } from "./jar-classes-3GVCJZT7.js";
|
|
5
5
|
import { n as prepareModResources } from "./prepare-Myd_ec4v.js";
|
|
6
6
|
import { t as downloadClientJar } from "./download-1wAfrGKx.js";
|
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ import { t as curatedModelOverrides } from "./models-CZjCOjs4.js";
|
|
|
6
6
|
import { n as harvestTintOverrides, t as curatedTintOverrides } from "./tints-BspVCz2G.js";
|
|
7
7
|
import { t as downloadClientJar } from "./download-1wAfrGKx.js";
|
|
8
8
|
import { a as prepareVersionResources, i as eraForVersion, n as GEOMETRY_DONOR_VERSIONS } from "./prepare-D49Gu4Lv.js";
|
|
9
|
-
import { t as runBlocksCli } from "./cli-
|
|
9
|
+
import { t as runBlocksCli } from "./cli-DUWWH_Rc.js";
|
|
10
10
|
import { t as run } from "./run-BXAqZ5qY.js";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import os from "node:os";
|
|
@@ -4,6 +4,7 @@ import { n as blockEntityGeometry, r as synthesizeVariants, t as INVISIBLE_BLOCK
|
|
|
4
4
|
import { a as parseBlockState, n as collectModels } from "./blockstate-eval-BRQ3NWY2.js";
|
|
5
5
|
import { t as collectEntities } from "./entities-DubtdM11.js";
|
|
6
6
|
import { t as collectEntityGeometry } from "./entity-models-D_QGok9j.js";
|
|
7
|
+
import { t as geoBlockModel } from "./geo-blocks-CzkfL4Li.js";
|
|
7
8
|
import { n as discoverItems } from "./discovery-CD0QqxSF.js";
|
|
8
9
|
import { a as salvageJson, i as resolveTexture, t as ModelLoader } from "./loader-C-NuJaEi.js";
|
|
9
10
|
import { t as collectItemSprites } from "./item-sprites-G-yikdfV.js";
|
|
@@ -415,6 +416,15 @@ async function exportBlockPack(options) {
|
|
|
415
416
|
modelTintIndices.set(reference, tintIndices);
|
|
416
417
|
for (const sprite of sprites) spriteIds.add(sprite);
|
|
417
418
|
}
|
|
419
|
+
for (const [id, references] of blockModels) {
|
|
420
|
+
const geo = await geoBlockModel(id, resources);
|
|
421
|
+
if (!geo) continue;
|
|
422
|
+
for (const reference of references) {
|
|
423
|
+
emittedModels[reference] = geo;
|
|
424
|
+
modelTintIndices.set(reference, /* @__PURE__ */ new Set());
|
|
425
|
+
}
|
|
426
|
+
for (const group of geo.mesh ?? []) spriteIds.add(group.sprite);
|
|
427
|
+
}
|
|
418
428
|
for (const [id, references] of blockModels) {
|
|
419
429
|
if (references.some((reference) => {
|
|
420
430
|
const model = emittedModels[reference];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { n as ResourceLocator } from "./locator-COMEtEn9.js";
|
|
2
|
+
import { i as parseGeo, n as geoToFaces } from "./geo-Desq-gRC.js";
|
|
3
|
+
//#region src/blocks/geo-blocks.ts
|
|
4
|
+
/** GeckoLib block geometry selected by a Java block-entity renderer rather than its placeholder JSON. */
|
|
5
|
+
/** Blocks whose ordinary cube model exists only for particles/breaking and is replaced in Java. */
|
|
6
|
+
const GEO_BLOCKS = {
|
|
7
|
+
"ars_nouveau:arcane_core": {
|
|
8
|
+
geo: "ars_nouveau:geo/arcane_core.geo.json",
|
|
9
|
+
texture: "ars_nouveau:block/arcane_core"
|
|
10
|
+
},
|
|
11
|
+
"ars_nouveau:enchanting_apparatus": {
|
|
12
|
+
geo: "ars_nouveau:geo/enchanting_apparatus.geo.json",
|
|
13
|
+
texture: "ars_nouveau:block/enchanting_apparatus"
|
|
14
|
+
},
|
|
15
|
+
"ars_nouveau:imbuement_chamber": {
|
|
16
|
+
geo: "ars_nouveau:geo/imbuement_chamber.geo.json",
|
|
17
|
+
texture: "ars_nouveau:block/imbuement_chamber"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const TRIANGLE_CORNERS = [
|
|
21
|
+
0,
|
|
22
|
+
1,
|
|
23
|
+
2,
|
|
24
|
+
0,
|
|
25
|
+
2,
|
|
26
|
+
3
|
|
27
|
+
];
|
|
28
|
+
/** Converts the already-flattened Gecko quads into the block pack's 0–16 triangle mesh. */
|
|
29
|
+
async function geoBlockModel(blockId, resources) {
|
|
30
|
+
const resource = GEO_BLOCKS[blockId];
|
|
31
|
+
if (!resource) return null;
|
|
32
|
+
const raw = await resources.getResource("raw", ResourceLocator.parse(resource.geo));
|
|
33
|
+
if (!raw) return null;
|
|
34
|
+
const geo = parseGeo(JSON.parse(raw.toString("utf8")));
|
|
35
|
+
if (!geo) return null;
|
|
36
|
+
const group = {
|
|
37
|
+
sprite: resource.texture,
|
|
38
|
+
positions: [],
|
|
39
|
+
uv: []
|
|
40
|
+
};
|
|
41
|
+
for (const face of geoToFaces(geo)) {
|
|
42
|
+
const uvs = [
|
|
43
|
+
[face.uv1[0], face.uv1[1]],
|
|
44
|
+
[face.uv1[0], face.uv2[1]],
|
|
45
|
+
[face.uv2[0], face.uv2[1]],
|
|
46
|
+
[face.uv2[0], face.uv1[1]]
|
|
47
|
+
];
|
|
48
|
+
for (const corner of TRIANGLE_CORNERS) {
|
|
49
|
+
group.positions.push(...face.vertices[corner].map((value) => value * 16));
|
|
50
|
+
group.uv.push(uvs[corner][0] * 16, uvs[corner][1] * 16);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (group.positions.length === 0) return null;
|
|
54
|
+
return {
|
|
55
|
+
ao: false,
|
|
56
|
+
elements: [],
|
|
57
|
+
mesh: [group],
|
|
58
|
+
particle: resource.texture,
|
|
59
|
+
renderType: "cutout"
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { geoBlockModel as t };
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { n as buildBlockTints, t as UNREGISTERED_TINTS } from "./tints-Cl0r-Ol3.
|
|
|
14
14
|
import { o as createAtlasResolver, s as parseAtlasSources, t as AtlasSourceError } from "./sources-BlUriDCs.js";
|
|
15
15
|
import { n as LayeredResourceManager, r as ResourceKind, t as FolderResourceManager } from "./manager-BNibYkmI.js";
|
|
16
16
|
import { n as TextureLoader, r as TextureResolutionError, t as AnimatedTexture } from "./loader-C18GpurU.js";
|
|
17
|
-
import { t as exportBlockPack } from "./export-
|
|
17
|
+
import { t as exportBlockPack } from "./export-CBXWRbBw.js";
|
|
18
18
|
import { n as UnsafeJarError, r as isUnsafeEntryPath, t as JarResourceManager } from "./jar-W2cV2ZVO.js";
|
|
19
19
|
import { n as prepareModResources } from "./prepare-Myd_ec4v.js";
|
|
20
20
|
import { a as prepareVersionResources, i as eraForVersion, r as compareVersions } from "./prepare-D49Gu4Lv.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodecraft/rendermite",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.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",
|