summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorRigby <rigby@onarandombox.com>2011-07-27 00:24:27 +0100
committerEvilSeph <evilseph@gmail.com>2011-08-05 15:52:38 -0400
commit4117d6b65e22adbb0221113b089d6d6528fa33f2 (patch)
treef3b037414a28e723e65d27a76ae0063ea60ea799 /src/main/java/net
parent6ae23e3f033e8dcbf49d4d7067062d322a9a3c7f (diff)
downloadcraftbukkit-4117d6b65e22adbb0221113b089d6d6528fa33f2.tar
craftbukkit-4117d6b65e22adbb0221113b089d6d6528fa33f2.tar.gz
craftbukkit-4117d6b65e22adbb0221113b089d6d6528fa33f2.tar.lz
craftbukkit-4117d6b65e22adbb0221113b089d6d6528fa33f2.tar.xz
craftbukkit-4117d6b65e22adbb0221113b089d6d6528fa33f2.zip
Implemented per world setting to keep the spawn in memory or not.
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/ChunkProviderServer.java2
-rw-r--r--src/main/java/net/minecraft/server/MinecraftServer.java7
-rw-r--r--src/main/java/net/minecraft/server/World.java1
3 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 0fa2b619..0b232fd1 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -49,7 +49,7 @@ public class ChunkProviderServer implements IChunkProvider {
int l = j * 16 + 8 - chunkcoordinates.z;
short short1 = 128;
- if (k < -short1 || k > short1 || l < -short1 || l > short1) {
+ if (k < -short1 || k > short1 || l < -short1 || l > short1 || !(this.world.keepSpawnInMemory)) { // CraftBukkit - added 'this.world.keepSpawnInMemory'
this.unloadQueue.add(i, j); // CraftBukkit
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ee8dee66..a5d9d05c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -232,8 +232,9 @@ public class MinecraftServer implements Runnable, ICommandListener {
// CraftBukkit start
for (int l = 0; l < this.worlds.size(); ++l) {
// if (l == 0 || this.propertyManager.getBoolean("allow-nether", true)) {
- WorldServer worldserver = this.worlds.get(l);
- log.info("Preparing start region for level " + l + " (Seed: " + worldserver.getSeed() + ")");
+ WorldServer worldserver = this.worlds.get(l);
+ log.info("Preparing start region for level " + l + " (Seed: " + worldserver.getSeed() + ")");
+ if (worldserver.getWorld().getKeepSpawnInMemory()) {
// CraftBukkit end
ChunkCoordinates chunkcoordinates = worldserver.getSpawn();
@@ -260,7 +261,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
}
}
}
- // } // CraftBukkit
+ } // CraftBukkit
}
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index aacbef13..63ea1588 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -83,6 +83,7 @@ public class World implements IBlockAccess {
// CraftBukkit start
private final CraftWorld world;
public boolean pvpMode;
+ public boolean keepSpawnInMemory = true;
public ChunkGenerator generator;
Chunk lastChunkAccessed;
int lastXAccessed = Integer.MIN_VALUE;