Add bounty increase workflow and refine bounty head messaging #14

Merged
NotAlexNoyle merged 1 commits from codex/update-bounty-head-display-and-functionality into main 2026-03-09 10:39:40 -04:00
NotAlexNoyle commented 2026-03-09 10:36:27 -04:00 (Migrated from github.com)

Motivation

  • Add an in-game way to increase an existing player's bounty from commands or the GUI and ensure all currency operations use the DiamondBank-OG API (shard conversion and consume calls) rather than manual diamond math.
  • Make the head/actionbar UX use the full head message shown on hover and remove the term "Bounty Head" in favor of the player-readable "<player>'s Head" label.
  • Clean up stray formatting artifacts in formatted LuckPerms display names so usernames do not end with a trailing >.

Description

  • Added a new /bounty add <player> <amount> flow implemented in BountyAddCmd which validates amounts, converts diamonds to shards with DiamondBankAPIJava.diamondsToShards, charges the setter using consumeFromPlayer, updates stored bounty shards, and broadcasts configured messages using shardsToDiamonds for display.
  • Integrated the add subcommand into BountyCommand (runtime dispatch and tab-completion) and granted a new permission playerbountiesplus.command.bounty.add with defaults in plugin.yml.
  • Implemented GUI-driven increases by updating MainBountyGui to attach a click GUIButton to bounty entries that prompts the player via chat; added BountyIncreasePromptListener to accept numeric chat input or cancel and then call BountyAddCmd.addBounty on the server thread.
  • Refined head messages and naming in BountyHeadListener and DeathListener to display "<player>'s Head", to send the full actionbar message when hovering (inventory click), scrolling hotbar slots, or right-clicking, and removed trailing > characters from LuckPerms-derived display strings in set/top/death paths to avoid malformed usernames.

Testing

  • Attempted automated build-and-check with ./gradlew spotlessApply compileJava, but the task failed in this environment before compilation due to Kotlin/Gradle tooling failing to parse the host Java version (java.lang.IllegalArgumentException: 25.0.1).
  • Re-ran ./gradlew compileJava --stacktrace to capture diagnostics and observed the same Kotlin/Gradle Java-version parse failure, so compilation/tests could not be executed here.

Codex Task

### Motivation - Add an in-game way to increase an existing player's bounty from commands or the GUI and ensure all currency operations use the DiamondBank-OG API (shard conversion and consume calls) rather than manual diamond math. - Make the head/actionbar UX use the full head message shown on hover and remove the term "Bounty Head" in favor of the player-readable `"<player>'s Head"` label. - Clean up stray formatting artifacts in formatted LuckPerms display names so usernames do not end with a trailing `>`. ### Description - Added a new `/bounty add <player> <amount>` flow implemented in `BountyAddCmd` which validates amounts, converts diamonds to shards with `DiamondBankAPIJava.diamondsToShards`, charges the setter using `consumeFromPlayer`, updates stored bounty shards, and broadcasts configured messages using `shardsToDiamonds` for display. - Integrated the `add` subcommand into `BountyCommand` (runtime dispatch and tab-completion) and granted a new permission `playerbountiesplus.command.bounty.add` with defaults in `plugin.yml`. - Implemented GUI-driven increases by updating `MainBountyGui` to attach a click `GUIButton` to bounty entries that prompts the player via chat; added `BountyIncreasePromptListener` to accept numeric chat input or `cancel` and then call `BountyAddCmd.addBounty` on the server thread. - Refined head messages and naming in `BountyHeadListener` and `DeathListener` to display `"<player>'s Head"`, to send the full actionbar message when hovering (inventory click), scrolling hotbar slots, or right-clicking, and removed trailing `>` characters from LuckPerms-derived display strings in set/top/death paths to avoid malformed usernames. ### Testing - Attempted automated build-and-check with `./gradlew spotlessApply compileJava`, but the task failed in this environment before compilation due to Kotlin/Gradle tooling failing to parse the host Java version (`java.lang.IllegalArgumentException: 25.0.1`). - Re-ran `./gradlew compileJava --stacktrace` to capture diagnostics and observed the same Kotlin/Gradle Java-version parse failure, so compilation/tests could not be executed here. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69aed86cc3b0832f8b97fee256a93ba6)
Sign in to join this conversation.