Skip to content

Release 1.19.0#53

Merged
tastybento merged 5 commits into
masterfrom
develop
Jun 21, 2026
Merged

Release 1.19.0#53
tastybento merged 5 commits into
masterfrom
develop

Conversation

@tastybento

Copy link
Copy Markdown
Member

Release 1.19.0.

Highlights

Standalone economy now works without a separate economy plugin

fix: register a fresh VaultHook when BentoBox has none — InvSwitcher registers its own per-world Vault economy, but BentoBox hooks Vault during early hooks (before addons enable). When InvSwitcher was the only economy, that early hook failed and was discarded, so getVault() stayed empty and economy-dependent addons (e.g. Bank) disabled themselves with "Vault is required". InvSwitcher now registers a fresh VaultHook once its provider is live, so it works as a standalone economy.

Companion PRs harden this on the framework side: BentoBoxWorld/BentoBox#2995 (retry the Vault hook after addons enable) and BentoBoxWorld/Bank#67 (retry before disabling).

Correct balance reported for offline economy transactions

fix: report offline economy balances correctly and harden offline saves — admin eco give/set/take on an offline player reported a stale balance (e.g. "New balance: 0.00" after giving 2000) because the success message re-read the balance from the database before the asynchronous save had flushed. The commands now report the authoritative balance returned by the transaction itself.

The same change hardens the underlying offline read-after-write path: offline saves are tracked in flight so two rapid sequential transactions can't load independent stale copies and lose an update — without blocking the main thread or caching offline players indefinitely. Adds a regression test.

Commits

  • d929649 fix: register a fresh VaultHook when BentoBox has none
  • a15c645 fix: report offline economy balances correctly and harden offline saves
  • f1bd4c2 chore: bump version to 1.19.0

Full test suite: 124/124 passing.

🤖 Generated with Claude Code

tastybento and others added 5 commits June 3, 2026 08:18
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
refreshBentoBoxVaultHook() assumed BentoBox already held a VaultHook it
could re-hook. In the standalone case that is never true: BentoBox hooks
Vault during its early hooks, before addons enable, so when InvSwitcher
is the only economy that early hook fails for lack of any economy and is
discarded by HooksManager. getVault() then stays empty and the refresh
was a silent no-op, leaving Bank and the rest of BentoBox unable to see
our economy.

When getVault() is empty, register a fresh VaultHook now that our
provider is live, so getVault() is populated for economy consumers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Admin eco give/set/take on an offline player reported a stale balance
(e.g. "New balance: 0.00" after giving 2000). The success message
re-read the balance from the database, which reloaded the offline player
fresh before the asynchronous save had flushed, returning the
pre-transaction value. Report the balance from the EconomyResponse the
transaction returned instead, which is authoritative.

Also harden the underlying offline read-after-write path: getStorageObject
loaded an independent transient copy for offline players on every call, so
two rapid sequential economy writes could each load before the first save
flushed, losing the first update. Track offline saves in flight in a
pending-saves map and reuse that object for follow-up reads/writes until
the last save flushes, then drop it so a later login still reloads fresh.
No main-thread blocking, no indefinite caching of offline players.

Add a regression test for the offline read-after-write path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Main code:
- InvEconomy: drop redundant @deprecated from the Vault interface overrides
  (suppress the unavoidable deprecation/removal warnings at class level),
  extract duplicated debug literals into constants, and replace nested
  ternaries in debug routing with a routeSuffix() helper.
- Store: merge nested if in island-key migration; replace if/containsKey in
  getStat UNTYPED branch with Optional.ifPresent.
- Remove unused import in InvSwitcherPladdon.

Tests:
- Remove the 'public' modifier from JUnit 5 test classes and annotated
  methods (S5786).
- Add assertDoesNotThrow assertions to four clear-stored tests that had none.
- Remove redundant local Island mocks that shadowed the @mock field.
- Remove unused 'server' locals, unused imports, and unnecessary
  'throws Exception' declarations.

Left intentionally: S110 (command class depth is inherent to BentoBox's
CompositeCommand hierarchy), S3776 (cognitive complexity on core inventory
methods - refactoring risks regressions), and S5738 (calls to deprecated
Bukkit.getOfflinePlayer required to implement Vault's name-based methods).

All 124 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@tastybento tastybento merged commit 3d5d0c7 into master Jun 21, 2026
5 checks passed
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