Skip to content

Commit 8f4e4cb

Browse files
github-actions[bot]ci010
authored andcommitted
chore: bump version 2.7.0
1 parent 91d2119 commit 8f4e4cb

File tree

7 files changed

+557
-43
lines changed

7 files changed

+557
-43
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## 2.7.0
4+
### @xmcl/core@2.1.0
5+
#### Features
6+
7+
- feat: add resolveFromPath ([890f70aa4f492d97e5e7513afcfc71b424962bf2](https://github.com/voxelum/minecraft-launcher-core-node/commit/890f70aa4f492d97e5e7513afcfc71b424962bf2))
8+
### @xmcl/curseforge@0.1.0
9+
#### Features
10+
11+
- feat: curseforge support ([922948df3987fad92299af3c5dd5f02d06c97d76](https://github.com/voxelum/minecraft-launcher-core-node/commit/922948df3987fad92299af3c5dd5f02d06c97d76))
12+
### @xmcl/installer@2.6.4
13+
#### Bug Fixes
14+
15+
- fix: remove redundent check ([9ee553dd5e04f7fbdd89274d1c4d2dbc19973114](https://github.com/voxelum/minecraft-launcher-core-node/commit/9ee553dd5e04f7fbdd89274d1c4d2dbc19973114))
16+
- fix: correct the task name ([408d35d5f77bc6da558d45ac74e308014f8802ae](https://github.com/voxelum/minecraft-launcher-core-node/commit/408d35d5f77bc6da558d45ac74e308014f8802ae))
17+
- fix: expose error to outer ([5c5a0fa89605b1a0babe2fc5e681134cd749bf4f](https://github.com/voxelum/minecraft-launcher-core-node/commit/5c5a0fa89605b1a0babe2fc5e681134cd749bf4f))
18+
- fix: expose post postProcess task ([2933d576feff0c4e0aa66b4a242903ea20b45d7e](https://github.com/voxelum/minecraft-launcher-core-node/commit/2933d576feff0c4e0aa66b4a242903ea20b45d7e))
19+
- Dependency @xmcl/core bump **patch**
20+
21+
322
## 2.6.3
423
### @xmcl/installer@2.6.3
524
#### Bug Fixes

USAGE.md

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ Create THREE.js player model:
5858
// add o3d to your three scene
5959
```
6060

61+
### Find Curseforge Mods by search keyword
62+
63+
You can use keyword to search
64+
65+
```ts
66+
import { searchAddons, SearchOptions } from '@xmcl/curseforge'
67+
const searchOptions: SearchOptions = {
68+
categoryId: 6, // 6 is mod,
69+
};
70+
const setting: GameSetting = searchAddons(settingString);
71+
const string: string = GameSetting.stringify(setting);
72+
```
73+
6174
### Install Fabric
6275

6376
Fetch the new fabric version list.
@@ -257,70 +270,53 @@ Detach from the parent process. So your launcher's exit/crash won't affact the M
257270

258271
### Load Minecraft Block Model
259272

260-
You can use this to load Minecraft block model and texture.
273+
You can use this to load Minecraft block model and texture just like Minecraft.
261274

262275
```ts
263-
import { ResourceManager, ModelLoader, TextureRegistry, ModelRegistry } from "@xmcl/resource-manager";
264-
import { BlockModel } from "@xmcl/system";
276+
import { ResourcePack, Resource, BlockModel } from "@xmcl/resourcepack";
277+
import { ResourceManager, ModelLoader } from "@xmcl/resource-manager";
278+
import { System } from "@xmcl/system";
265279

266280
const man = new ResourceManager();
267-
// setup resource manager
268-
man.addResourceSource(new YourCustomizedResourceSource());
281+
const resourcePack = new ResourcePack(await System.openFileSystem("/path/to/resource-pack.zip"));
282+
// setup resource pack
283+
man.addResourcePack(resourcePack);
269284

270285
const loader = new ModelLoader(man);
271286

272287
await loader.loadModel("block/grass"); // load grass model
273288
await loader.loadModel("block/stone"); // load stone model
274289
// ... load whatever you want model
275290

276-
const textures: TextureRegistry = loader.textures;
277-
const models: ModelRegistry = loader.models;
291+
const textures: Record<string, Resource> = loader.textures;
292+
const models: Record<string, BlockModel.Resolved> = loader.models;
278293

279294
const resolvedModel: BlockModel.Resolved = models["block/grass"];
280295
```
281296

282297
### Load Minecraft Resource
283298

299+
*Notice that these API are not stable. May changed in future*
300+
284301
You can use this module in nodejs/electron:
285302

286303
```ts
304+
import { ResourcePack, Resource } from "@xmcl/resourcepack";
287305
import { ResourceManager, ResourceLocation } from "@xmcl/resource-manager"
288-
const manager: ResourceManager<Buffer> = new ResourceManager();
306+
const manager: ResourceManager = new ResourceManager();
289307

290308
// add a resource source which load resource from file
291-
await manager.addResourceSource(new MyFileSystemResourceSource('/base/path'));
309+
await manager.addResourcePack(new ResourcePack(await System.openFileSystem('/base/path')));
292310

293311
// load grass block model resource; it will load file at `assets/${location.domain}/${location.path}`
294312
// which is '/base/path/assets/minecraft/models/block/grass.json'
295313
// same logic with minecraft
296314
const resource = await manager.load(ResourceLocation.ofModelPath('block/grass'));
297315

298-
const url: string = resource.url; // your resource url which is file:///base/path/assets/minecraft/models/block/grass.json
299316
const content: Buffer = resource.content; // your resource content
300317
const modelJSON = JSON.parse(content.toString());
301318
```
302319

303-
You can also use this module in browser:
304-
305-
```ts
306-
import { ResourceManager, ResourceLocation } from "@xmcl/resource-manager"
307-
const manager: ResourceManager<string> = new ResourceManager();
308-
309-
// add a resource source which load resource from an remote url
310-
await manager.addResourceSource(new MyRemoteWhateverResourceSource('https://my-domain/xxx'));
311-
312-
// load grass block model resource; it will load file at `assets/${location.domain}/${location.path}`
313-
// which is 'https://my-domain/xxx/assets/minecraft/models/block/grass.json'
314-
// same logic with minecraft
315-
const resource = await manager.load(ResourceLocation.ofModelPath('block/grass'));
316-
317-
const url: string = resource.url; // your resource url which is https://my-domain/xxx/assets/minecraft/models/block/grass.json
318-
const content: string = resource.content; // your resource content string
319-
const modelJSON = JSON.parse(content);
320-
```
321-
322-
Please notice that in the sample above, all the `ResourceSource` should be implemented by yourself.
323-
324320
The resource manager will do the simplest cache for same resource location.
325321

326322
You can clear the cache by:
@@ -380,6 +376,17 @@ Read the forge mod config file (.cfg)
380376
```
381377

382378

379+
### Parse GameSetting (options.txt)
380+
381+
Serialize/Deserialize the minecraft game setting string.
382+
383+
```ts
384+
import { GameSetting } from '@xmcl/gamesetting'
385+
const settingString;
386+
const setting: GameSetting = GameSetting.parse(settingString);
387+
const string: string = GameSetting.stringify(setting);
388+
```
389+
383390
### Parse Liteloader Mod
384391

385392
Read .litemod metadata:

0 commit comments

Comments
 (0)