Skip to content

Persist Explosive Shot cooldown in SQL database - #5345

Open
cyrne1-7208 wants to merge 1 commit into
mcMMO-Dev:masterfrom
cyrne1-7208:fix/sql-cooldown-persistence-and-leaks
Open

cyrne1-7208 wants to merge 1 commit into
mcMMO-Dev:masterfrom
cyrne1-7208:fix/sql-cooldown-persistence-and-leaks

Conversation

@cyrne1-7208

@cyrne1-7208 cyrne1-7208 commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

SQLDatabaseManager.updateCooldowns() never wrote the archery column, although loadFromResult() reads it into EXPLOSIVE_SHOT and the FlatFile database stores it. Explosive Shot cannot be activated yet, so players are not affected today; the cooldown is only lost when a plugin sets it through AbilityAPI, or once the ability is implemented.

I compared every column saveUser() writes with what the load query reads, and archery was the only one missing.

Changes

  • Write archery = ? in updateCooldowns() and bind EXPLOSIVE_SHOT in column order.
  • Add whenSavingUserShouldPersistEveryAbilityCooldown, which saves a distinct cooldown for every SuperAbilityType and checks each one after reloading, on MySQL and MariaDB.

Testing

  • mvn test -Psql-tests: all 2,207 tests pass.
  • Without the fix, the new test fails on EXPLOSIVE_SHOT.

@cyrne1-7208
cyrne1-7208 marked this pull request as draft October 8, 2026 03:52
updateCooldowns() never wrote the archery column, although
loadFromResult() reads it into EXPLOSIVE_SHOT and the FlatFile database
stores it. Explosive Shot cannot be activated yet, so players are not
affected; the cooldown was only lost when a plugin set it through
AbilityAPI.

The new test saves a distinct cooldown for every ability and checks
each one after reloading, so a missing column fails it on both MySQL
and MariaDB.

Signed-off-by: Cyrne1_7208 <127477265+cyrne1-7208@users.noreply.github.com>
@cyrne1-7208
cyrne1-7208 force-pushed the fix/sql-cooldown-persistence-and-leaks branch from 5d26a3b to 7d70d03 Compare October 8, 2026 05:19
@cyrne1-7208
cyrne1-7208 marked this pull request as ready for review October 8, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant