From 64e47e7781540c8e6c6704b7bc3b5b5b954253d1 Mon Sep 17 00:00:00 2001 From: Lyizai Date: Mon, 17 Aug 2026 07:02:22 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20v1.0.5=20=E4=BF=AE=E5=A4=8D=E6=B0=B4?= =?UTF-8?q?=E4=B8=8A=E6=8C=81=E7=BB=AD=E8=B7=B3=E8=B7=83=E5=B9=B2=E6=89=B0?= =?UTF-8?q?=E5=AF=BB=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 自动游泳仅在玩家完全没入水中(isSubmergedInWater)时触发跳跃 - 玩家在水面上正常游泳时不再干预,避免干扰 Baritone 水平寻路 - 版本号更新为 1.0.5 --- README.md | 4 ++-- .../autostore/client/controller/ExpansionController.java | 9 ++++----- src/main/resources/fabric.mod.json | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ffbec04..7146790 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ## 安装 1. 安装 Fabric Loader 0.16.14+ 和 Fabric API -2. 将 `autostore-1.0.4.jar` 放入 `.minecraft/mods/` 目录 +2. 将 `autostore-1.0.5.jar` 放入 `.minecraft/mods/` 目录 3. 启动游戏,按 `Ctrl+R` 打开 GUI ## 构建 @@ -24,4 +24,4 @@ ./build_mod.sh ``` -输出文件:`autostore-1.0.4.jar` +输出文件:`autostore-1.0.5.jar` diff --git a/src/main/java/autostore/client/controller/ExpansionController.java b/src/main/java/autostore/client/controller/ExpansionController.java index 2f1373b..6678fd4 100644 --- a/src/main/java/autostore/client/controller/ExpansionController.java +++ b/src/main/java/autostore/client/controller/ExpansionController.java @@ -502,7 +502,8 @@ implements SubtitleChatMonitor.Listener { /** * 自动游泳逻辑(每帧调用): - * 玩家处于水中且未站在地面上时自动跳跃(模拟按住空格键),防止溺水。 + * 仅在玩家完全没入水中(有溺水风险)时自动跳跃,保持浮在水面。 + * 玩家在水面上正常游泳时不做任何干预,避免干扰 Baritone 的水平寻路。 */ private void tickAutoSwim(MinecraftClient client) { if (!this.isRunning()) { @@ -512,10 +513,8 @@ implements SubtitleChatMonitor.Listener { if (player == null) { return; } - // 完全没入水中,或接触水面且未站在地面(深水区漂浮)时都需要游泳 - boolean inWater = player.isSubmergedInWater() - || (player.isTouchingWater() && !player.isOnGround()); - if (inWater) { + // 只有完全没入水中(头部在水面以下)才有溺水风险,此时才需要跳跃上浮 + if (player.isSubmergedInWater()) { player.jump(); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 47dc669..8ecf8a8 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1 +1 @@ -{"schemaVersion":1,"id":"autostore","version":"1.0.4","name":"AutoStore","description":"","authors":[],"contact":{},"license":"All-Rights-Reserved","environment":"client","entrypoints":{"fabric-datagen":["autostore.client.AutoStoreModDataGenerator"],"client":["autostore.client.AutoStoreModClient"],"main":["autostore.AutoStoreMod"]},"mixins":["autostore.mixins.json",{"config":"autostore.client.mixins.json","environment":"client"}],"depends":{"fabricloader":">=0.16.14","fabric-api":"*","minecraft":"1.21.4"},"jars":[{"file":"META-INF/jars/baritone-api-fabric-1.13.1.jar"}]} \ No newline at end of file +{"schemaVersion":1,"id":"autostore","version":"1.0.5","name":"AutoStore","description":"","authors":[],"contact":{},"license":"All-Rights-Reserved","environment":"client","entrypoints":{"fabric-datagen":["autostore.client.AutoStoreModDataGenerator"],"client":["autostore.client.AutoStoreModClient"],"main":["autostore.AutoStoreMod"]},"mixins":["autostore.mixins.json",{"config":"autostore.client.mixins.json","environment":"client"}],"depends":{"fabricloader":">=0.16.14","fabric-api":"*","minecraft":"1.21.4"},"jars":[{"file":"META-INF/jars/baritone-api-fabric-1.13.1.jar"}]} \ No newline at end of file