Skip to content

New release#164

Open
tastybento wants to merge 35 commits intomasterfrom
develop
Open

New release#164
tastybento wants to merge 35 commits intomasterfrom
develop

Conversation

@tastybento
Copy link
Copy Markdown
Member

No description provided.

tastybento and others added 30 commits July 12, 2025 08:19
Spigot/Paper changed oversize stack size to be 1-99. It prevented to load items from template, as they were in size over 100. This splits items into 2 stacks and allows them to load.

Addresses issue in #156
- Switch from spigot-api to paper-api (BentoBox 3.14.x uses Paper/Adventure)
- Replace HTTP vault-repo with PaperMC HTTPS repo
- Update BentoBox version to 3.14.0 and build version to 2.3.0
- Remove powermock dependencies and sonar plugin from sonar profile
- Remove IllegalAccessException catch blocks in WebManager (no longer thrown)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces 81 passing tests across 5 test classes covering the main
addon lifecycle, data objects, and event listeners. Upgrades test
infrastructure from the old Mockito 3.x setup to JUnit5 + MockBukkit
+ Mockito 5.x, mirroring the CaveBlock addon test patterns.

- pom.xml: add JUnit5 5.10.2, Mockito 5.11.0, MockBukkit v1.21-SNAPSHOT;
  upgrade maven-surefire-plugin to 3.5.2 with Java 21 --add-opens flags
- CommonTestSetup: abstract base class with full BentoBox ecosystem mocks
- WhiteBox: reflection utility for injecting BentoBox singleton
- TestWorldSettings: minimal WorldSettings implementation for tests
- BiomesAddonTest: lifecycle tests (onLoad, onEnable, onReload, flags)
- BiomesObjectTest: POJO tests (getters/setters, compareTo, isValid)
- BiomesIslandDataObjectTest: unlock/purchase/counter/clear logic
- JoinLeaveListenerTest: event delegation verification
- ChangeOwnerListenerTest: reset-biome guard and permission logic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dmin panels (#157)

Cost values entered by admins (e.g. `0.03`) were displayed as their full
IEEE 754 double representation (`0.0299999999329447746`) in GUI tooltips
due to bare `String.valueOf(double)` calls.

## Changes

- **`Utils`** — Added `formatDouble(double)` using a
`ThreadLocal<DecimalFormat>` with pattern `"0.###"`: up to 3 decimal
places, trailing zeros stripped, thread-safe for concurrent panel access
across players.

```java
// Before
String.valueOf(this.biome.getCostIncrement())  // → "0.0299999999329447746"

// After
Utils.formatDouble(this.biome.getCostIncrement())  // → "0.03"
```

- **`BiomeEditPanel`** — Applied `Utils.formatDouble()` to the three
`double`-typed cost fields displayed in the admin edit panel: unlock
cost, change cost, and cost increment.
- **`CommonPanel`** — Applied `Utils.formatDouble()` to unlock cost in
the biome description lore.
Biome update tasks queued for an island continued processing even after
the island was deleted or reset, applying biome changes to a now-invalid
island.

## Changes

- **`BiomeUpdateTask`** — Added `islandId` field (getter/setter) to
associate each task with its island.
- **`BiomeUpdateHelper`** — Sets `islandId` on the task at creation time
via `island.getUniqueId()`.
- **`UpdateQueue`** — Added `cancelBiomeUpdates(String islandId)`:
removes matching tasks from both the pending queue and the in-progress
map, then completes their futures with `FAILED` (after removal to avoid
race conditions).
- **`JoinLeaveListener`** — Calls `cancelBiomeUpdates` on
`IslandDeleteEvent` and `IslandResettedEvent` before delegating to the
existing manager methods.

```java
// JoinLeaveListener — island delete and reset now both cancel queued tasks
public void onIslandDelete(IslandDeleteEvent event) {
    this.addon.getUpdateQueue().cancelBiomeUpdates(event.getIsland().getUniqueId());
    this.addon.getAddonManager().wipeIslandData(event.getIsland().getUniqueId());
}

public void onIslandCreated(IslandResettedEvent event) {
    this.addon.getUpdateQueue().cancelBiomeUpdates(event.getIsland().getUniqueId());
    this.addon.getAddonManager().validateIslandData(event.getIsland());
}
```

- **`JoinLeaveListenerTest`** — Updated to verify `cancelBiomeUpdates`
is invoked with the correct island ID on both events.
If no biomes are found in the database for a game mode on startup,
automatically load biomesTemplate.yml so the addon works out of the box.
Also fixes duplicate and malformed keys in biomesTemplate_zh.yml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ng biome changes (#159)

Adds a configurable guard to prevent biome changes from overwriting
ocean biomes. By default (`false`), any block whose current biome is an
ocean variant is left untouched during a biome update operation.

## Changes

- **`Settings.java`**: New `change-ocean-biomes` boolean config entry
(default: `false`) placed after `default-mode`, with getter/setter. When
`false`, ocean biome positions are skipped entirely.
- **`BiomeUpdateTask.java`**: Added `OCEAN_BIOMES` static constant
covering all 9 ocean biome types. `runBiomeChange()` reads the setting
once per chunk and skips positions whose current biome is in the set.

```yaml
# config.yml — new option after default-mode
change-ocean-biomes: false  # set to true to restore previous behaviour
```

Covered ocean biomes: `OCEAN`, `WARM_OCEAN`, `LUKEWARM_OCEAN`,
`COLD_OCEAN`, `FROZEN_OCEAN`, `DEEP_OCEAN`, `DEEP_LUKEWARM_OCEAN`,
`DEEP_COLD_OCEAN`, `DEEP_FROZEN_OCEAN`.
Players in unrelated worlds (e.g. /wilderness) no longer receive the
clickable "use it now" prompt for biomes unlocked on a different
gamemode's island. When the recipient's current world doesn't match the
island's gamemode, send a non-clickable message that names the gamemode
so the player knows where the unlock applies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Simpler than the prior two-variant message: if the recipient isn't in
the island's gamemode world, send nothing. Removes the now-unused
click-text-to-*-other-world locale keys.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
## Summary
- When a biome unlocks, only send the clickable "use it now" prompt if
the player is currently in that island's gamemode world.
- Players in other worlds (e.g. `/wilderness`, a different gamemode)
receive a plain message naming the gamemode instead, so they know where
the unlock applies and aren't misled into running a command in the wrong
world.
- Adds two new locale keys (`click-text-to-purchase-other-world`,
`click-text-to-set-other-world`) in `en-US.yml`.

Closes #112

## Test plan
- [x] Multi-gamemode dev server (e.g. BSkyBlock + AcidIsland + a
non-addon world).
- [x] Trigger an unlock while standing on the correct island → clickable
message as before; click runs the gamemode command.
- [x] Trigger an unlock while the recipient is in a different gamemode
or `/wilderness` → non-clickable message naming the gamemode.
- [x] Rejoin the server outside the gamemode world → JoinLeaveListener
path produces the gamemode-named variant.
- [ ] Offline members still receive nothing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Matches the Paper 1.21.11 runtime already declared in pom.xml.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Drop unused powermock.version and spigot.version properties
- Drop the Spigot Nexus repository (Paper is the only API in use)
- Add codemc maven-public and codemc snapshots repos; keep the
  bentoboxworld repo for BentoBox releases
- Bump maven-compiler-plugin 3.7.0 -> 3.15.0 with fork=true for Java 21
  toolchain compatibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers the happy path: IslandLevelCalculatedEvent triggers
BiomesAddonManager.checkBiomesUnlockStatus with the event's island,
target player (as User), and level. Brings every event listener in the
addon to minimum test coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…stener test (#161)

## Summary
- `plugin.yml`: bump `api-version` from `1.19` to `1.21` to match the
Paper 1.21.11 runtime already declared in `pom.xml`.
- `pom.xml`: drop unused `powermock.version` / `spigot.version`
properties and the Spigot Nexus repository; add the codemc maven-public
+ snapshots repos alongside the existing bentoboxworld repo; bump
`maven-compiler-plugin` 3.7.0 → 3.15.0 with `fork=true` for Java 21
toolchain compatibility.
- Add `IslandLevelListenerTest` so every event listener in the addon now
has a test.

## Test plan
- [x] `mvn test` — 82 tests, 0 failures (81 existing + 1 new)
- [ ] CI green on the PR

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Converts all legacy &-prefixed color codes to MiniMessage tags across
locale files, biome templates, panel YAMLs, and hardcoded Java strings
so formatting is consistent with the modernisation effort (BentoBox
3.14.0 parses MiniMessage natively via User.convertToLegacy).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds translations for: cs (Czech), de (German), hr (Croatian),
hu (Hungarian), id (Indonesian), it (Italian), ko (Korean),
pt (Portuguese), pt-BR (Brazilian Portuguese), ro (Romanian),
ru (Russian), tr (Turkish), vi (Vietnamese), zh-HK (Traditional Chinese).

This brings Biomes locale coverage in line with BentoBox core (23 locales).
All new files use MiniMessage formatting tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
## Summary
- Convert all legacy `&`-prefixed color codes to MiniMessage tags across
9 locale files, 2 biome templates, and 3 panel YAMLs (~6,500+ tokens).
- Update two hardcoded Java strings (`ItemSelector.java` dummy item
name, `BiomesBundleObject.java` dummy bundle). User-input processing
sites (`ConversationUtils`, `LibraryPanel`) deliberately left alone —
they handle end-user text that may still contain `&` codes, which
BentoBox's converter merges with MiniMessage.
- **Add 14 missing locale translations** (cs, de, hr, hu, id, it, ko,
pt, pt-BR, ro, ru, tr, vi, zh-HK) to match BentoBox core's 23-language
coverage. All new files use MiniMessage formatting.
- Tag style: short named tags (`<white>`, `<bold>`, `<gray>`, `<red>`,
`<reset>`, etc.).
- Non-breaking: BentoBox 3.14.0 auto-detects and handles mixed
legacy/MiniMessage content in `User.convertToLegacy()`.

## Test plan
- [x] `mvn clean verify` — 82 tests pass
- [x] `grep -rE '&[0-9a-frk-or]' src/main/resources` returns no matches
- [ ] Load on a Paper 1.21.x test server with BentoBox 3.14.0 and
confirm GUI titles, biome lore, error messages, and chat output render
correctly (no literal `<tag>` text visible)
- [ ] Spot-check translations in non-English locales for correctness

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…showcase

Rebalance the default biome template to create a smoother progression curve,
remove duplicates, and showcase unused addon features (PER_USAGE costs, bundles).

Changes:
- Remove 2 duplicate biomes (mooshroom/mushroom_fields, mountain/snowy_slopes)
- Add 9 new biomes: Mangrove Swamp, Snowy Plains, Dark Forest, Meadow,
  Bamboo Jungle, Dripstone Caves, River, Pale Garden, The End
- Fix 6 generic icons with thematic alternatives
- Rebalance costs to correlate with mob exclusivity and utility
- Add PER_USAGE mode to 3 premium biomes (bamboo_jungle, mushroom_fields,
  pale_garden) to demonstrate escalating costs
- Add thematic unlock item costs where missing
- Improve all descriptions to hint at exclusive mobs and resources
- Add 3 bundles (Starter, Explorer, Nether & End)
- Smooth level progression curve (fill barren 75-250 gap)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ject state

Replace Hungarian quotation marks „" with single quotes in hu.yml to fix
YAML parse error. Update CLAUDE.md: version 2.3.0-SNAPSHOT, BentoBox 3.14.0,
Paper 1.21.11, 23 locales, JUnit 5 + Mockito 5, MiniMessage formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
## Summary

- **Remove 2 duplicates**: `mooshroom` (duplicate of `mushroom_fields`)
and `mountain` (duplicate of `snowy_slopes`)
- **Add 9 new biomes**: Mangrove Swamp (frogs, L5), Snowy Plains (L8),
Dark Forest (L35), Meadow (L40), Bamboo Jungle (L55), Dripstone Caves
(L65), River (L85), Pale Garden (The Creaking, L180), The End (L200)
- **Rebalance costs & levels** so price correlates with mob exclusivity
(e.g. Jungle up from 200→500 for 3 exclusive mobs; Mushroom down from
4000→3000)
- **Showcase PER_USAGE** on 3 premium biomes (bamboo_jungle +50/use,
mushroom_fields +300/use, pale_garden +200/use)
- **Fix 6 generic icons** (GRASS_BLOCK/STONE → ORANGE_TERRACOTTA,
BAMBOO, POWDER_SNOW_BUCKET, OAK_LEAVES, POINTED_DRIPSTONE, ANDESITE)
- **Add thematic unlock items** where missing (desert→SAND:32,
eroded_badlands→TERRACOTTA:20, etc.)
- **Improve all descriptions** to hint at exclusive mobs, resources, and
atmosphere
- **Add 3 bundles**: Starter (5 biomes), Explorer (7 biomes), Nether &
End (6 biomes)
- **Smooth level curve**: fill the barren 75-250 gap so every 25-level
band has 3+ options

### Progression overview (44 biomes total)

| Level band | Before | After | 
|-----------|--------|-------|
| 0-25 | 7 | 12 |
| 25-50 | 5 | 10 |
| 50-75 | 7 | 12 |
| 75-150 | 4 | 3 |
| 150-200 | 1 | 4 |
| 200+ | 5 | 5 |

### Reasoning highlights

| Change | Why |
|--------|-----|
| Mangrove Swamp at L5 | Frogs are a fan-favorite mob; gives early
players something exciting |
| Pale Garden at L180 | Newest content (1.21.4); The Creaking mob fills
the 150-250 dead zone |
| PER_USAGE on 3 biomes | This mechanic was never showcased in the
template despite being a key feature |
| Bundles | Never used in template; gives server admins a working
example |
| Jungle cost 200→500 | 3 exclusive mobs (parrot, ocelot, panda) was
massively underpriced vs mushroom at 4000 |
| Mushroom cost 4000→3000 | Slight reduction but now PER_USAGE with +300
increment — creates interesting economic decisions |

## Test plan

- [ ] Import template via `/bsbadmin biomes import` and verify all 44
biomes load
- [ ] Confirm icons render correctly in biome panel (especially new
ones: POINTED_DRIPSTONE, POWDER_SNOW_BUCKET, PALE_OAK_LOG,
MANGROVE_PROPAGULE)
- [ ] Verify PER_USAGE cost escalation works on bamboo_jungle,
mushroom_fields, pale_garden
- [ ] Check all 3 bundles appear and contain correct biomes
- [ ] Verify PALE_GARDEN and THE_END biomes apply correctly in their
respective environments
- [ ] Spot-check descriptions display properly with MiniMessage
formatting

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@tastybento tastybento requested a review from Copilot April 26, 2026 21:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new release with expanded localization support, updated default biome templates, new biome-update controls, and dependency/build modernization.

Changes:

  • Added multiple new locale YAML files and updated text formatting toward MiniMessage tags.
  • Reworked biomesTemplate.yml with tiered progression and added new biome/bundle definitions.
  • Added new runtime behaviors: cancel pending biome updates on island reset/delete, optional ocean-biome skipping during biome changes, auto-import of default biomes, plus updated build dependencies (Paper + modern test stack).

Reviewed changes

Copilot reviewed 32 out of 52 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/resources/locales/pt.yml Adds Portuguese (pt) translations for Biomes UI/messages.
src/main/resources/locales/pt-BR.yml Adds Portuguese (Brazil) translations for Biomes UI/messages.
src/main/resources/locales/ko.yml Adds Korean translations for Biomes UI/messages.
src/main/resources/locales/it.yml Adds Italian translations for Biomes UI/messages.
src/main/resources/locales/id.yml Adds Indonesian translations for Biomes UI/messages.
src/main/resources/locales/de.yml Adds German translations for Biomes UI/messages.
src/main/resources/biomesTemplate.yml Reorganizes/expands default biome and bundle template definitions.
src/main/java/world/bentobox/biomes/web/WebManager.java Simplifies GitHub download exception handling.
src/main/java/world/bentobox/biomes/utils/Utils.java Adds double formatting helper and refines unlock message routing by world/gamemode.
src/main/java/world/bentobox/biomes/tasks/UpdateQueue.java Adds island-scoped cancellation of queued/in-progress biome update tasks.
src/main/java/world/bentobox/biomes/tasks/BiomeUpdateTask.java Adds ocean-biome skip option and islandId tracking for tasks.
src/main/java/world/bentobox/biomes/tasks/BiomeUpdateHelper.java Plumbs islandId into created biome update tasks.
src/main/java/world/bentobox/biomes/panels/util/ItemSelector.java Updates empty item label formatting to MiniMessage.
src/main/java/world/bentobox/biomes/panels/admin/BiomeEditPanel.java Uses formatted doubles for costs/increments in admin panel.
src/main/java/world/bentobox/biomes/panels/CommonPanel.java Uses formatted doubles for unlock prices.
src/main/java/world/bentobox/biomes/listeners/JoinLeaveListener.java Cancels biome updates on island reset/delete events.
src/main/java/world/bentobox/biomes/database/objects/BiomesBundleObject.java Migrates “No Bundle” display strings to MiniMessage.
src/main/java/world/bentobox/biomes/config/Settings.java Adds change-ocean-biomes config option and accessors.
src/main/java/world/bentobox/biomes/BiomesAddon.java Auto-imports default biomes from template when a gamemode has none.
pom.xml Switches to Paper API and modernizes test/build tooling versions/config.
CLAUDE.md Adds repo guidance doc including build/test/CI notes and formatting conventions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/world/bentobox/biomes/utils/Utils.java Outdated
Comment on lines +133 to +169
/**
* Cancels all queued and in-progress biome update tasks for the given island.
* Tasks are completed with {@link Result#FAILED} so that any waiting callbacks are notified.
*
* @param islandId the unique ID of the island whose tasks should be cancelled
*/
public void cancelBiomeUpdates(String islandId)
{
if (islandId == null)
{
return;
}

List<BiomeUpdateTask> toCancel = new ArrayList<>();

this.processQueue.removeIf(task ->
{
if (islandId.equals(task.getIslandId()))
{
toCancel.add(task);
return true;
}
return false;
});

this.processStartMap.entrySet().removeIf(entry ->
{
if (islandId.equals(entry.getKey().getIslandId()))
{
toCancel.add(entry.getKey());
return true;
}
return false;
});

toCancel.forEach(task -> task.getResult().complete(Result.FAILED));
}
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This completes the result futures and removes tasks from tracking/queue, but it does not actually stop any already-running BiomeUpdateTask execution (so biome changes may continue after an island reset/delete). To make cancellation effective, add an explicit cancellation mechanism to BiomeUpdateTask (e.g., a volatile/atomic cancelled flag + a cancel() method) and have the biome-change loops periodically check it and abort early; cancelBiomeUpdates should then invoke task.cancel() in addition to completing the result.

Copilot uses AI. Check for mistakes.
Comment thread src/main/java/world/bentobox/biomes/web/WebManager.java
Comment thread src/main/java/world/bentobox/biomes/BiomesAddon.java Outdated
tastybento and others added 2 commits April 26, 2026 14:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tastybento
Copy link
Copy Markdown
Member Author

@copilot make a new PR to apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 26, 2026

@tastybento I've opened a new pull request, #165, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits April 26, 2026 22:47
…roneous IllegalAccessException catch

Agent-Logs-Url: https://github.com/BentoBoxWorld/Biomes/sessions/4da75578-b144-444b-ae12-5baf3478b0d1

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
…nager compile error (#165)

Three unresolved review issues from the PR thread: locale-sensitive
decimal formatting, cancellation not actually stopping in-progress biome
updates, and a compilation error from an inapplicable
`IllegalAccessException` catch.

## Changes

- **`Utils.java`** — Pin `DecimalFormat` to `Locale.ROOT` via
`DecimalFormatSymbols.getInstance(Locale.ROOT)`. Without this, servers
with e.g. a German JVM locale would format `0.5` as `0,5`.

  ```java
ThreadLocal.withInitial(() -> new DecimalFormat("0.###",
DecimalFormatSymbols.getInstance(Locale.ROOT)));
  ```

- **`BiomeUpdateTask.java`** — Add `AtomicBoolean cancelled` +
`cancel()`. Both `processBiomeChange` (between chunks) and
`runBiomeChange` (before block iteration) check the flag and abort with
`Result.FAILED`. Previously, calling `cancelBiomeUpdates` completed the
future but left the task actively mutating biomes.

- **`UpdateQueue.java`** — `cancelBiomeUpdates` now calls
`task.cancel()` on each matched task before completing its future,
making cancellation effective for in-progress tasks.

- **`WebManager.java`** — Revert the `catch (IllegalAccessException e)`
block added in a previous commit. The BentoBox GitHub API methods don't
declare that checked exception, causing a compilation failure.
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.

4 participants