Ensure contributors are charged at bet time and prevent bounty state updates when a payment fails.
Remove shared mutable command state that could lead to cross-invocation bugs.
Correct a message interpolation bug where the over-maximum message used the wrong placeholder value.
Description
Reworked /bounty set handling in src/main/java/com/tcoded/playerbountiesplus/command/bounty/BountySetCmd.java to parse the requested amount into a local parsedAmount and compute the final amount locally instead of using a static field.
Reordered the flow so input is validated, BountySetEvent is fired, then plugin.getEcoHook().takeEco(...) is called, and only on success the BountyDataManager is updated and saved.
Converted the charged/displayed bounty to an integer chargeAndBountyAmount for persistence and messaging to keep display and storage consistent with whole-diamond units.
Fixed the over-maximum message so it now uses the configured maximum value instead of the minimum value.
Testing
Ran ./gradlew build -x test which failed in this environment due to a Kotlin/Java environment parsing error (IllegalArgumentException: 25.0.1).
Ran ./gradlew compileJava --stacktrace which also failed with the same environment-level Kotlin/Java version parsing error.
### Motivation
- Ensure contributors are charged at bet time and prevent bounty state updates when a payment fails.
- Remove shared mutable command state that could lead to cross-invocation bugs.
- Correct a message interpolation bug where the over-maximum message used the wrong placeholder value.
### Description
- Reworked `/bounty set` handling in `src/main/java/com/tcoded/playerbountiesplus/command/bounty/BountySetCmd.java` to parse the requested amount into a local `parsedAmount` and compute the final `amount` locally instead of using a static field.
- Reordered the flow so input is validated, `BountySetEvent` is fired, then `plugin.getEcoHook().takeEco(...)` is called, and only on success the `BountyDataManager` is updated and saved.
- Converted the charged/displayed bounty to an integer `chargeAndBountyAmount` for persistence and messaging to keep display and storage consistent with whole-diamond units.
- Fixed the over-maximum message so it now uses the configured `maximum` value instead of the `minimum` value.
### Testing
- Ran `./gradlew build -x test` which failed in this environment due to a Kotlin/Java environment parsing error (`IllegalArgumentException: 25.0.1`).
- Ran `./gradlew compileJava --stacktrace` which also failed with the same environment-level Kotlin/Java version parsing error.
------
[Codex Task](https://chatgpt.com/codex/tasks/task_e_698bfc2c2ca4832f80ba229e3ef0e9a2)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Motivation
Description
/bounty sethandling insrc/main/java/com/tcoded/playerbountiesplus/command/bounty/BountySetCmd.javato parse the requested amount into a localparsedAmountand compute the finalamountlocally instead of using a static field.BountySetEventis fired, thenplugin.getEcoHook().takeEco(...)is called, and only on success theBountyDataManageris updated and saved.chargeAndBountyAmountfor persistence and messaging to keep display and storage consistent with whole-diamond units.maximumvalue instead of theminimumvalue.Testing
./gradlew build -x testwhich failed in this environment due to a Kotlin/Java environment parsing error (IllegalArgumentException: 25.0.1)../gradlew compileJava --stacktracewhich also failed with the same environment-level Kotlin/Java version parsing error.Codex Task