@kzheart_/mc-pilot 0.1.4 → 0.1.5

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.
@@ -10,9 +10,9 @@ const VERSION_MATRIX = [
10
10
  spigot: { supported: true, requiresBuildTools: true }
11
11
  },
12
12
  clients: {
13
- fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.0", validation: "verified" },
13
+ fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.1", validation: "verified" },
14
14
  forge: { supported: false, notes: "不支持此版本" },
15
- neoforge: { supported: true, loaderVersion: "21.4.x", modVersion: "0.1.0" }
15
+ neoforge: { supported: true, loaderVersion: "21.4.x", modVersion: "0.1.1" }
16
16
  }
17
17
  },
18
18
  {
@@ -25,9 +25,9 @@ const VERSION_MATRIX = [
25
25
  spigot: { supported: true, requiresBuildTools: true }
26
26
  },
27
27
  clients: {
28
- fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.0", validation: "verified" },
28
+ fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.1", validation: "verified" },
29
29
  forge: { supported: false, notes: "不支持此版本" },
30
- neoforge: { supported: true, loaderVersion: "21.1.x", modVersion: "0.1.0" }
30
+ neoforge: { supported: true, loaderVersion: "21.1.x", modVersion: "0.1.1" }
31
31
  }
32
32
  },
33
33
  {
@@ -40,8 +40,8 @@ const VERSION_MATRIX = [
40
40
  spigot: { supported: true, requiresBuildTools: true }
41
41
  },
42
42
  clients: {
43
- fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.0" },
44
- forge: { supported: true, loaderVersion: "49.0.49", modVersion: "0.1.0" },
43
+ fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.1" },
44
+ forge: { supported: true, loaderVersion: "49.0.49", modVersion: "0.1.1" },
45
45
  neoforge: { supported: false, notes: "不支持此版本" }
46
46
  }
47
47
  },
@@ -55,7 +55,7 @@ const VERSION_MATRIX = [
55
55
  spigot: { supported: true, requiresBuildTools: true }
56
56
  },
57
57
  clients: {
58
- fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.0", validation: "verified" },
58
+ fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.1", validation: "verified" },
59
59
  forge: { supported: false, notes: "当前未接入此 loader" },
60
60
  neoforge: { supported: false, notes: "不支持此版本" }
61
61
  }
@@ -70,7 +70,7 @@ const VERSION_MATRIX = [
70
70
  spigot: { supported: true, requiresBuildTools: true }
71
71
  },
72
72
  clients: {
73
- fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.0" },
73
+ fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.1" },
74
74
  forge: { supported: false, notes: "当前未接入此 loader" },
75
75
  neoforge: { supported: false, notes: "不支持此版本" }
76
76
  }
@@ -85,8 +85,8 @@ const VERSION_MATRIX = [
85
85
  spigot: { supported: true, requiresBuildTools: true }
86
86
  },
87
87
  clients: {
88
- fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.0" },
89
- forge: { supported: true, loaderVersion: "47.x", modVersion: "0.1.0" },
88
+ fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.1" },
89
+ forge: { supported: true, loaderVersion: "47.x", modVersion: "0.1.1" },
90
90
  neoforge: { supported: false, notes: "不支持此版本" }
91
91
  }
92
92
  },
@@ -100,8 +100,8 @@ const VERSION_MATRIX = [
100
100
  spigot: { supported: true, requiresBuildTools: true }
101
101
  },
102
102
  clients: {
103
- fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.0", validation: "verified" },
104
- forge: { supported: true, loaderVersion: "40.x", modVersion: "0.1.0" },
103
+ fabric: { supported: true, loaderVersion: "0.16.10", modVersion: "0.1.1", validation: "verified" },
104
+ forge: { supported: true, loaderVersion: "40.x", modVersion: "0.1.1" },
105
105
  neoforge: { supported: false, notes: "不支持此版本" }
106
106
  }
107
107
  },
@@ -116,7 +116,7 @@ const VERSION_MATRIX = [
116
116
  },
117
117
  clients: {
118
118
  fabric: { supported: false, notes: "当前未接入此版本 mod" },
119
- forge: { supported: true, loaderVersion: "36.x", modVersion: "0.1.0" },
119
+ forge: { supported: true, loaderVersion: "36.x", modVersion: "0.1.1" },
120
120
  neoforge: { supported: false, notes: "不支持此版本" }
121
121
  }
122
122
  },
@@ -131,7 +131,7 @@ const VERSION_MATRIX = [
131
131
  },
132
132
  clients: {
133
133
  fabric: { supported: false, notes: "不支持此版本" },
134
- forge: { supported: true, loaderVersion: "14.23.x", modVersion: "0.1.0" },
134
+ forge: { supported: true, loaderVersion: "14.23.x", modVersion: "0.1.1" },
135
135
  neoforge: { supported: false, notes: "不支持此版本" }
136
136
  }
137
137
  }
@@ -197,7 +197,10 @@ export async function downloadClientMod(context, options, dependencies = {}) {
197
197
  const runtimePaths = resolveLaunchRuntimePaths(context, options);
198
198
  const managedRuntime = runtimePaths
199
199
  ? undefined
200
- : await prepareManagedRuntimeImpl(variant, clientRootDir, { fetchImpl });
200
+ : await prepareManagedRuntimeImpl(variant, {
201
+ runtimeRootDir: path.join(cacheManager.getRootDir(), "client", "runtime", variant.minecraftVersion),
202
+ gameDir: minecraftDir
203
+ }, { fetchImpl });
201
204
  const generatedLaunchArgs = runtimePaths
202
205
  ? buildLaunchArgs(runtimePaths, variant)
203
206
  : buildManagedLaunchArgs(managedRuntime.runtimeRootDir, managedRuntime.versionId, managedRuntime.gameDir);
@@ -7,4 +7,8 @@ export interface PreparedFabricRuntime {
7
7
  gameDir: string;
8
8
  versionId: string;
9
9
  }
10
- export declare function prepareManagedFabricRuntime(variant: ModVariant, clientRootDir: string, dependencies?: PrepareFabricRuntimeDependencies): Promise<PreparedFabricRuntime>;
10
+ export interface PrepareFabricRuntimeOptions {
11
+ runtimeRootDir: string;
12
+ gameDir: string;
13
+ }
14
+ export declare function prepareManagedFabricRuntime(variant: ModVariant, runtimeOptions: PrepareFabricRuntimeOptions, dependencies?: PrepareFabricRuntimeDependencies): Promise<PreparedFabricRuntime>;
@@ -1,5 +1,4 @@
1
1
  import { mkdir } from "node:fs/promises";
2
- import path from "node:path";
3
2
  import { setTimeout as sleep } from "node:timers/promises";
4
3
  import { MinecraftFolder, Version } from "@xmcl/core";
5
4
  import { getVersionList, installDependencies, installFabric, installVersion } from "@xmcl/installer";
@@ -42,7 +41,7 @@ async function fetchWithRetry(input, init, attempts = 4) {
42
41
  }
43
42
  throw lastError;
44
43
  }
45
- export async function prepareManagedFabricRuntime(variant, clientRootDir, dependencies = {}) {
44
+ export async function prepareManagedFabricRuntime(variant, runtimeOptions, dependencies = {}) {
46
45
  const fetchImpl = dependencies.fetchImpl ?? fetchWithRetry;
47
46
  const loaderVersion = variant.fabricLoaderVersion;
48
47
  if (!loaderVersion) {
@@ -51,8 +50,7 @@ export async function prepareManagedFabricRuntime(variant, clientRootDir, depend
51
50
  message: `Variant ${variant.id} does not define a Fabric loader version`
52
51
  }, 4);
53
52
  }
54
- const runtimeRootDir = path.join(clientRootDir, "runtime");
55
- const gameDir = path.join(clientRootDir, "minecraft");
53
+ const { runtimeRootDir, gameDir } = runtimeOptions;
56
54
  await mkdir(runtimeRootDir, { recursive: true });
57
55
  await mkdir(gameDir, { recursive: true });
58
56
  const minecraft = new MinecraftFolder(runtimeRootDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kzheart_/mc-pilot",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Minecraft plugin/mod automated testing CLI – control a real Minecraft client to simulate player actions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,7 +37,7 @@
37
37
  "scripts": {
38
38
  "build": "tsc -p tsconfig.json",
39
39
  "test": "tsc -p tsconfig.json && node --test dist/*.test.js dist/**/*.test.js",
40
- "test:e2e": "tsc -p tsconfig.json && node --test dist/*.e2e.test.js dist/**/*.e2e.test.js"
40
+ "test:e2e": "tsc -p tsconfig.json && node --test dist/*.e2e.test.js"
41
41
  },
42
42
  "dependencies": {
43
43
  "@xmcl/core": "^2.15.1",