You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: preserve successor food after administrative permakill - #75
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.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 effective changed lines (tests excluded in mixed PRs).
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.