feat(potions): add restoration potion for default player size
Release / release (push) Successful in 2m11s
CI / build (push) Successful in 54s

This commit is contained in:
dmg
2026-09-06 19:42:17 -04:00
parent a06d6480fe
commit fd601961eb
13 changed files with 155 additions and 9 deletions
+12
View File
@@ -6,6 +6,18 @@ description: Chronological record of material decisions affecting Spigot Heights
# Spigot Heights Design Log
## 2026-09-06T23:41:16Z — Restoration completed
- Added the white Potion of Restoration with persistent identity and the approved Sugar upgrade recipe.
- Consumption restores exact scale `1.0` through the existing report/save path; saved `1.0` bypasses configured-range clamping on join and respawn.
- Verified `./gradlew clean check jar`: all 17 tests passed, including restoration, persistence reload, range exceptions, recipe shape, identity, and existing potion regression coverage.
- Inspected Bukkit recipe/metadata and event wiring; live-server gameplay verification remains unperformed. Updated the README and completed US-006 and the related US-004 change.
## 2026-09-06T23:37:19Z — Restoration approved and implementation started
- Approved [US-006](user-stories/us-006-restore-default-stature.md): a Sugar-based upgrade of Shifting Stature restores exact scale `1.0`.
- Approved an exception to saved-scale clamping in [US-004](user-stories/us-004-configure-and-persist.md) so restoration survives reconnects and respawns even outside configured limits.
## 2026-09-04 — Initial design approved
- Player scale defaults to a configurable range of `0.4` through `2.0`.
+1
View File
@@ -11,3 +11,4 @@ description: Catalog of user stories for the Spigot Heights plugin.
3. [US-003: Launch tiny players through dispensers](us-003-launch-tiny-players.md)
4. [US-004: Configure and persist stature behavior](us-004-configure-and-persist.md)
5. [US-005: Build and release the plugin](us-005-build-and-release.md)
6. [US-006: Restore default stature](us-006-restore-default-stature.md)
@@ -17,9 +17,10 @@ As a **server operator**, I want validated stature and launcher settings with du
- [x] Player scales are stored by UUID using atomic file replacement where supported.
- [x] Updating known state preserves unknown forward-compatible YAML fields.
- [x] Missing state defaults safely to scale `1.0` clamped to the configured range.
- [x] Saved out-of-range state is clamped before it is applied.
- [x] Saved out-of-range state is clamped before it is applied, except exact scale `1.0`, which is preserved for restoration.
- [x] Configuration and state behavior have automated tests.
## Related
- [User-story catalog](index.md)
- [US-006: Restore default stature](us-006-restore-default-stature.md)
@@ -0,0 +1,28 @@
---
type: User Story
title: "US-006: Restore default stature"
description: Let players craft a potion that permanently restores their scale to 1.0.
status: done
---
# US-006: Restore default stature
As a **player**, I want a Potion of Restoration so that I can return to normal size.
## Acceptance criteria
- [x] Drinking the potion sets scale to exactly `1.0`, regardless of configured limits.
- [x] The potion uses distinct persistent metadata rather than its display name for identity.
- [x] The new scale is reported and saved by UUID, and retained across reconnects and respawns.
- [x] The recipe is `GAG/ASA/GUG`, where `G` is Gold Ingot, `A` is Amethyst Shard, `S` is an authenticated Potion of Shifting Stature, and `U` is Sugar.
- [x] Automated tests cover restoration, saved-scale handling, recipe shape, and distinct identity; the README documents the recipe and behavior.
## Verification
- `./gradlew clean check jar` passed all 17 tests.
- Automated coverage checks scale calculation, storage reload, range exceptions, recipe shape, and enum identity. Code inspection confirms metadata authentication, ingredient registration, and the shared consumption/join/respawn adapters; no live-server gameplay test was performed.
## Related
- [US-002: Make precise stature adjustments](us-002-adjust-stature.md)
- [US-004: Configure and persist stature behavior](us-004-configure-and-persist.md)