Skip to content

feat(world): add find_nearest_biome for /locate biome#2530

Draft
ezraclintoc wants to merge 1 commit into
Pumpkin-MC:masterfrom
ezraclintoc:feat/locate-biome
Draft

feat(world): add find_nearest_biome for /locate biome#2530
ezraclintoc wants to merge 1 commit into
Pumpkin-MC:masterfrom
ezraclintoc:feat/locate-biome

Conversation

@ezraclintoc

Copy link
Copy Markdown

Ports vanilla's BiomeSource biome search as a ring-by-ring spiral (nearest-ring-first) with a vertical scan for 3D/cave biomes. Command wiring and the noise-sampler accessor follow separately.

Description

Implements /locate biome <biome>, closing #2230 (biome subcommand only).

Minecraft biomes are 3D (since 1.18), so this locates the nearest block whose sampled biome matches the requested one, scanning both horizontally and vertically. Only checks every 32 blocks horizontally and every 64 blocks vertically.

Testing

  • Unit test for find_nearest_biome: fixed seed + Dimension::OVERWORLD, asserts a
    known biome resolves to the expected coordinates.
  • Manual: /locate biome minecraft:desert and a cave biome (e.g.
    minecraft:lush_caves) in a fresh world; verified returned coords land in the
    target biome via /tp + F3.

Please follow our Coding Guidelines

Ports vanilla's BiomeSource biome search as a ring-by-ring spiral
(nearest-ring-first) with a vertical scan for 3D/cave biomes.
Command wiring and the noise-sampler accessor follow separately.
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.

1 participant