Skip to content

Commit 1265ca7

Browse files
authored
Merge pull request #67 from BentoBoxWorld/fix/retry-vault-hook
fix: retry Vault hook before disabling so addon-provided economies work
2 parents 10ba0a7 + 66e62ae commit 1265ca7

3 files changed

Lines changed: 78 additions & 5 deletions

File tree

RELEASE_NOTES_1.10.0.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
## 🎁 What's new
2+
3+
Bank 1.10.0 is a modernisation release. The addon now targets **Java 21, Paper 1.21.11 and BentoBox 3.14.0**, and its entire locale set has been migrated to BentoBox's modern **MiniMessage** colour format. Alongside the platform work, this release adds a brand-new `latest_transaction` placeholder, ships a full set of language files (including a new Russian translation), and rebuilds the test suite on JUnit 5 + MockBukkit.
4+
5+
Because of the platform and locale-format changes, this is not a drop-in update — please read the **Updating** notes below before installing.
6+
7+
## ✨ Highlights
8+
9+
### 🔺 Platform modernisation — Java 21, Paper 1.21.11, BentoBox 3.14.0 (#65)
10+
- Build upgraded to **Java 21**, **Paper 1.21.11** and **BentoBox 3.14.0**
11+
- `plugin.yml` `api-version` bumped to **1.21**
12+
- Test suite migrated to **JUnit 5 + MockBukkit**
13+
- All Maven plugins updated to the latest stable versions and ~120 SonarCloud issues resolved (complexity, variable shadowing, test smells)
14+
15+
### 🔡 🔺 MiniMessage locale format (#64)
16+
- All locale files converted from legacy `&`/`§` colour codes to BentoBox's **MiniMessage** format
17+
- Aligns Bank with the rest of the 3.14.0 ecosystem and unlocks richer text formatting
18+
- Any custom locale edits you've made will need to be re-expressed in MiniMessage syntax
19+
20+
### 🔡 New transaction placeholder (#61)
21+
- Adds `{gamemode}_latest_transaction`, showing a user's most recent island bank transaction
22+
- Renders as `[Username] [TxType] $[Amount]` (e.g. `tastybento Deposited $500.0`)
23+
- The placeholder text is fully localised
24+
25+
### 🔡 Complete language coverage (#63)
26+
- Adds a new **Russian** locale plus every other language file BentoBox ships, so Bank now matches the full BentoBox locale set (23 languages)
27+
28+
### 🐛 Hardening
29+
- Hardened bank transaction-history parsing against malformed entries (#66)
30+
- Localised the latest-transaction placeholder fallback text (#66)
31+
- Numerous code-quality and safety fixes flagged by static analysis (#66)
32+
33+
## ⚙️ Compatibility
34+
35+
✔️ BentoBox API 3.14.0
36+
✔️ Minecraft 1.21.5 - 26.1.x
37+
✔️ Java 21
38+
39+
## 🔺 Updating — important notes
40+
41+
🔺 **BentoBox 3.14.0 and Java 21 are required.** Update BentoBox first and make sure your server runs Java 21 before installing this version.
42+
43+
🔡 🔺 **Locale files were migrated to MiniMessage.** If you have customised any Bank language files, back them up and re-apply your changes in MiniMessage format. The simplest path is to delete the old locale files and let the addon regenerate them, then redo your edits.
44+
45+
🔡 **New placeholder available.** `{gamemode}_latest_transaction` can be used wherever PlaceholderAPI placeholders are supported (e.g. scoreboards, holograms).
46+
47+
## 📥 How to update
48+
1. Stop the server
49+
2. Back up your BentoBox folder (especially any customised Bank locale files)
50+
3. Update BentoBox to 3.14.0 and confirm the server is running Java 21
51+
4. Drop the new Bank jar into the `addons` folder and remove the old one
52+
5. Start the server, then re-apply any custom locale edits in MiniMessage format
53+
6. You should be good to go!
54+
55+
## Legend
56+
57+
* 🔡 locale files may need to be regenerated or updated
58+
* ⚙️ config options have been removed, renamed, or added
59+
* 🔺 special attention needed
60+
61+
## What's Changed
62+
63+
* 🔡 Add latest transaction placeholder by @tastybento in https://github.com/BentoBoxWorld/Bank/pull/61
64+
* 🔡 Add Russian locale and all missing BentoBox languages by @tastybento in https://github.com/BentoBoxWorld/Bank/pull/63
65+
* 🔡 🔺 Convert locale color codes to MiniMessage format by @tastybento in https://github.com/BentoBoxWorld/Bank/pull/64
66+
* 🔺 Modernise to Java 21 / Paper 1.21.11 / BentoBox 3.14.0 by @tastybento in https://github.com/BentoBoxWorld/Bank/pull/65
67+
* 🔡 Release 1.10.0 — harden history parsing, localise placeholder, code-quality fixes by @tastybento in https://github.com/BentoBoxWorld/Bank/pull/66
68+
69+
**Full Changelog**: https://github.com/BentoBoxWorld/Bank/compare/1.9.1...1.10.0

src/main/java/world/bentobox/bank/Bank.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,20 @@ public class Bank extends Addon {
3737
public void onEnable() {
3838
// Register flag
3939
this.registerFlag(BANK_ACCESS);
40-
// Vault hook
40+
// Vault hook. BentoBox hooks Vault before addons enable, so if no economy plugin had
41+
// registered an economy provider yet, that early hook failed and was discarded. An addon
42+
// (e.g. InvSwitcher) can provide an economy during enable, so retry the hook before giving up.
43+
if (getPlugin().getVault().isEmpty()) {
44+
getPlugin().getHooks().registerHook(new VaultHook());
45+
}
4146
if (getPlugin().getVault().isEmpty()) {
4247
// Vault is required
4348
logError("Vault is required - disabling Bank - please install the Vault plugin");
4449
this.setState(State.DISABLED);
4550
return;
46-
} else {
47-
// Get economy
48-
vault = getPlugin().getVault().get();
4951
}
52+
// Get economy
53+
vault = getPlugin().getVault().get();
5054
saveDefaultConfig();
5155
settings = config.loadConfigObject();
5256
if (settings == null) {

src/main/resources/addon.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ api-version: 1.15.4
66

77
authors: tastybento
88

9-
softdepend: AcidIsland, BSkyBlock, CaveBlock, SkyGrid, AOneBlock
9+
softdepend: AcidIsland, BSkyBlock, CaveBlock, SkyGrid, AOneBlock, InvSwitcher
1010

1111
permissions:
1212
'[gamemode].bank.user':

0 commit comments

Comments
 (0)