Add API to locate structures

By: Senmori <thesenmori@gmail.com>
This commit is contained in:
Bukkit/Spigot
2018-09-21 08:49:55 -04:00
parent 253605061c
commit f2aaef5c07
2 changed files with 236 additions and 0 deletions

View File

@@ -1522,6 +1522,20 @@ public interface World extends PluginMessageRecipient, Metadatable {
*/
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force);
/**
* Find the closest nearby structure of a given {@link StructureType}.
* Finding unexplored structures can, and will, block if the world is
* looking in chunks that gave not generated yet. This can lead to the world
* temporarily freezing while locating an unexplored structure.
*
* @param origin where to start looking for a structure
* @param structureType the type of structure to find
* @param radius the radius, in chunks, around with to search
* @param findUnexplored true to only find unexplored structures
* @return the closest {@link Location}, or null if no structure of the
* specified type exists.
*/
public Location locateNearestStructure(Location origin, StructureType structureType, int radius, boolean findUnexplored);
/**
* Represents various map environment types that a world may be