PolyhedralDev / Terra

Voxel world generation modding platform
MIT License
671 stars 88 forks source link

[Feature] Method to locate nearest biome #456

Open Browsit opened 7 months ago

Browsit commented 7 months ago

Feature Description

An API method to locate the nearest Terra biome.

What Problem Does This Solve?

Currently, it is possible to locate Terra biomes in-game via a command with the syntax of /locate biome terra:packname/packname/biomename but there is no API equivalent of this. The closest is Bukkit's World#locateNearestBiome which, of course, does not accept a com.dfsek.terra.api.world.biome.Biome (and doesn't seem to work with org.bukkit.block.Biome on Terra worlds either, even if acquired through a BiomeProvider).

A Solution You'd Like

A method of similar functionality to locateNearestBiome but which accepts com.dfsek.terra.api.world.biome.Biome instead.

Alternative Solutions (that don't work)

  1. Bukkit's method but with a Biome acquired through ChunkGenerator -> BiomeProvider (simply using World#getBiome would return Biome.CUSTOM). Tested on Paper 1.20.4.

Additonal Context

We're looking to perform actions programmatically based on the result; the /locate command is insufficient.