From 002613da6657095a7bafcb02d3f7f7588e06f9ae Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 8 Feb 2011 11:58:28 +0000 Subject: [PATCH] Added Server.getWorld(), Server.createWorld() now checks this to avoid duplication By: Dinnerbone --- paper-api/src/main/java/org/bukkit/Server.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index 8bc341336d..c0a4ed72c0 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -91,7 +91,9 @@ public interface Server { public List getWorlds(); /** - * Creates or loads a world with the given name + * Creates or loads a world with the given name. + * If the world is already loaded, it will just return the equivalent of + * getWorld(name) * * @param name Name of the world to load * @param environment Environment type of the world @@ -99,6 +101,14 @@ public interface Server { */ public World createWorld(String name, World.Environment environment); + /** + * Gets the world with the given name + * + * @param name Name of the world to retrieve + * @return World with the given name, or null if none exists + */ + public World getWorld(String name); + /** * Reloads the server, refreshing settings and plugin information */