feat(protection): add configurable Strength effect
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ okf_version: "0.1"
|
||||
|
||||
# Leaf Design
|
||||
|
||||
This bundle documents Leaf, a Spigot plugin that lets players opt into a visible Resistance boost while requiring them to relinquish that protection when they attack another player.
|
||||
This bundle documents Leaf, a Spigot plugin that lets players opt into visible Resistance and Strength boosts while requiring them to relinquish that protection when they attack another player.
|
||||
|
||||
## Explore
|
||||
|
||||
|
||||
@@ -86,3 +86,12 @@
|
||||
- Leaf now removes exact managed-prefix text without discarding surrounding third-party formatting, clears stale prefixes after reload, and normalizes repeated prefixes before applying one leaf.
|
||||
- Added regression coverage for wrapped names, duplicate stale prefixes, untracked stale prefixes, unrelated formatting, tab names, and scoreboard cleanup.
|
||||
- Verified the fix with `./gradlew clean check jar`.
|
||||
|
||||
### Strength protection added
|
||||
|
||||
- Opted-in players now receive quiet, infinite Strength I alongside Resistance I by default; both effects must be active for Leaf status to report active protection.
|
||||
- Added independent `resistance-level` and `strength-level` settings with live `/leaf effect <resistance|strength> <1-5>` administration and positional autocomplete.
|
||||
- Retained `/leaf strength <1-5>` as a deprecated compatibility alias for changing Resistance.
|
||||
- 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`.
|
||||
|
||||
@@ -20,6 +20,8 @@ As a **player**, I want to opt into Leaf protection so that I can receive a mode
|
||||
- [x] Opt-in choices are keyed by UUID and survive logout and server restart.
|
||||
- [x] A player who joins while opted in regains protection when Leaf is enabled.
|
||||
- [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.
|
||||
|
||||
## Related
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ As a **player facing PvP**, I want Leaf protection to belong only to non-aggress
|
||||
|
||||
- [x] When an opted-in player damages another player, Leaf automatically changes the attacker's saved choice to opted out.
|
||||
- [x] Automatic opt-out immediately removes Leaf-managed Resistance and the attacker's leaf prefix.
|
||||
- [x] Automatic opt-out also immediately removes Leaf-managed Strength.
|
||||
- [x] The attacker receives a clear chat message explaining that attacking another player disabled Leaf and that they may opt in again when permitted.
|
||||
- [x] Receiving player-caused damage without retaliating does not change the protected player's choice or Resistance.
|
||||
- [x] Retaliatory damage counts as attacking, including Thorns damage attributable to the protected player.
|
||||
|
||||
@@ -21,7 +21,10 @@ As a **server administrator**, I want to control Leaf globally and per player so
|
||||
- [x] A locked player receives a clear explanation when `/leaf on` or `/leaf off` is denied.
|
||||
- [x] PvP-triggered opt-out remains authoritative even for a locked player.
|
||||
- [x] Player targets resolve online names, previously known names, and UUIDs without confusing two players who used the same name.
|
||||
- [x] `/leaf strength <1-5>` changes the live Resistance level and immediately updates protected online players.
|
||||
- [x] `/leaf strength <1-5>` remains a deprecated compatibility alias that changes the live Resistance level.
|
||||
- [x] `/leaf effect resistance <1-5>` changes the live Resistance level and immediately updates protected online players.
|
||||
- [x] `/leaf effect strength <1-5>` changes the live Strength level and immediately updates protected online players.
|
||||
- [x] Effect-command autocomplete suggests effect names and valid levels for the current argument position.
|
||||
- [x] Administrative autocomplete is permission-aware and suggests valid subcommands, known player targets, properties, levels, and `on` or `off` values for the current argument position.
|
||||
- [x] Every successful mutation reports exactly what changed, and invalid requests make no partial changes.
|
||||
|
||||
|
||||
@@ -11,15 +11,16 @@ As a **server operator**, I want Leaf settings and player state to be validated
|
||||
|
||||
## Acceptance criteria
|
||||
|
||||
- [x] Configuration supports the global enabled state, Resistance strength, leaf prefix, onboarding duration, and player-facing messages.
|
||||
- [x] Configuration supports the global enabled state, Resistance and Strength levels, leaf prefix, onboarding duration, and player-facing messages.
|
||||
- [x] Resistance strength defaults to level I and accepts only Minecraft Resistance levels I through V.
|
||||
- [x] Runtime changes made through `/leaf enabled` and `/leaf strength` are persisted for subsequent restarts.
|
||||
- [x] Strength defaults to level I and accepts only Minecraft Strength levels I through V.
|
||||
- [x] Runtime changes made through `/leaf enabled` and `/leaf effect` are persisted for subsequent restarts.
|
||||
- [x] UUID-keyed player state persists the latest known name, saved opt-in choice, administrative lock, and first-join timestamp.
|
||||
- [x] Date-times use RFC 3339 UTC notation with a `Z` suffix.
|
||||
- [x] State is saved safely so that a failed write does not replace valid persisted state with a partial document.
|
||||
- [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 does not remove a distinct Resistance effect that Leaf does not own when the API provides enough information to distinguish it.
|
||||
- [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] Unknown forward-compatible configuration and player-state fields are preserved where practical.
|
||||
|
||||
## Related
|
||||
|
||||
Reference in New Issue
Block a user