summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTahg <tahgtahv@gmail.com>2011-06-03 18:35:05 -0400
committerTahg <tahgtahv@gmail.com>2011-06-03 18:36:14 -0400
commit5f684ef163947946a76e0ec60a5da7a25c3ed2a8 (patch)
treeb843ff7d904ca3fab2bc0e53c3bb9513f6a7855f /src
parentebc478388cdde64dd5a4697f0ef8d7e36e1ec61c (diff)
downloadcraftbukkit-5f684ef163947946a76e0ec60a5da7a25c3ed2a8.tar
craftbukkit-5f684ef163947946a76e0ec60a5da7a25c3ed2a8.tar.gz
craftbukkit-5f684ef163947946a76e0ec60a5da7a25c3ed2a8.tar.lz
craftbukkit-5f684ef163947946a76e0ec60a5da7a25c3ed2a8.tar.xz
craftbukkit-5f684ef163947946a76e0ec60a5da7a25c3ed2a8.zip
fixed environments
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/World.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftWorld.java17
2 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 9f698e23..a5f954b2 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -47,7 +47,7 @@ public class World implements IBlockAccess {
public int spawnMonsters;
public Random random = new Random();
public boolean s = false;
- public final WorldProvider worldProvider;
+ public WorldProvider worldProvider; // Craftbukkit - remove final
protected List u = new ArrayList();
public IChunkProvider chunkProvider; // CraftBukkit - protected -> public
protected final IDataManager w;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 2b38b2bb..a942e743 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -26,7 +26,7 @@ import org.bukkit.World;
public class CraftWorld implements World {
private final WorldServer world;
- private final Environment environment;
+ private Environment environment;
private final CraftServer server;
private final ChunkProviderServer provider;
private HashMap<Integer,CraftChunk> unloadedChunks = new HashMap<Integer, CraftChunk>();
@@ -37,12 +37,8 @@ public class CraftWorld implements World {
this.world = world;
this.server = world.getServer();
this.provider = world.chunkProviderServer;
-
- if (world.worldProvider instanceof WorldProviderHell) {
- environment = Environment.NETHER;
- } else {
- environment = Environment.NORMAL;
- }
+
+ environment = Environment.getEnvironment(world.worldProvider.dimension);
server.addWorld(this);
}
@@ -443,6 +439,13 @@ public class CraftWorld implements World {
public Environment getEnvironment() {
return environment;
}
+
+ public void setEnvironment(Environment env) {
+ if (environment != env) {
+ environment = env;
+ world.worldProvider = WorldProvider.a(environment.getId());
+ }
+ }
public Block getBlockAt(Location location) {
return getBlockAt(location.getBlockX(), location.getBlockY(), location.getBlockZ());