Skip to content

Add biome requirement to island challenges (#335)#419

Merged
tastybento merged 2 commits into
developfrom
feat/335-biome-requirement
Jul 11, 2026
Merged

Add biome requirement to island challenges (#335)#419
tastybento merged 2 commits into
developfrom
feat/335-biome-requirement

Conversation

@tastybento

Copy link
Copy Markdown
Member

Closes #335

Island challenges can now require the player to be standing in one of a set of biomes to complete, enabling exploration-style challenges (e.g. "stand in a Cherry Grove").

Design

The issue asked for this on island challenges ("Island Challenges to have an option which tracks what biome the player is currently standing in"), so it's added as an option on IslandRequirements rather than a whole new ChallengeType — much simpler, and it composes with the existing block/entity/search-radius requirements.

Biomes are stored as namespaced key strings (e.g. minecraft:plains) rather than Biome objects, because Biome is now a registry-backed type that doesn't Gson-serialise cleanly. This also makes it version-robust: an unknown biome key simply never matches, no crash, and no data migration is needed.

Changes

  • IslandRequirementsrequiredBiomes set (in copy(); empty = no restriction).
  • TryToComplete.checkSurrounding — gates on the player's current biome, with a wrong-biome message.
  • MultiBiomeSelector — paged biome picker on the existing UnifiedMultiSelector base, enumerating Registry.BIOME with rough per-biome icons.
  • EditChallengePanelREQUIRED_BIOMES button in the island requirements menu (left-click adds, right-click clears), at slot 24.
  • CommonPanel — required biomes shown in the challenge lore.
  • Utils.prettifyBiomeminecraft:snowy_taigaSnowy Taiga.
  • Locale keys for the button, selector, lore, and error.

Tests

TryToCompleteTest: succeeds in a required biome, fails (with the right message) outside it, and ignores the gate when none are set. UtilsTest: prettifyBiome. Full suite green (508 tests).

In-game check

Create an island challenge, add e.g. Plains + Forest via the new button, deploy, and verify it only completes while standing in those biomes and reports the wrong-biome message elsewhere; a challenge with no biomes set behaves exactly as before.

🤖 Generated with Claude Code

tastybento added a commit that referenced this pull request Jul 11, 2026
- S1192: extract the duplicated "click-to-add" literal into
  Constants.CLICK_TO_ADD and use it in all three spots.
- S6204: MultiBiomeSelector.getElements collects with
  toCollection(ArrayList::new) — the list must stay mutable because
  UnifiedMultiSelector's constructor sorts it in place (Stream.toList()
  would be immutable and throw at runtime).
- S7158: use StringBuilder.isEmpty() in Utils.prettifyBiome.
- S6541: split the REQUIRED_BIOMES branch out of the oversized
  createIslandRequirementButton into createBiomeRequirementButton and
  openBiomeSelector helpers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NKxodNE4h3TsSHMqDEeC8v
Island challenges can now require the player to be standing in one of a
set of biomes when they complete the challenge, so admins can build
exploration-style challenges that reward changing biomes.

- IslandRequirements: new requiredBiomes set, stored as namespaced key
  strings (e.g. "minecraft:plains") so serialization is version-robust
  (Biome is a registry-backed type now) and unknown biomes simply never
  match. Included in copy(); no adapter or migration needed.
- TryToComplete.checkSurrounding: gates completion on the player's
  current biome when requiredBiomes is set, with a wrong-biome message.
- MultiBiomeSelector: a paged biome picker built on UnifiedMultiSelector,
  enumerating Registry.BIOME with rough per-biome icons.
- EditChallengePanel: REQUIRED_BIOMES button in the island requirements
  menu (left-click to add, right-click to clear).
- CommonPanel: shows required biomes in the challenge lore.
- Utils.prettifyBiome turns "minecraft:snowy_taiga" into "Snowy Taiga".
- Locale keys + tests (TryToComplete biome gate, prettifyBiome).

Implemented as an option on island challenges (as the issue requested)
rather than a whole new challenge type, keeping it simple.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NKxodNE4h3TsSHMqDEeC8v
tastybento added a commit that referenced this pull request Jul 11, 2026
- S1192: extract the duplicated "click-to-add" literal into
  Constants.CLICK_TO_ADD and use it in all three spots.
- S6204: MultiBiomeSelector.getElements collects with
  toCollection(ArrayList::new) — the list must stay mutable because
  UnifiedMultiSelector's constructor sorts it in place (Stream.toList()
  would be immutable and throw at runtime).
- S7158: use StringBuilder.isEmpty() in Utils.prettifyBiome.
- S6541: split the REQUIRED_BIOMES branch out of the oversized
  createIslandRequirementButton into createBiomeRequirementButton and
  openBiomeSelector helpers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NKxodNE4h3TsSHMqDEeC8v
@tastybento tastybento force-pushed the feat/335-biome-requirement branch from e579908 to 26781ba Compare July 11, 2026 03:36
tastybento added a commit that referenced this pull request Jul 11, 2026
- S1192: extract the duplicated "click-to-add" literal into
  Constants.CLICK_TO_ADD and use it in all three spots.
- S6204: MultiBiomeSelector.getElements collects with
  toCollection(ArrayList::new) — the list must stay mutable because
  UnifiedMultiSelector's constructor sorts it in place (Stream.toList()
  would be immutable and throw at runtime).
- S7158: use StringBuilder.isEmpty() in Utils.prettifyBiome.
- S6541: split the REQUIRED_BIOMES branch out of the oversized
  createIslandRequirementButton into createBiomeRequirementButton and
  openBiomeSelector helpers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NKxodNE4h3TsSHMqDEeC8v
@tastybento tastybento force-pushed the feat/335-biome-requirement branch from 26781ba to 2e282b8 Compare July 11, 2026 03:51
- S1192: extract the duplicated "click-to-add" literal into
  Constants.CLICK_TO_ADD and use it in all three spots.
- S6204: MultiBiomeSelector.getElements collects with
  toCollection(ArrayList::new) — the list must stay mutable because
  UnifiedMultiSelector's constructor sorts it in place (Stream.toList()
  would be immutable and throw at runtime).
- S7158: use StringBuilder.isEmpty() in Utils.prettifyBiome.
- S6541: keep the biome button out of the already-oversized
  createIslandRequirementButton "brain method" entirely — dispatch
  REQUIRED_BIOMES straight to a self-contained createBiomeRequirementButton
  from the outer switch, leaving the island method unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NKxodNE4h3TsSHMqDEeC8v
@tastybento tastybento force-pushed the feat/335-biome-requirement branch from 2e282b8 to 2f74680 Compare July 11, 2026 03:57
@sonarqubecloud

Copy link
Copy Markdown

@tastybento tastybento merged commit fd8cab4 into develop Jul 11, 2026
3 checks passed
@tastybento tastybento deleted the feat/335-biome-requirement branch July 11, 2026 05:21
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.

Add the ability of checking which Biome the player is standing in

1 participant