Add biome requirement to island challenges (#335)#419
Merged
Conversation
2 tasks
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
e579908 to
26781ba
Compare
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
26781ba to
2e282b8
Compare
- 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
2e282b8 to
2f74680
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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
IslandRequirementsrather than a whole newChallengeType— 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 thanBiomeobjects, becauseBiomeis 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
requiredBiomesset (incopy(); empty = no restriction).wrong-biomemessage.UnifiedMultiSelectorbase, enumeratingRegistry.BIOMEwith rough per-biome icons.REQUIRED_BIOMESbutton in the island requirements menu (left-click adds, right-click clears), at slot 24.minecraft:snowy_taiga→Snowy Taiga.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