免责声明
本项目是 Rabbit Pathfinding Fixed 的一个分支。我不声称拥有原始代码或资源的所有权,也未更改任何代码逻辑。所有功劳归于 litetex。我只是为 Forge 生态系统制作了一个移植版本。
Rabbit Pathfinding Fixed
高效修复兔子的寻路问题。
截至 1.21.1,兔子寻路存在多个问题:
基础寻路
- 跳跃高度/速度的计算不正确且实现糟糕。
这导致在攀爬方块时跳跃幅度过小。 - 兔子在跳跃期间“停滞”(无水平移动)——因此它们在尝试攀爬方块时只是在原地向上跳。
这种行为是由RabbitMoveControl引起的,它仅在移动过程中正确设置(水平)速度,而在跳跃时未正确设置。 - 兔子卡住 / 试图永远徘徊。
- 根本原因是
EntityNavigation根据移动速度设置其超时时间。
如果移动速度为 0(当兔子/生物“卡住”时就是这种情况),超时时间也为 0... 如果超时时间为 0,则会被忽略,因此会无限执行(直到被外部因素如其他目标中断)。 - 兔子在空闲时只有一个目标:
WanderAround(Far)。大多数其他实体也使用LookAroundGoal。
因此,上述提到的无限导航永远不会停止,以便像大多数其他生物一样执行另一个目标。 RabbitMoveControl#tick不断更新兔子的速度(RabbitEntity#setSpeed)。
在此过程中,它还间接执行moveControl#moveTo,因此即使在不应该这样做的时候,兔子也会试图到达它的最后一个目标。
- 根本原因是
从
1.21.4/24w46a开始,MC-150224 已修复,纠正了跳跃高度 (1) 并解决了停滞问题 (2)。
然而,所有其他部分——包括上述修复中的优化和健全性检查——仍然缺失。
食用胡萝卜作物
- 兔子无法到达作物,总是在距离作物一个方块处停下。
这是因为选择了错误的作物方块距离(它是1但应该是0)。 - 即使在跳跃且处于空中时,兔子也会立即吃掉作物。
- 由于
shouldContinue和isTargetPos方法的不正确实现,目标/行为会立即中止(在选择目标作物方块后的几个刻后)。
还提供详细的 视频对比。
Disclaimer
This is a fork of the Rabbit Pathfinding Fixed. I do not claim ownership of the original code, assets nor changing any of the code logic. All credit goes to litetex. I just made a port for Forge ecosystem.
Rabbit Pathfinding Fixed
Fixes rabbit pathfinding efficiently.
As of 1.21.1 there are multiple problems with rabbit pathfinding:
Basic pathfinding
- The calculation of the jump height/velocity is incorrect and poorly implemented.
This results in too small jumps for climbing over a block. - Rabbits "stall" (no horizontal movement) during jumps - due to this they just jump upwards in the same place when trying to climb a block.
This behavior is caused byRabbitMoveControlwhich only sets the (horizontal) speed correctly during movement but not while jumping. - Rabbits are stuck / try to wander around forever.
- The root cause is that
EntityNavigationsets its timeouts based on movement speed.
If the movement speed is 0 (this is the case when a rabbit/mob is "stuck"), the timeout is also 0... and if the timeout is 0 it's ignored and therefore it's executed forever (or until interrupted by something external like another goal). - Rabbits only have a single goal when idle:
WanderAround(Far). Most other entities also useLookAroundGoal.
Thus the above mentioned infinite navigation is never stopped in favor of executing another goal like in most other mobs. RabbitMoveControl#tickconstantly updates the rabbits speed (RabbitEntity#setSpeed).
While doing this it also indirectly executesmoveControl#moveTothus the rabbit always tries to reach it's last target even when it shouldn't do that.
- The root cause is that
As of
1.21.4/24w46aMC-150224 was fixed, correcting the jump height (1) and fixing the stall (2).
However all other parts - including optimizations and sanity checks in above mentioned fixes - are still missing.
Eating carrot crops
- Rabbits can't reach the crops and always stop one block short of them.
This is due to selecting the incorrect distance from the crop block (it's1but should be0). - Rabbits eat the crop instantly even while still jumping and being in the air.
- The goal/behavior is immediately aborted (after a few ticks - when a target crop block was selected) due to incorrect implementation of
shouldContinueandisTargetPosmethods.
Detailed video comparisons are also available.
下载 Rabbit Pathfinding Fixed (Unofficial Forge Port)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Rabbit Pathfinding Fixed (Unofficial Forge Port)
下载 Rabbit Pathfinding Fixed (Unofficial Forge Port)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Rabbit Pathfinding Fixed (Unofficial Forge Port)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Rabbit Pathfinding Fixed (Unofficial Forge Port)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
从 1.4.0 Fabric 移植。(更新至 26.2)
从 1.4.0 Fabric 移植。(更新至 26.2)
1.0.6.1 从 Fabric 项目移植
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
让你能够在世界中的任何位置定位结构。
模组
为你的终界增添新生物群系、神秘仪式和全新生物
模组
TerraFirmaCraft (TFC) 是一个全面转换模组,对生存模式进行了彻底的改造与重新设计。
模组
更多生物群系,更多生物,更多工具,为炽热的维度
模组
一堆修复
评论 0
登录后参与评分
还没有评论,来抢沙发吧