minerender 2.1.0-alpha.7 → 2.1.0-alpha.73

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 CHANGED
@@ -1,12 +1,12 @@
1
1
  # MineRender V2
2
2
 
3
3
  A TypeScript library for interactive Minecraft skins, models, blocks, entities, and worlds.
4
- V2 is in alpha. See the [roadmap](https://github.com/InventivetalentDev/MineRender/blob/main/ROADMAP.md) for feature parity and remaining work.
4
+ V2 is in beta. See the [roadmap](https://github.com/InventivetalentDev/MineRender/blob/main/ROADMAP.md) for feature parity and remaining work.
5
5
 
6
- Install the alpha package with its three.js peer:
6
+ Install the beta package with its three.js peer:
7
7
 
8
8
  ```sh
9
- yarn add minerender@alpha three@^0.158.0
9
+ yarn add minerender@beta three@^0.186.1
10
10
  ```
11
11
 
12
12
  In a browser application:
@@ -22,3 +22,43 @@ renderer.start();
22
22
  The package provides ESM and CommonJS entries for browsers and Node.js, plus
23
23
  `dist/bundle.js` for the `MineRender` browser global. Node imports require the optional
24
24
  native `canvas` dependency; headless rendering is still in development.
25
+
26
+ Requires Node.js 22.12+ or a browser with WebGL 2, Fetch, `AbortSignal.any()`, and `AbortSignal.timeout()`.
27
+
28
+ ## Resource-pack ZIPs
29
+
30
+ Register a browser `File` or `Blob` before loading models or textures:
31
+
32
+ ```ts
33
+ import { ArchiveAssetSource, AssetLoader, Caching } from "minerender";
34
+
35
+ AssetLoader.setVersion("1.21.11");
36
+ AssetLoader.addSource("pack", ArchiveAssetSource.blob(resourcePackFile));
37
+ Caching.clear();
38
+ ```
39
+
40
+ `ArchiveAssetSource` reads the root `pack.mcmeta` once. Matching overlays take
41
+ precedence in reverse declaration order, followed by the pack's base files.
42
+ Both legacy `formats` ranges and modern `min_format`/`max_format` ranges are
43
+ supported. A pack's `filter.block` rules suppress matching files in lower-priority
44
+ sources, including contributions to combined fonts; the pack's own files remain available.
45
+
46
+ Packs with overlays lazily resolve the selected Minecraft version's resource and
47
+ data pack formats from `https://assets.mcasset.cloud/<version>/game-version.json`.
48
+ [MCAsset-Downloader](https://github.com/InventivetalentDev/MCAsset-Downloader) extracts
49
+ this file unchanged from the official client JAR's root `version.json`.
50
+ For offline use, older JARs without this metadata, or versions not yet re-extracted,
51
+ pass explicit formats:
52
+
53
+ ```ts
54
+ const pack = ArchiveAssetSource.blob(resourcePackFile, { resourcePackFormat: [75, 0] });
55
+ ```
56
+
57
+ A number selects minor version zero. Use `dataPackFormat` separately for files
58
+ under `data/`. Packs without overlays make no version-metadata request. Missing
59
+ `pack.mcmeta` keeps plain archive loading; invalid metadata rejects the lookup.
60
+
61
+ Filter expressions use JavaScript regular expressions with substring matching.
62
+ Namespace and path matches can come from different rules, following vanilla's
63
+ filter behavior. Paths include the asset type and extension, such as
64
+ `textures/block/stone.png`. Java-only regular expression syntax is not supported.