Improve AI: bed memory (30-block search), relationship-based follow goal, crouch fixes

- EllieSleepGoal: check stored bedPos first, search 30 blocks on miss
- releaseBed() no longer clears memory; forgetBed() for destruction
- New FollowPlayerGoal: 50-75% distant follow, 75-99% closer, 100% approach
- fix: crouch animation thenLoop, idle doesn't override crouching
- fix: sleep Y rotation = facing.toYRot() (head toward headboard)
- fix: checkLowCeiling scan range reduced (2-4 blocks, 3 for path)
This commit is contained in:
2026-06-09 21:27:11 +03:00
parent f5d318f02e
commit 31a21f2f45
4 changed files with 119 additions and 4 deletions
@@ -29,10 +29,19 @@ public class EllieSleepGoal extends Goal {
if (!ellie.level().isNight() && !ellie.isTired()) return false;
if (ellie.isSleeping()) return false;
if (ellie.hurtTime > 0) return false;
bedPos = findNearestBed();
bedPos = findBed();
return bedPos != null;
}
private BlockPos findBed() {
BlockPos stored = ellie.getBedPos();
if (stored != null && isFreeBed(stored) && ellie.distanceToSqr(Vec3.atCenterOf(stored)) < 50 * 50) {
return stored;
}
return findNearestBed();
}
@Override
public void start() {
claimed = false;