文件
BotStore/package.json
T
lyizai ab598a7101 fix: 修掉 yaw 无界增长 —— 它让机器人原地走之字形、净位移恒为 0(1.11.0)
mineflayer 收到服务端 position 包时会直接 bot.entity.yaw = conv.fromNotchianYaw(…)
不做取模,而 GrimCompat 又在它基础上逐 tick 累加,两者叠加让 yaw 一路涨到
19254°(≈336 弧度)。

抓包实测的后果:
  yaw°:  -1373 → 19254 → -1650 → -1407 → -1373 → 19254 → …
  坐标:  (6757.50, 11953.70) ⇄ (6757.89, 11954.12)   0.4 格内反复振荡
相邻两包的朝向折合相差约 114°,而机器人一直按着前进键 ——
于是它原地走之字形、净位移恒为 0,看起来像「卡在墙前反复起跳」
(物理录制里 jump 74/240、水平碰撞 195/240、onGround 只有 79/240)。

这是扩地跑不完那 763 格长途的直接原因,也解释了出站包里 look 包(38490)
比 position_look(23804)还多。

修复:新增 wrapAngle,_onPhysicsTick 每 tick 归一化 entity.yaw 到 (-π, π],
setLook 也归一化传入的目标角度。归一化只改表示不改朝向
(shortestAngleDelta(huge, wrapped) === 0),对旋转逻辑完全透明。

测试 478 → 480。
2026-10-01 18:08:41 +08:00

40 行
1.0 KiB
JSON

{
"name": "autostore-bot",
"version": "1.11.0",
"description": "AutoStore Bot —— Minecraft 自动扩地机器人(mineflayer 重写版,多机器人挂机,Web 控制台,开拓日志,大地图,Grim 反作弊适配)",
"main": "src/index.js",
"scripts": {
"start": "node src/index.js",
"dev": "node --watch src/index.js",
"test": "node --test",
"check": "node scripts/check-syntax.js && node scripts/check-web-ids.js",
"deploy": "node scripts/deploy.js",
"ssh": "node scripts/ssh-helper.js"
},
"keywords": [
"minecraft",
"mineflayer",
"autostore",
"territory"
],
"author": "",
"license": "MIT",
"private": true,
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"chalk": "^4.1.2",
"dotenv": "^16.4.7",
"express": "^4.21.2",
"mineflayer": "^4.39.0",
"mineflayer-pathfinder": "^2.4.5",
"vec3": "^0.1.10",
"ws": "^8.18.0"
},
"devDependencies": {
"minecraft-data": "^3.102.3",
"ssh2": "^1.17.0"
}
}