From 4f683383bb03bd7dac0c3360e76a63ae4b507399 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 6 Feb 2011 20:47:39 +0000 Subject: [PATCH] Added World.Environment enum, changed createWorld to use it By: Dinnerbone --- .../src/main/java/org/bukkit/Server.java | 11 ++++++++-- paper-api/src/main/java/org/bukkit/World.java | 22 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index ff850a77e3..8bc341336d 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -89,8 +89,15 @@ public interface Server { * @return A list of worlds */ public List getWorlds(); - - public World createWorld(String name, boolean nether); + + /** + * Creates or loads a world with the given name + * + * @param name Name of the world to load + * @param environment Environment type of the world + * @return Newly created or loaded World + */ + public World createWorld(String name, World.Environment environment); /** * Reloads the server, refreshing settings and plugin information diff --git a/paper-api/src/main/java/org/bukkit/World.java b/paper-api/src/main/java/org/bukkit/World.java index 83cb2307c6..bd49cf9df4 100644 --- a/paper-api/src/main/java/org/bukkit/World.java +++ b/paper-api/src/main/java/org/bukkit/World.java @@ -258,4 +258,26 @@ public interface World { * @see setTime */ public void setFullTime(long time); + + /** + * Gets the environment type of this world + * + * @return This worlds Environment type + */ + public Environment getEnvironment(); + + /** + * Represents various map environment types that a world may be + */ + public enum Environment { + /** + * Represents the "normal"/"surface world" map + */ + NORMAL, + + /** + * Represents a nether based map + */ + NETHER + } }