修复了兔子的寻路问题。
在 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方法的实现错误,目标/行为会立即中止(在选择目标作物方块后的几个刻之后)。
其他修复
- 成年兔子的头部旋转方向大部分时间略微向上——MC-306682 影响 26.1 或更高版本
还提供详细的 视频对比。
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.
Other fixes
- The client-side rotation of Adults rabbit's head is most of the time slightly upwards - MC-306682 affects 26.1 or later
Detailed video comparisons are also available.
下载 Rabbit Pathfinding Fixed
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Rabbit Pathfinding Fixed
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Rabbit Pathfinding Fixed
下载 Rabbit Pathfinding Fixed
下载 Rabbit Pathfinding Fixed
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
- 更新至 26.3
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
一个用于收集生物掉落物的多区块模组。
模组
原版世界生成优化模组
模组
让你能够在世界中的任何位置定位结构。
模组
为你的终界增添新生物群系、神秘仪式和全新生物
模组
TerraFirmaCraft (TFC) 是一个全面转换模组,对生存模式进行了彻底的改造与重新设计。
评论 0
登录后参与评分
还没有评论,来抢沙发吧