@nodecraft/rendermite 1.6.0 → 1.6.2

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.
Files changed (53) hide show
  1. package/dist/{block-entities-xv3bQpEX.js → block-entities-XAynAVUE.js} +1 -1
  2. package/dist/blocks/block-entities.js +1 -1
  3. package/dist/blocks/cli.js +1 -1
  4. package/dist/blocks/entities.js +1 -1
  5. package/dist/blocks/entity-models.d.ts +45 -2
  6. package/dist/blocks/entity-models.js +1 -1
  7. package/dist/blocks/export.d.ts +1 -1
  8. package/dist/blocks/export.js +1 -1
  9. package/dist/{classfile-BwaQjnUM.d.ts → classfile-BdLIk4Pe.d.ts} +16 -0
  10. package/dist/{classfile-CAhS5qNf.js → classfile-Bo7FUrrD.js} +42 -10
  11. package/dist/{cli-BSKnXBPr.js → cli-Br0mY0LV.js} +6 -2
  12. package/dist/cli.js +2 -2
  13. package/dist/entities/classfile.d.ts +1 -1
  14. package/dist/entities/classfile.js +1 -1
  15. package/dist/entities/inherit.d.ts +2 -2
  16. package/dist/entities/inherit.js +1 -1
  17. package/dist/entities/jar-classes.d.ts +2 -26
  18. package/dist/entities/jar-classes.js +2 -2
  19. package/dist/entities/link.d.ts +2 -2
  20. package/dist/entities/link.js +1 -1
  21. package/dist/entities/merge.d.ts +16 -1
  22. package/dist/entities/merge.js +2 -2
  23. package/dist/entities/model-bytecode.d.ts +1 -1
  24. package/dist/entities/model-bytecode.js +1 -1
  25. package/dist/entities/model-code.d.ts +1 -1
  26. package/dist/entities/model-code.js +1 -1
  27. package/dist/{entities-DvmA9fEV.js → entities-DubtdM11.js} +6 -2
  28. package/dist/{entity-fallback-Bth0fa7m.js → entity-fallback-BcJWh91-.js} +1 -1
  29. package/dist/{entity-models-B6-0r2gR.js → entity-models-D_QGok9j.js} +9 -5
  30. package/dist/{entity-textures-DFRIVdF1.js → entity-textures-4XXT8jVI.js} +25 -2
  31. package/dist/{export-D8fLC1wS.d.ts → export-B8tPsf4K.d.ts} +1 -1
  32. package/dist/{export-DT_drDoI.js → export-CTKEwro6.js} +3 -3
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.js +2 -2
  35. package/dist/{inherit-KkDsM2N_.js → inherit-C5Ifg3SM.js} +4 -4
  36. package/dist/{jar-classes-Bj15hjdr.js → jar-classes-3GVCJZT7.js} +38 -1
  37. package/dist/jar-classes-CSRrPAUy.d.ts +41 -0
  38. package/dist/{link-Bm5oQYh6.js → link-5GmBLTzk.js} +25 -1
  39. package/dist/merge-DeHruviG.js +109 -0
  40. package/dist/{model-bytecode-C1nw2G8O.js → model-bytecode-BQKCLPze.js} +151 -39
  41. package/dist/{model-code-BKMEMXxF.js → model-code-1Vuk-zj_.js} +1 -1
  42. package/dist/{model-code-B7jSFQqd.d.ts → model-code-BY44ao27.d.ts} +1 -1
  43. package/dist/{pipeline-BUIMzMzg.js → pipeline-7rvL6vx1.js} +1 -1
  44. package/dist/render/entity-fallback.js +1 -1
  45. package/dist/render/pipeline.js +1 -1
  46. package/dist/resources/entity-textures.d.ts +13 -1
  47. package/dist/resources/entity-textures.js +2 -2
  48. package/dist/{run-BQJkqc5f.js → run-BXAqZ5qY.js} +1 -1
  49. package/dist/run.js +1 -1
  50. package/dist/workers/render-worker.js +1 -1
  51. package/package.json +1 -1
  52. package/dist/entity-models-c2HpfdWV.d.ts +0 -49
  53. package/dist/merge-3HkeQ_6A.js +0 -46
@@ -1,49 +0,0 @@
1
- import { a as ResourceManager } from "./manager-exOIcdyx.js";
2
- import { S as EntityPackModel } from "./pack-format-QcVFxG_b.js";
3
- //#region src/blocks/entity-models.d.ts
4
- /** What the exporter needs to read code out of; a jar, in practice. */
5
- interface ClassSource {
6
- list: () => Promise<string[]>;
7
- read: (internalName: string) => Promise<Uint8Array | null>;
8
- }
9
- interface EntityGeometryResult {
10
- /** Model id (the class it came from) → geometry. */
11
- models: Record<string, EntityPackModel>;
12
- /** Entity id → model id, for the entity table to point with. */
13
- modelOf: Map<string, string>;
14
- /** Entity sheets the models address, to be stitched into the pack's own atlas. */
15
- spriteIds: Set<string>;
16
- failures: Array<{
17
- id: string;
18
- reason: string;
19
- }>;
20
- }
21
- interface CollectEntityGeometryOptions {
22
- version: string;
23
- /** Where mappings cache; the same directory the jars do. */
24
- cacheDir: string;
25
- classes: ClassSource;
26
- /** Entity ids to look for, as the registry named them. */
27
- entityIds: readonly string[];
28
- /** The sheet each entity resolved to, from the entity registry, keyed by entity id. */
29
- textureOf: ReadonlyMap<string, string>;
30
- /**
31
- * The assets, for the mods whose geometry is not in code at all.
32
- *
33
- * A GeckoLib mob ships Blockbench's bedrock format and registers it by resource location, so there
34
- * is nothing for the interpreter to read; `entity-geo.ts` finds and converts it instead.
35
- */
36
- resources?: ResourceManager;
37
- onProgress?: (done: number, total: number) => void;
38
- }
39
- /**
40
- * Recovers geometry for as many of `entityIds` as the code describes.
41
- *
42
- * Mappings are resolved once: downloaded for an obfuscated jar, and the identity for one that is not
43
- * (from the 26 line the client ships in the clear, and a mod jar never was obfuscated). A version that
44
- * is obfuscated *and* unmapped — 1.13.x — yields nothing, with the reason recorded once rather than
45
- * per entity.
46
- */
47
- declare function collectEntityGeometry(options: CollectEntityGeometryOptions): Promise<EntityGeometryResult>;
48
- //#endregion
49
- export { collectEntityGeometry as i, CollectEntityGeometryOptions as n, EntityGeometryResult as r, ClassSource as t };
@@ -1,46 +0,0 @@
1
- //#region src/entities/merge.ts
2
- /** A root the interpreter had to invent, because a `MeshDefinition`'s root part is anonymous. */
3
- const SYNTHETIC_ROOT = /^part\d+$/;
4
- /**
5
- * Where a piece's parts sit: at the top, or inside the one anonymous root a `MeshDefinition` makes.
6
- * Both merge into the same list of named slots and only one of them is nested.
7
- */
8
- function slotsOf(parts) {
9
- const [only] = parts;
10
- if (parts.length === 1 && only.cubes.length === 0 && SYNTHETIC_ROOT.test(only.name)) return {
11
- container: only,
12
- slots: only.children
13
- };
14
- return {
15
- container: null,
16
- slots: parts
17
- };
18
- }
19
- /** True when this piece built its own mesh rather than adding to one it was handed. */
20
- function buildsOwnMesh(model) {
21
- return slotsOf(model.parts).container !== null;
22
- }
23
- /** `base` plus the parts of `extra` that `base` does not name. */
24
- function mergeModels(base, extra) {
25
- const target = slotsOf(base.parts);
26
- const source = slotsOf(extra.parts);
27
- const named = new Set(target.slots.map((part) => part.name));
28
- const missing = source.slots.filter((part) => !named.has(part.name));
29
- if (missing.length === 0) return base;
30
- return {
31
- textureSize: base.textureSize[0] === 64 && base.textureSize[1] === 32 ? extra.textureSize : base.textureSize,
32
- parts: target.container ? [{
33
- ...target.container,
34
- children: [...target.container.children, ...missing]
35
- }] : [...target.slots, ...missing],
36
- notes: [.../* @__PURE__ */ new Set([...base.notes, ...extra.notes])]
37
- };
38
- }
39
- function countCubes(part) {
40
- return part.cubes.length + part.children.reduce((total, child) => total + countCubes(child), 0);
41
- }
42
- function cubesOf(model) {
43
- return model.parts.reduce((total, part) => total + countCubes(part), 0);
44
- }
45
- //#endregion
46
- export { slotsOf as a, mergeModels as i, countCubes as n, cubesOf as r, buildsOwnMesh as t };