Resolve GOVERNMENT accounts before personal for shop funds#1
Merged
Conversation
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>
Coverage report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 whoseowner_uuid_binis the legacy player UUID.TreasuryListenerresolved shop account UUIDs straight throughresolveOrCreatePersonal(), 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).🤖 Generated with Claude Code