This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Level is a BentoBox add-on for Minecraft that calculates island levels based on block types and counts, maintains top-ten leaderboards, and provides competitive metrics for players on game modes like BSkyBlock and AcidIsland.
# Build
mvn clean package
# Run all tests
mvn test
# Run a single test class
mvn test -Dtest=LevelTest
# Run a specific test method
mvn test -Dtest=LevelTest#testMethodName
# Full build with coverage
mvn verifyJava 21 is required. The build produces a shaded JAR (includes PanelUtils).
LevelPladdon— Bukkit plugin entry point; instantiatesLevelvia thePladdoninterfaceLevel— main addon class; loads config, registers commands/listeners/placeholders, and hooks into optional third-party plugins
onLoad() → onEnable() → allLoaded()
allLoaded() is where integrations with other BentoBox add-ons (Warps, Visit) are established, since those may not be loaded yet during onEnable().
| Class | Role |
|---|---|
LevelsManager |
Central manager: island level cache, top-ten lists, database reads/writes |
Pipeliner |
Async queue; limits concurrent island calculations (configurable) |
IslandLevelCalculator |
Core chunk-scanning algorithm; supports multiple block stacker plugins |
Results |
Data object returned by a completed calculation |
ConfigSettings |
Main config bound to config.yml via BentoBox's @ConfigEntry annotations |
BlockConfig |
Block point-value mappings from blockconfig.yml |
PlaceholderManager |
Registers PlaceholderAPI placeholders |
world/bentobox/level/
├── calculators/ # IslandLevelCalculator, Pipeliner, Results, EquationEvaluator
├── commands/ # Player and admin sub-commands
├── config/ # ConfigSettings, BlockConfig
├── events/ # IslandPreLevelEvent, IslandLevelCalculatedEvent
├── listeners/ # Island activity, join/leave, migration listeners
├── objects/ # IslandLevels, TopTenData (database-persisted objects)
├── panels/ # GUI panels (top-ten, details, block values)
├── requests/ # API request handlers for inter-addon queries
└── util/ # Utils, ConversationUtils, CachedData
- A calculation request enters
Pipeliner(async queue, default concurrency = 1) IslandLevelCalculatorscans island chunks using chunk snapshots (non-blocking)- Block counts are looked up against
BlockConfigpoint values - An equation (configurable formula) converts total points → island level
- Results are stored via
LevelsManagerand fired asIslandLevelCalculatedEvent
Level hooks into these plugins when present: WildStacker, RoseStacker, UltimateStacker (block counts), AdvancedChests, ItemsAdder, Oraxen (custom blocks), and the BentoBox Warps/Visit add-ons.
Tests live in src/test/java/world/bentobox/level/. The framework is JUnit 5 + Mockito 5 + MockBukkit. CommonTestSetup is a shared base class that sets up the MockBukkit server and BentoBox mocks — extend it for new test classes.
JaCoCo coverage reports are generated during mvn verify.
| File | Location in JAR | Purpose |
|---|---|---|
config.yml |
src/main/resources/ |
Main settings (level cost formula, world inclusion, etc.) |
blockconfig.yml |
src/main/resources/ |
Points per block type |
locales/ |
src/main/resources/locales/ |
Translation strings |
panels/ |
src/main/resources/panels/ |
GUI layout definitions |
Panel template upgrades: Files under panels/ are copied to the addon's data folder (plugins/BentoBox/addons/Level/panels/) on first run and are not overwritten on upgrade. If a release modifies a panel template (new tabs, buttons, slots, etc.), the release notes/changelog must explicitly instruct users to delete the affected on-disk panel file so it regenerates — otherwise existing servers will silently keep the old layout.
Current upgrade-sensitive example: If src/main/resources/panels/detail_panel.yml changes (for example by adding a new DONATED tab), existing servers must delete/regenerate plugins/BentoBox/addons/Level/panels/detail_panel.yml after upgrading or they will continue using the old panel definition and the new tab will not appear.
- Null safety via Eclipse JDT annotations (
@NonNull,@Nullable) — honour these on public APIs - BentoBox framework patterns:
CompositeCommandfor commands,@ConfigEntry/@ConfigCommentfor config,@StoreAtfor database objects - Pre- and post-events (
IslandPreLevelEvent,IslandLevelCalculatedEvent) follow BentoBox's cancellable event pattern — fire both when adding new calculation triggers
When you need to inspect source code for a dependency (e.g., BentoBox, addons):
- Check local Maven repo first:
~/.m2/repository/— sources jars are named*-sources.jar - Check the workspace: Look for sibling directories or Git submodules that may contain the dependency as a local project (e.g.,
../bentoBox,../addon-*) - Check Maven local cache for already-extracted sources before downloading anything
- 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.
Related projects are checked out as siblings under ~/git/:
Core:
bentobox/— core BentoBox framework
Game modes:
addon-acidisland/— AcidIsland game modeaddon-bskyblock/— BSkyBlock game modeBoxed/— Boxed game mode (expandable box area)CaveBlock/— CaveBlock game modeOneBlock/— AOneBlock game modeSkyGrid/— SkyGrid game modeRaftMode/— Raft survival game modeStrangerRealms/— StrangerRealms game modeBrix/— plot game modeparkour/— Parkour game modeposeidon/— Poseidon game modegg/— gg game mode
Addons:
addon-level/— island level calculationaddon-challenges/— challenges systemaddon-welcomewarpsigns/— warp signsaddon-limits/— block/entity limitsaddon-invSwitcher//invSwitcher/— inventory switcheraddon-biomes//Biomes/— biomes managementBank/— island bankBorder/— world border for islandsChat/— island chatCheckMeOut/— island submission/votingControlPanel/— game mode control panelConverter/— ASkyBlock to BSkyBlock converterDimensionalTrees/— dimension-specific treesdiscordwebhook/— Discord integrationDownloads/— BentoBox downloads siteDragonFights/— per-island ender dragon fightsExtraMobs/— additional mob spawning rulesFarmersDance/— twerking crop growthGravityFlux/— gravity addonGreenhouses-addon/— greenhouse biomesIslandFly/— island flight permissionIslandRankup/— island rankup systemLikes/— island likes/dislikesLimits/— block/entity limitslost-sheep/— lost sheep adventureMagicCobblestoneGenerator/— custom cobblestone generatorPortalStart/— portal-based island startpp/— pp addonRegionerator/— region managementResidence/— residence addonTopBlock/— top ten for OneBlockTwerkingForTrees/— twerking tree growthUpgrades/— island upgrades (Vault)Visit/— island visitingweblink/— web link addonCrowdBound/— CrowdBound addon
Data packs:
BoxedDataPack/— advancement datapack for Boxed
Documentation & tools:
docs/— main documentation sitedocs-chinese/— Chinese documentationdocs-french/— French documentationBentoBoxWorld.github.io/— GitHub Pages sitewebsite/— websitetranslation-tool/— translation tool
Check these for source before any network fetch.
world.bentobox:bentobox→~/git/bentobox/src/