Skip to content

fix: keep husbandry babies on the baby model until they grow up - #31

Merged
Drefvelin merged 1 commit into
mainfrom
fix/husbandry-baby-model
Sep 23, 2026
Merged

Drefvelin merged 1 commit into
mainfrom
fix/husbandry-baby-model

Conversation

@Drefvelin

Copy link
Copy Markdown
Contributor

Summary

  • Tracked husbandry animals stay on the baby model until mature_at, instead of switching to the adult model on vanilla growth (about 20 minutes).
  • Age is locked at birth, on chunk load, and on the one-minute tick. Breeding food cannot age them up early. When the grow-up timer is due, the lock is cleared and the adult model is applied.
  • Existing juveniles that already look adult shrink back to babies until their stored grow-up time is actually done.

Test plan

  • HusbandryGrowthTest covers immature, due, stored-adult, and missing records
  • HusbandryRepositoryTest still passes
  • Breed a cow and confirm it stays baby-sized for the full hour, including after being fed wheat
  • After the hour, confirm the adult model appears and breeding works
  • Reload the chunk while it is still growing and confirm it is still a baby

Made with Cursor

Vanilla age turns tracked babies into adults in about twenty minutes, before the husbandry grow-up timer. Lock age until mature_at so the adult model waits for that timer.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Drefvelin

Copy link
Copy Markdown
Contributor Author

Reviewed the growth change against Paper 1.21.10.

Tracked animals with mature_at still in the future are held on the baby model with Breedable.setAgeLock(true). Paper honors that lock in aiStep, inactive ticks, and ageUp, and persists it as AgeLocked, so vanilla growth and breeding food cannot flip the adult model early. Birth, chunk load, and the one-minute tick all apply it. When the timer is due, the lock is cleared and the entity is set adult. A null mature_at stays adult.

HusbandryGrowthTest and HusbandryRepositoryTest passed locally. CI build is green. Merge is waiting on an approving review from someone other than the author.

@Drefvelin
Drefvelin merged commit 5f9b959 into main Sep 23, 2026
1 check passed
@Drefvelin
Drefvelin deleted the fix/husbandry-baby-model branch September 23, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant