diff options
author | Ugleh <troti@ymail.com> | 2018-09-24 19:31:16 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-09-24 19:35:03 +1000 |
commit | b9620fd935d0e576a919297e394580a5c3fe4ae8 (patch) | |
tree | 8715e9a20058c277a6e47511c411a2a5ba19f3b7 | |
parent | 2556802ab5a4d3f3018b1f7be85c5768710f64a2 (diff) | |
download | bukkit-b9620fd935d0e576a919297e394580a5c3fe4ae8.tar bukkit-b9620fd935d0e576a919297e394580a5c3fe4ae8.tar.gz bukkit-b9620fd935d0e576a919297e394580a5c3fe4ae8.tar.lz bukkit-b9620fd935d0e576a919297e394580a5c3fe4ae8.tar.xz bukkit-b9620fd935d0e576a919297e394580a5c3fe4ae8.zip |
API to generate filled explorer maps
-rw-r--r-- | src/main/java/org/bukkit/Bukkit.java | 41 | ||||
-rw-r--r-- | src/main/java/org/bukkit/Server.java | 37 |
2 files changed, 78 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index 5bea055b..5a4654fd 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -531,6 +531,47 @@ public final class Bukkit { } /** + * Create a new explorer map targeting the closest nearby structure of a + * given {@link StructureType}. + * <br> + * This method uses implementation default values for radius and + * findUnexplored (usually 100, true). + * + * @param world the world the map will belong to + * @param location the origin location to find the nearest structure + * @param structureType the type of structure to find + * @return a newly created item stack + * + * @see World#locateNearestStructure(org.bukkit.Location, + * org.bukkit.StructureType, int, boolean) + */ + public static ItemStack createExplorerMap(World world, Location location, StructureType structureType) { + return server.createExplorerMap(world, location, structureType); + } + + /** + * Create a new explorer map targeting the closest nearby structure of a + * given {@link StructureType}. + * <br> + * This method uses implementation default values for radius and + * findUnexplored (usually 100, true). + * + * @param world the world the map will belong to + * @param location the origin location to find the nearest structure + * @param structureType the type of structure to find + * @param radius radius to search, see World#locateNearestStructure for more + * information + * @param findUnexplored whether to find unexplored structures + * @return the newly created item stack + * + * @see World#locateNearestStructure(org.bukkit.Location, + * org.bukkit.StructureType, int, boolean) + */ + public static ItemStack createExplorerMap(World world, Location location, StructureType structureType, int radius, boolean findUnexplored) { + return server.createExplorerMap(world, location, structureType, radius, findUnexplored); + } + + /** * Reloads the server, refreshing settings and plugin information. */ public static void reload() { diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index c3535e90..21ed6aeb 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -439,6 +439,43 @@ public interface Server extends PluginMessageRecipient { public MapView createMap(World world); /** + * Create a new explorer map targeting the closest nearby structure of a + * given {@link StructureType}. + * <br> + * This method uses implementation default values for radius and + * findUnexplored (usually 100, true). + * + * @param world the world the map will belong to + * @param location the origin location to find the nearest structure + * @param structureType the type of structure to find + * @return a newly created item stack + * + * @see World#locateNearestStructure(org.bukkit.Location, + * org.bukkit.StructureType, int, boolean) + */ + public ItemStack createExplorerMap(World world, Location location, StructureType structureType); + + /** + * Create a new explorer map targeting the closest nearby structure of a + * given {@link StructureType}. + * <br> + * This method uses implementation default values for radius and + * findUnexplored (usually 100, true). + * + * @param world the world the map will belong to + * @param location the origin location to find the nearest structure + * @param structureType the type of structure to find + * @param radius radius to search, see World#locateNearestStructure for more + * information + * @param findUnexplored whether to find unexplored structures + * @return the newly created item stack + * + * @see World#locateNearestStructure(org.bukkit.Location, + * org.bukkit.StructureType, int, boolean) + */ + public ItemStack createExplorerMap(World world, Location location, StructureType structureType, int radius, boolean findUnexplored); + + /** * Reloads the server, refreshing settings and plugin information. */ public void reload(); |