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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user