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