fix(protection): restore cleared Leaf effects
This commit is contained in:
@@ -95,3 +95,11 @@
|
||||
- Opt-out, combat, administrative disablement, and global disablement remove both Leaf-managed effects while conservatively preserving distinct external effects.
|
||||
- Minecraft calculates the initiating PvP hit before Leaf can process the damage event, so that first hit can include the configured Strength bonus before automatic opt-out.
|
||||
- Verified settings, runtime reconciliation, status, combat cleanup, persistence, command compatibility, autocomplete, and the complete build with `./gradlew clean check jar`.
|
||||
|
||||
### Automatic effect recovery added
|
||||
|
||||
- Leaf now reconciles opted-in online players every 20 ticks so death, milk, commands, and plugins cannot permanently clear configured protection.
|
||||
- Recovery remains disabled for opted-out players and while Leaf is globally disabled.
|
||||
- A temporary external Resistance or Strength effect is preserved instead of overwritten; the leaf prefix remains visible and Leaf restores its configured effect after the external effect ends.
|
||||
- Added regression coverage for the one-second recovery task and eligibility-aware online-player reconciliation.
|
||||
- Verified the complete build with `./gradlew clean check jar`.
|
||||
|
||||
@@ -22,6 +22,8 @@ As a **player**, I want to opt into Leaf protection so that I can receive a mode
|
||||
- [x] Player-command autocomplete suggests only valid next arguments available to the sender.
|
||||
- [x] Opted-in players receive quiet Strength I alongside Resistance I by default.
|
||||
- [x] Player status reports active protection only when both configured Leaf effects are effective.
|
||||
- [x] Missing Leaf effects are restored for opted-in online players within approximately one second after death, milk, commands, or plugins clear them.
|
||||
- [x] Recovery remains suppressed while Leaf is globally disabled or the player is opted out.
|
||||
|
||||
## Related
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ As a **server operator**, I want Leaf settings and player state to be validated
|
||||
- [x] Invalid required configuration prevents partial plugin initialization and produces a clear server log message.
|
||||
- [x] Corrupt or invalid player records are handled defensively and cannot silently grant protection or privileges.
|
||||
- [x] Removing Leaf-managed Resistance or Strength does not remove a distinct corresponding effect that Leaf does not own when the API provides enough information to distinguish it.
|
||||
- [x] A temporary external Resistance or Strength effect is preserved instead of overwritten, and Leaf restores its configured effect after the external effect ends.
|
||||
- [x] The leaf prefix remains visible while an external effect temporarily replaces a Leaf-managed effect.
|
||||
- [x] Unknown forward-compatible configuration and player-state fields are preserved where practical.
|
||||
|
||||
## Related
|
||||
|
||||
Reference in New Issue
Block a user