Skip to content

Resolve GOVERNMENT accounts before personal for shop funds#1

Merged
ParadauxIO merged 1 commit into
masterfrom
fix/government-account-precedence
May 30, 2026
Merged

Resolve GOVERNMENT accounts before personal for shop funds#1
ParadauxIO merged 1 commit into
masterfrom
fix/government-account-precedence

Conversation

@ParadauxIO
Copy link
Copy Markdown
Collaborator

Legacy DemocracyCraft government ledgers (DCGovernment, SCGovernment, …) used to be real players, so shops still address them by that player's name/UUID. Those ledgers are now GOVERNMENT accounts whose owner_uuid_bin is the legacy player UUID.

TreasuryListener resolved shop account UUIDs straight through resolveOrCreatePersonal(), which filters to PERSONAL type — so for a government UUID it minted an empty personal account and shop funds never reached the real ledger.

This change makes resolveAccountId(), the balance handler, and the has-account handler all prefer a GOVERNMENT account owned by that UUID before falling back to personal resolution (getAccountsByTypeAndOwner(GOVERNMENT, uuid)). Lookup failures are logged and fall back to the previous behaviour, so a missing government account is a no-op.

Plugin module compiles (mvn -pl plugin -am compile).

Vendored upstream fork — change kept minimal and in the surrounding ChestShop style per the workspace's fork conventions.

🤖 Generated with Claude Code

Legacy DemocracyCraft government ledgers (DCGovernment, SCGovernment, …)
used to be real players, so shops still address them by that player's
name/UUID. Those ledgers are now GOVERNMENT accounts whose owner_uuid_bin
is the legacy player UUID.

TreasuryListener resolved shop account UUIDs straight through
resolveOrCreatePersonal(), which filters to PERSONAL type — so for a
government UUID it minted an empty personal account and shop funds never
reached the real ledger. Now resolveAccountId(), the balance check and the
has-account check all prefer a GOVERNMENT account owned by that UUID before
falling back to personal resolution. Lookup failures are logged and fall
back, so a missing government account behaves as before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Coverage report

Overall Project 24.23%

There is no coverage information present for the Files changed

@ParadauxIO ParadauxIO merged commit f08473a into master May 30, 2026
2 checks passed
@ParadauxIO ParadauxIO deleted the fix/government-account-precedence branch May 31, 2026 00:44
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