@kzheart_/mc-pilot 0.9.3 → 0.9.6

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.
@@ -56,6 +56,11 @@
56
56
  "params": [],
57
57
  "description": "获取 GUI 信息"
58
58
  },
59
+ {
60
+ "name": "gui.layout",
61
+ "params": [],
62
+ "description": "获取 GUI 精确布局和槽位屏幕坐标"
63
+ },
59
64
  {
60
65
  "name": "gui.snapshot",
61
66
  "params": [],
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "defaultVariant": "1.20.4-fabric",
3
3
  "buildSystem": "multi-module",
4
- "versions": ["1.18.2", "1.20.1", "1.20.2", "1.20.4", "1.21.1", "1.21.4"],
4
+ "versions": ["1.18.2", "1.20.1", "1.20.2", "1.20.4", "1.21.1", "1.21.4", "1.21.11"],
5
5
  "variants": [
6
6
  {
7
7
  "id": "1.18.2-fabric",
@@ -137,6 +137,18 @@
137
137
  "modVersion": "0.9.1",
138
138
  "neoforgeVersion": "21.4.75",
139
139
  "javaVersion": 21
140
+ },
141
+ {
142
+ "id": "1.21.11-fabric",
143
+ "minecraftVersion": "1.21.11",
144
+ "loader": "fabric",
145
+ "support": "ready",
146
+ "validation": "verified",
147
+ "modVersion": "0.9.1",
148
+ "fabricLoaderVersion": "0.19.2",
149
+ "yarnMappings": "1.21.11+build.5",
150
+ "javaVersion": 21,
151
+ "gradleModule": "version-1.21.11"
140
152
  }
141
153
  ]
142
154
  }
@@ -74,7 +74,9 @@ export function createClientCommand() {
74
74
  env: {
75
75
  MCT_CLIENT_MOD_VARIANT: downloaded.variantId,
76
76
  MCT_CLIENT_MOD_JAR: downloaded.jar
77
- }
77
+ },
78
+ javaCommand: downloaded.javaCommand,
79
+ javaVersion: downloaded.javaVersion
78
80
  });
79
81
  return {
80
82
  created: true,
@@ -4,6 +4,7 @@ import { createRequestAction, parseNumberList, resolveScreenshotOutputPath, send
4
4
  export function createGuiCommand() {
5
5
  const command = new Command("gui").description("GUI / container interaction (use \"gui snapshot\" to inspect slot indices and contents)");
6
6
  command.command("info").description("Get current GUI info (title, type, slot count)").action(createRequestAction("gui.info", () => ({})));
7
+ command.command("layout").description("Get precise GUI bounds and slot screen coordinates").action(createRequestAction("gui.layout", () => ({})));
7
8
  command.command("snapshot").description("Get full GUI snapshot with all slot contents").action(createRequestAction("gui.snapshot", () => ({})));
8
9
  command
9
10
  .command("slot")
@@ -1,5 +1,20 @@
1
1
  import { loadModVariantCatalogSync } from "./ModVariantCatalog.js";
2
2
  const VERSION_MATRIX = [
3
+ {
4
+ minecraftVersion: "1.21.11",
5
+ javaVersion: "21+",
6
+ servers: {
7
+ vanilla: { supported: true },
8
+ paper: { supported: true, latestBuild: 69 },
9
+ purpur: { supported: true, latestBuild: 2568 },
10
+ spigot: { supported: true, requiresBuildTools: true }
11
+ },
12
+ clients: {
13
+ fabric: { supported: true, loaderVersion: "0.19.2", modVersion: "0.9.1", validation: "verified" },
14
+ forge: { supported: false, notes: "不支持此版本" },
15
+ neoforge: { supported: false, validation: "planned", notes: "计划中" }
16
+ }
17
+ },
3
18
  {
4
19
  minecraftVersion: "1.21.4",
5
20
  javaVersion: "21+",
@@ -10,7 +10,10 @@ const DOWNLOAD_DISPATCHER = new Agent({
10
10
  connect: {
11
11
  timeout: 30_000
12
12
  },
13
- connections: 2
13
+ headersTimeout: 30_000,
14
+ bodyTimeout: 30_000,
15
+ connections: 1,
16
+ pipelining: 0
14
17
  }).compose(interceptors.retry({
15
18
  maxRetries: 4,
16
19
  minTimeout: 500,
@@ -74,8 +77,8 @@ async function prepareManagedRuntime(variant, runtimeOptions, dependencies, expe
74
77
  await installDependencies(resolvedVersion, {
75
78
  side: "client",
76
79
  dispatcher: DOWNLOAD_DISPATCHER,
77
- assetsDownloadConcurrency: 2,
78
- librariesDownloadConcurrency: 2
80
+ assetsDownloadConcurrency: 1,
81
+ librariesDownloadConcurrency: 1
79
82
  });
80
83
  await applyArm64LwjglPatch(runtimeRootDir, installedVersionId, { fetchImpl });
81
84
  await writeFile(readyMarker, new Date().toISOString(), "utf8");
@@ -10,6 +10,8 @@ export interface CreateClientOptions {
10
10
  mute?: boolean;
11
11
  launchArgs?: string[];
12
12
  env?: Record<string, string>;
13
+ javaCommand?: string;
14
+ javaVersion?: number;
13
15
  }
14
16
  export interface LaunchClientOptions {
15
17
  server?: string;
@@ -33,6 +33,8 @@ export class ClientInstanceManager {
33
33
  mute: options.mute,
34
34
  launchArgs: options.launchArgs,
35
35
  env: options.env,
36
+ javaCommand: options.javaCommand,
37
+ javaVersion: options.javaVersion,
36
38
  createdAt: new Date().toISOString()
37
39
  };
38
40
  await writeFile(path.join(instanceDir, INSTANCE_FILE), `${JSON.stringify(meta, null, 2)}\n`, "utf8");
@@ -94,6 +96,7 @@ export class ClientInstanceManager {
94
96
  MCT_CLIENT_SERVER: options.server ?? "",
95
97
  MCT_CLIENT_WS_PORT: String(wsPort),
96
98
  MCT_CLIENT_HEADLESS: String(options.headless ?? meta.headless ?? false),
99
+ ...(meta.javaCommand ? { MCT_CLIENT_JAVA: meta.javaCommand } : {}),
97
100
  ...(mute === undefined ? {} : { MCT_CLIENT_MUTE: String(mute) })
98
101
  }
99
102
  });
@@ -19,6 +19,8 @@ export interface ClientInstanceMeta {
19
19
  mute?: boolean;
20
20
  launchArgs?: string[];
21
21
  env?: Record<string, string>;
22
+ javaCommand?: string;
23
+ javaVersion?: number;
22
24
  createdAt: string;
23
25
  }
24
26
  export interface ServerRuntimeEntry {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kzheart_/mc-pilot",
3
- "version": "0.9.3",
3
+ "version": "0.9.6",
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": {