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 +43 -3
- package/dist/browser/index.d.mts +1105 -162
- package/dist/browser/index.d.ts +1105 -162
- package/dist/browser/index.js +13111 -4219
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +13116 -4181
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +92629 -72872
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +1104 -161
- package/dist/node/index.d.ts +1104 -161
- package/dist/node/index.js +13290 -4286
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +13223 -4211
- package/dist/node/index.mjs.map +1 -1
- package/package.json +23 -14
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
|
|
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
|
|
6
|
+
Install the beta package with its three.js peer:
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
yarn add minerender@
|
|
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.
|