π What's new
Greenhouses now has admin commands. Until this release the addon had no admin command tree at all β the README documented one, but it was never actually there. If a greenhouse record went bad, your only option was to stop the server and edit the database by hand.
That gap became obvious in #135, where two overlapping greenhouses were skipped at every startup with a message that named neither of them. 1.9.6 made the log say which records were involved; 1.10.0 lets you do something about it without leaving the game.
This release also clears every open SonarCloud issue in the project β 68 of them β including four genuine bugs found along the way.
β¨ Highlights
π οΈ Admin commands (#139, closes #137)
Registered under your game mode's admin command, e.g. /bsbadmin greenhouses (aliases greenhouse, gh):
| Command | What it does |
|---|---|
list [player] [page] |
Paginated list of greenhouses, optionally just one player's. Records that failed to load are always listed too, with the reason. |
info [id] |
Recipe, owner, world, location, bounding box, area, original biome, hopper, broken status and missing blocks. With no ID, uses the greenhouse you're standing in. |
delete <id> |
Deletes a record β loaded or not β after asking you to confirm. |
tp <id> |
Teleports you to the middle of the greenhouse floor. |
verify [id] |
Re-checks one or all greenhouses against their recipe and reports what's missing. Previously this only happened on the eco tick. |
reload |
Re-reads biomes.yml, then re-loads the greenhouses from the database. |
- IDs come from
listand can be shortened to any prefix that matches only one greenhouse. An ambiguous prefix is treated as no match rather than guessing β deleting the wrong greenhouse can't be undone. - Everything except
tpworks from the server console. - Greenhouse records that can't be loaded β overlapping, unknown recipe, missing world, no location β are now kept in memory with the reason instead of being silently dropped. That's what makes them showable and deletable; previously they existed in the database but were invisible to the running server.
- Records are still never deleted automatically. Removing a player's greenhouse without being asked would be worse than a recurring warning.
π Fixes
- Checking a greenhouse whose recipe no longer exists threw an NPE. When a database record names a recipe that isn't in
biomes.yml, the addon hands out a degenerateBiomeRecipewith no addon reference β and checking it crashed. It now reportsFAIL_UNKNOWN_RECIPE(#140) getFloorHeightcould throw on a record with no location β the very records most likely to be broken. It now falls back to the bounding box (#140)- πΊ Snow reported success from only the last column it scanned.
SnowTrackeroverwrote its "did I make snow?" result on every column instead of accumulating it, so a greenhouse that made snow in ninety columns and missed the last one reported failure. That value decides whether water is consumed from the hopper (#143) - Floating-point loop counters in
EcoSystemManager#getAvailableBlocksreplaced with integer block coordinates (#140)
π§Ή Code quality
All 68 open SonarCloud issues resolved; the quality gate is green with zero duplicated blocks.
- Five methods refactored below the cognitive-complexity threshold, the worst being
SnowTracker#getAirBlocksat 27 and a 72-line "brain method" inRecipeManager(#143) - Dead code removed, including three command stubs that were never registered (#141) β see the note below
- Redundant argument matchers cleaned out of the tests (#144)
- Test suite grew from 177 to 224 tests
βοΈ Compatibility
βοΈ BentoBox API 2.7.1
βοΈ Minecraft 1.21.5+
βοΈ Java 21
πΊ Updating β important notes
βοΈ New permissions. The six admin sub-commands each have their own node: greenhouses.admin.list, .info, .delete, .tp, .verify and .reload. They default to op, so operators need no action, but if you grant admin access through a permissions plugin you'll want to add them. They were missing from addon.yml entirely before this release, which is why nothing but op access worked.
π‘ Translators wanted. The admin commands add messages under greenhouses.commands.admin.*, currently English only. The other 24 locale files will fall back to the key names until they're translated.
Three player commands were deleted β but none of them worked. InfoCommand, ListCommand and RecipeCommand were unregistered stubs whose method bodies were auto-generated placeholders and commented-out legacy code. InfoCommand even declared itself under the label "make", which would have collided with the real make command had anyone ever enabled it. The README listed greenhouses list and greenhouses recipe as working player commands; they were not, and that has been corrected. /is greenhouses with no arguments still opens the recipe GUI, which is what most people were using anyway.
If you have overlapping greenhouses, this release finally gives you the tool: /bsbadmin greenhouses list shows the skipped records and why, and /bsbadmin greenhouses delete <id> removes the one you don't want. No database editing, no restart.
π₯ How to update
- Stop the server
- Back up your BentoBox folder
- Drop the new jar into the addons folder and remove the old one
- Grant the new
greenhouses.admin.*permissions if you use a permissions plugin - Start the server
- Check the startup log for skipped greenhouse records, and clear any up with the new admin commands
Legend
- π‘ locale files may need to be regenerated or updated
- βοΈ config options have been removed, renamed, or added
- πΊ special attention needed
What's Changed
- π‘ βοΈ Add admin commands by @tastybento in #139
- πΊ Fix SonarCloud bugs and correctness issues by @tastybento in #140
- Remove dead code flagged by SonarCloud by @tastybento in #141
- πΊ Reduce cognitive complexity of five methods by @tastybento in #143
- Remove redundant argument matchers from tests by @tastybento in #144
- βοΈ Document the admin commands and declare their permissions by @tastybento in #145
Full Changelog: 1.9.6...1.10.0