Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
71d00a3
Initial plan
Copilot Mar 28, 2026
2edcca8
Add latest transaction placeholder for bank islands
Copilot Mar 28, 2026
1aad613
Upgrade GitHub Actions to version 4
tastybento Mar 28, 2026
bf77e48
Merge pull request #61 from BentoBoxWorld/copilot/add-latest-transact…
tastybento Mar 28, 2026
a5cf9a2
Remove coverage badge from README
tastybento Mar 28, 2026
1c6b346
Update upload-artifact action to version 4
tastybento Mar 28, 2026
ad4ef25
Fix 120 SonarCloud issues: complexity, shadowing, test smells
tastybento Mar 28, 2026
309f2b3
Update all Maven plugins to latest stable versions
tastybento Mar 28, 2026
59b476d
Add Russian locale and all missing BentoBox languages
tastybento Jun 4, 2026
93a6ebc
Add CLAUDE.md project guidance
tastybento Jun 4, 2026
7ad74e0
Merge pull request #63 from BentoBoxWorld/add-russian-and-missing-loc…
tastybento Jun 4, 2026
8ec8c69
Update to Java 21, Paper 1.21.11, BentoBox 3.14.0
tastybento Jun 6, 2026
bf180c3
Migrate test suite to JUnit 5 + MockBukkit
tastybento Jun 6, 2026
067f101
Bump plugin.yml api-version to 1.21
tastybento Jun 6, 2026
786adde
Convert locale color codes to MiniMessage format
tastybento Jun 6, 2026
b50b7fc
Merge branch 'develop' into locales-minimessage
tastybento Jun 6, 2026
5424402
Merge pull request #64 from BentoBoxWorld/locales-minimessage
tastybento Jun 13, 2026
287bd22
Merge pull request #65 from BentoBoxWorld/modernise-java21-bentobox314
tastybento Jun 13, 2026
36a943f
Update build version from 1.9.1 to 1.10.0
tastybento Jun 13, 2026
67e3caf
Potential fix for pull request finding
tastybento Jun 13, 2026
f36bd95
Potential fix for pull request finding
tastybento Jun 13, 2026
2c75579
Potential fix for pull request finding
tastybento Jun 13, 2026
13535b3
Potential fix for pull request finding
tastybento Jun 13, 2026
9c77e83
Potential fix for pull request finding
tastybento Jun 13, 2026
e3aa1c3
Potential fix for pull request finding
tastybento Jun 13, 2026
7eb580c
Potential fix for pull request finding
tastybento Jun 13, 2026
758057f
Potential fix for pull request finding
tastybento Jun 13, 2026
27a0088
Potential fix for pull request finding
tastybento Jun 13, 2026
05a4160
Potential fix for pull request finding
tastybento Jun 13, 2026
45911db
Potential fix for pull request finding
tastybento Jun 13, 2026
61eb129
Potential fix for pull request finding
tastybento Jun 13, 2026
7133433
Potential fix for pull request finding
tastybento Jun 13, 2026
2b1923c
Potential fix for pull request finding
tastybento Jun 13, 2026
472a8e0
Potential fix for pull request finding
tastybento Jun 13, 2026
9ef07aa
Fix compilation error in PhManager.getLatestTransaction
tastybento Jun 14, 2026
10ba0a7
Address PR #66 review: localize latest-transaction placeholder, harde…
tastybento Jun 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '21'
- name: Cache SonarCloud packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand All @@ -37,7 +37,7 @@ jobs:
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
- run: mkdir staging && cp target/*.jar staging
- name: Save artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Package
path: staging
path: staging
144 changes: 144 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Bank is a BentoBox addon for Minecraft (Spigot) that provides an island-based banking/economy system. It integrates with Vault for economy operations and supports multiple BentoBox game modes (BSkyBlock, AOneBlock, AcidIsland, SkyGrid, CaveBlock).

## Build Commands

```bash
mvn clean package # Build the plugin JAR
mvn test # Run tests only
mvn verify # Build + tests + coverage
```

Output JAR goes to `target/`. The build requires Java 21+.

## Testing

- JUnit 5 (Jupiter) with Mockito (incl. static mocking) and MockBukkit
- Run a single test: `mvn test -Dtest=BankManagerTest`
- Tests are in `src/test/java/world/bentobox/bank/` mirroring main source structure
- JaCoCo coverage reports: `target/site/jacoco/`

## Architecture

**Entry point:** `BankPladdon` → `Bank` (addon lifecycle: onEnable loads Vault, config, BankManager, registers commands with each game mode)

**Core layers:**
- **BankManager** — Central business logic: deposit/withdraw/balance operations, compound interest calculation, LRU cache (max 20 accounts), async database persistence. Listens for island deletion events to clean up accounts.
- **Money** — Value type wrapping `BigDecimal` with 2 decimal places. All currency arithmetic goes through this class.
- **BankAccounts** — Persisted data object per island (balance, transaction history, interest timestamp). Uses BentoBox's database layer.
- **Settings** — Maps to `config.yml`. Interest rate, compound period, cooldown, game modes, command names.

**Command hierarchy:**
- `commands/user/` — Player commands (balance, deposit, withdraw, statement, baltop) registered under each game mode's island command
- `commands/admin/` — Admin commands (balance, give, set, take, statement) with AbstractAdminBankCommand handling target player resolution
- Both extend `AbstractBankCommand` which provides shared argument parsing

**PhManager** — Registers BentoBox placeholders for each game mode (balance, top-N rankings). Caches top-10 for 10 seconds.

## Key Dependencies (provided at runtime, not bundled)

- Paper API 1.21.x
- BentoBox 3.14.0-SNAPSHOT
- Vault API 1.7

## Localization

23 language files in `src/main/resources/locales/`, matching BentoBox's full locale set (cs, de, en-US, es, fr, hr, hu, id, it, ja, ko, lv, nl, pl, pt, pt-BR, ro, ru, tr, uk, vi, zh-CN, zh-HK). `en-US.yml` is the reference; all other files must carry the same keys. Message keys are referenced in commands via BentoBox's `user.sendMessage()` system. Use the `/sync-locales` skill to find and fill missing keys.

## CI

GitHub Actions (`.github/workflows/build.yml`): triggers on push to `develop` and PRs. Runs Maven verify with SonarCloud analysis using Java 21.

## Dependency Source Lookup

When you need to inspect source code for a dependency (e.g., BentoBox, addons):

1. **Check local Maven repo first**: `~/.m2/repository/` — sources jars are named `*-sources.jar`
2. **Check the workspace**: Look for sibling directories or Git submodules that may contain the dependency as a local project (e.g., `../bentoBox`, `../addon-*`)
3. **Check Maven local cache for already-extracted sources** before downloading anything
4. Only download a jar or fetch from the internet if the above steps yield nothing useful

Prefer reading `.java` source files directly from a local Git clone over decompiling or extracting a jar.

In general, the latest version of BentoBox should be targeted.

## Project Layout

Related projects are checked out as siblings under `~/git/`:

**Core:**
- `bentobox/` — core BentoBox framework

**Game modes:**
- `addon-acidisland/` — AcidIsland game mode
- `addon-bskyblock/` — BSkyBlock game mode
- `Boxed/` — Boxed game mode (expandable box area)
- `CaveBlock/` — CaveBlock game mode
- `OneBlock/` — AOneBlock game mode
- `SkyGrid/` — SkyGrid game mode
- `RaftMode/` — Raft survival game mode
- `StrangerRealms/` — StrangerRealms game mode
- `Brix/` — plot game mode
- `parkour/` — Parkour game mode
- `poseidon/` — Poseidon game mode
- `gg/` — gg game mode

**Addons:**
- `addon-level/` — island level calculation
- `addon-challenges/` — challenges system
- `addon-welcomewarpsigns/` — warp signs
- `addon-limits/` — block/entity limits
- `addon-invSwitcher/` / `invSwitcher/` — inventory switcher
- `addon-biomes/` / `Biomes/` — biomes management
- `Bank/` — island bank
- `Border/` — world border for islands
- `Chat/` — island chat
- `CheckMeOut/` — island submission/voting
- `ControlPanel/` — game mode control panel
- `Converter/` — ASkyBlock to BSkyBlock converter
- `DimensionalTrees/` — dimension-specific trees
- `discordwebhook/` — Discord integration
- `Downloads/` — BentoBox downloads site
- `DragonFights/` — per-island ender dragon fights
- `ExtraMobs/` — additional mob spawning rules
- `FarmersDance/` — twerking crop growth
- `GravityFlux/` — gravity addon
- `Greenhouses-addon/` — greenhouse biomes
- `IslandFly/` — island flight permission
- `IslandRankup/` — island rankup system
- `Likes/` — island likes/dislikes
- `Limits/` — block/entity limits
- `lost-sheep/` — lost sheep adventure
- `MagicCobblestoneGenerator/` — custom cobblestone generator
- `PortalStart/` — portal-based island start
- `pp/` — pp addon
- `Regionerator/` — region management
- `Residence/` — residence addon
- `TopBlock/` — top ten for OneBlock
- `TwerkingForTrees/` — twerking tree growth
- `Upgrades/` — island upgrades (Vault)
- `Visit/` — island visiting
- `weblink/` — web link addon
- `CrowdBound/` — CrowdBound addon

**Data packs:**
- `BoxedDataPack/` — advancement datapack for Boxed

**Documentation & tools:**
- `docs/` — main documentation site
- `docs-chinese/` — Chinese documentation
- `docs-french/` — French documentation
- `BentoBoxWorld.github.io/` — GitHub Pages site
- `website/` — website
- `translation-tool/` — translation tool

Check these for source before any network fetch.

## Key Dependencies (source locations)

- `world.bentobox:bentobox` → `~/git/bentobox/src/`
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Bank
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_Bank&metric=bugs)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_Bank)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_Bank&metric=coverage)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_Bank)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_Bank&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_Bank)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_Bank&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_Bank)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_Bank&metric=security_rating)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_Bank)
Expand Down
95 changes: 56 additions & 39 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,20 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<java.version>21</java.version>
<vault.version>1.7</vault.version>
<!-- Non-minecraft related dependencies -->
<powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.21.3-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.7.1-SNAPSHOT</bentobox.version>
<paper.version>1.21.11-R0.1-SNAPSHOT</paper.version>
<bentobox.version>3.14.0-SNAPSHOT</bentobox.version>
<junit.version>5.10.2</junit.version>
<mockito.version>5.11.0</mockito.version>
<mock-bukkit.version>4.110.0</mock-bukkit.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>1.9.1</build.version>
<build.version>1.10.0</build.version>
<sonar.projectKey>BentoBoxWorld_Bank</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
Expand Down Expand Up @@ -112,8 +113,8 @@

<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>bentoboxworld</id>
Expand All @@ -124,8 +125,8 @@
<url>https://repo.codemc.org/repository/maven-public/</url>
</repository>
<repository>
<id>codemc-public</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
<id>codemc</id>
<url>https://repo.codemc.org/repository/maven-snapshots/</url>
</repository>
<repository>
<id>jitpack.io</id>
Expand All @@ -135,37 +136,51 @@
</repositories>

<dependencies>
<!-- Spigot API -->
<!-- Paper API -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigot.version}</version>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>${paper.version}</version>
<scope>provided</scope>
</dependency>
<!-- Mockito (Unit testing) -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.0.0</version>
<groupId>world.bentobox</groupId>
<artifactId>bentobox</artifactId>
<version>${bentobox.version}</version>
<scope>provided</scope>
</dependency>
<!-- MockBukkit -->
<dependency>
<groupId>org.mockbukkit.mockbukkit</groupId>
<artifactId>mockbukkit-v1.21</artifactId>
<version>${mock-bukkit.version}</version>
<scope>test</scope>
</dependency>
<!-- JUnit 5 -->
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>${powermock.version}</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- Mockito -->
<dependency>
<groupId>world.bentobox</groupId>
<artifactId>bentobox</artifactId>
<version>${bentobox.version}</version>
<scope>provided</scope>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<!-- Vault: as their maven repo is down, we need to get it from jitpack -->
<!-- See https://github.com/MilkBowl/VaultAPI/issues/69 -->
Expand Down Expand Up @@ -204,12 +219,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<version>3.5.0</version>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>blu</nonFilteredFileExtension>
Expand All @@ -219,14 +234,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.15.0</version>
<configuration>
<release>${java.version}</release>
<fork>true</fork>
</configuration>
</plugin> <plugin>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<version>3.5.5</version>
<configuration>
<argLine>
${argLine}
Expand Down Expand Up @@ -263,12 +280,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version>
<version>3.12.0</version>
<configuration>
<failOnError>false</failOnError>
<additionalJOption>-Xdoclint:none</additionalJOption>
Expand All @@ -285,7 +302,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -298,17 +315,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
<version>3.1.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<version>3.1.4</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<version>0.8.13</version>
<configuration>
<append>true</append>
<excludes>
Expand Down
Loading
Loading