Skip to content

fix: preserve successor food after administrative permakill - #75

Merged
ryanbarlow97 merged 1 commit into
mainfrom
fix/permakill-successor-food
Oct 12, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
fix/permakill-successor-food

Conversation

@ryanbarlow97

Copy link
Copy Markdown
Contributor

Administrative permakill activates the next character before scheduling the account’s body death. Cooking treated that delayed event as the successor’s death and reset its food to 80; live Dev tests reproduced 199→80 and 200→80.

Skip the nutrition reset while RPCharacters reports a pending permakill respawn. This uses its existing API in the pinned 2.16.0 dependency and preserves normal death, battle and respawn handling. The regression exercises both observed values, the one-tick delay, respawn HUD restoration and a subsequent ordinary death.

Validation:

  • Regression failed against the previous code for both 199→80 and 200→80.
  • All 35 nutrition listener tests pass.
  • Java 21 mvn clean verify: 1126 tests, no failures/errors/skips; 100% line-coverage gate passed.

The fixed JAR has not been deployed to Dev or Main.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 14171e51-8931-4b44-b13c-f8f9b8202294

📥 Commits

Reviewing files that changed from the base of the PR and between 7301b17 and 8ea2f04.


📒 Files selected for processing (2)
  • src/main/java/net/tfminecraft/cooking/nutrition/NutritionLifecycleListener.java
  • src/test/java/net/tfminecraft/cooking/nutrition/NutritionListenersCoverageTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Food values are now preserved during delayed deaths caused by administrative permakills, preventing unintended changes to the outgoing and successor characters.
    • The successor’s food level is restored correctly after respawning. Ordinary deaths continue to update food values as expected.

Walkthrough

The nutrition listener now skips death handling while a player awaits permakill respawn. A parameterised lifecycle test checks food values, saves, the pending sounds flag, and behaviour after respawn and a later ordinary death.

Changes

Permakill respawn nutrition handling

Layer / File(s) Summary
Skip nutrition updates during permakill respawn
src/main/java/net/tfminecraft/cooking/nutrition/NutritionLifecycleListener.java, src/test/java/net/tfminecraft/cooking/nutrition/NutritionListenersCoverageTest.java
The listener logs and skips death handling when a player awaits permakill respawn. The test checks that food values remain unchanged and no save occurs during the delayed death, then checks respawn and later ordinary-death behaviour.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: carolinebondhus


Merge Risk: ⚪ Minimal · up to 8ea2f

The change prevents a delayed death event after administrative permakill from resetting the successor character's food to 80. No actionable merge-blocking risk was found.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size:XS 0-9 effective changed lines (tests excluded in mixed PRs). label Oct 12, 2026
@ryanbarlow97
ryanbarlow97 merged commit 2da0905 into main Oct 12, 2026
3 checks passed
@ryanbarlow97
ryanbarlow97 deleted the fix/permakill-successor-food branch October 12, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant