diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-06 20:50:57 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-07 01:51:06 +0000 |
commit | 8b14c72a8d3537aae52aac69693489a1e9fe5559 (patch) | |
tree | f26d4c087eb8d593a304d1cb9628bd6e64b3e7e3 /src/main/java/org/bukkit | |
parent | 4e6f4e303129951e6aa6dbf4240c46c6fce19c98 (diff) | |
download | craftbukkit-8b14c72a8d3537aae52aac69693489a1e9fe5559.tar craftbukkit-8b14c72a8d3537aae52aac69693489a1e9fe5559.tar.gz craftbukkit-8b14c72a8d3537aae52aac69693489a1e9fe5559.tar.lz craftbukkit-8b14c72a8d3537aae52aac69693489a1e9fe5559.tar.xz craftbukkit-8b14c72a8d3537aae52aac69693489a1e9fe5559.zip |
Changes to reflect new Environment enum
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftServer.java | 4 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 4bc77407..c84c5da0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -192,14 +192,14 @@ public final class CraftServer implements Server { return "CraftServer{" + "serverName=" + serverName + "serverVersion=" + serverVersion + "protocolVersion=" + protocolVersion + '}'; } - public World createWorld(String name, boolean nether) { + public World createWorld(String name, World.Environment environment) { File folder = new File(name); if ((folder.exists()) && (!folder.isDirectory())) { throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder"); } - WorldServer internal = new WorldServer(console, new File("."), name, nether ? -1 : 0); + WorldServer internal = new WorldServer(console, new File("."), name, environment == World.Environment.NETHER ? -1 : 0); internal.a(new WorldManager(console, internal)); internal.k = 1; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 6f4e49bc..3ff5c7d6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -24,11 +24,18 @@ import org.bukkit.World; public class CraftWorld implements World { private final WorldServer world; + private final Environment environment; private static final Random rand = new Random(); public CraftWorld(WorldServer world) { this.world = world; + + if (world.q instanceof WorldProviderHell) { + environment = Environment.NETHER; + } else { + environment = Environment.NORMAL; + } } public Block getBlockAt(int x, int y, int z) { @@ -212,6 +219,10 @@ public class CraftWorld implements World { world.e = time; } + public Environment getEnvironment() { + return environment; + } + private final class ChunkCoordinate { public final int x; public final int z; |