diff options
author | Erik Broes <erikbroes@grum.nl> | 2012-01-12 23:10:13 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2012-01-12 23:10:13 +0100 |
commit | 7219d4dd858b405f34ea66c67f8ab7d4c07fb4ee (patch) | |
tree | a1ca024b03aadf4b687f442b33bf713aecd511f7 /src/main/java/net/minecraft/server/WorldData.java | |
parent | dd5ef8725c699e0b2946dc0f6d523ca482404043 (diff) | |
download | craftbukkit-7219d4dd858b405f34ea66c67f8ab7d4c07fb4ee.tar craftbukkit-7219d4dd858b405f34ea66c67f8ab7d4c07fb4ee.tar.gz craftbukkit-7219d4dd858b405f34ea66c67f8ab7d4c07fb4ee.tar.lz craftbukkit-7219d4dd858b405f34ea66c67f8ab7d4c07fb4ee.tar.xz craftbukkit-7219d4dd858b405f34ea66c67f8ab7d4c07fb4ee.zip |
Updated to Minecraft 1.1
Diffstat (limited to 'src/main/java/net/minecraft/server/WorldData.java')
-rw-r--r-- | src/main/java/net/minecraft/server/WorldData.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/WorldData.java b/src/main/java/net/minecraft/server/WorldData.java index 5429aabe..4bb321f1 100644 --- a/src/main/java/net/minecraft/server/WorldData.java +++ b/src/main/java/net/minecraft/server/WorldData.java @@ -5,6 +5,7 @@ import java.util.List; public class WorldData { private long seed; + private WorldType type; private int spawnX; private int spawnY; private int spawnZ; @@ -21,10 +22,21 @@ public class WorldData { private int thunderTicks; private int gameType; private boolean useMapFeatures; - private boolean hardcore = false; + private boolean hardcore; public WorldData(NBTTagCompound nbttagcompound) { + this.type = WorldType.NORMAL; + this.hardcore = false; this.seed = nbttagcompound.getLong("RandomSeed"); + if (nbttagcompound.hasKey("generatorName")) { + String s = nbttagcompound.getString("generatorName"); + + this.type = WorldType.a(s); + if (this.type == null) { + this.type = WorldType.NORMAL; + } + } + this.gameType = nbttagcompound.getInt("GameType"); if (nbttagcompound.hasKey("MapFeatures")) { this.useMapFeatures = nbttagcompound.getBoolean("MapFeatures"); @@ -52,15 +64,21 @@ public class WorldData { } public WorldData(WorldSettings worldsettings, String s) { + this.type = WorldType.NORMAL; + this.hardcore = false; this.seed = worldsettings.a(); this.gameType = worldsettings.b(); this.useMapFeatures = worldsettings.d(); this.name = s; this.hardcore = worldsettings.c(); + this.type = worldsettings.e(); } public WorldData(WorldData worlddata) { + this.type = WorldType.NORMAL; + this.hardcore = false; this.seed = worlddata.seed; + this.type = worlddata.type; this.gameType = worlddata.gameType; this.useMapFeatures = worlddata.useMapFeatures; this.spawnX = worlddata.spawnX; @@ -107,6 +125,7 @@ public class WorldData { private void a(NBTTagCompound nbttagcompound, NBTTagCompound nbttagcompound1) { nbttagcompound.setLong("RandomSeed", this.seed); + nbttagcompound.setString("generatorName", this.type.name()); nbttagcompound.setInt("GameType", this.gameType); nbttagcompound.setBoolean("MapFeatures", this.useMapFeatures); nbttagcompound.setInt("SpawnX", this.spawnX); @@ -228,4 +247,8 @@ public class WorldData { public boolean isHardcore() { return this.hardcore; } + + public WorldType getType() { + return this.type; + } } |