summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Primm <mike@primmhome.com>2012-03-08 00:58:30 -0600
committerEvilSeph <evilseph@gmail.com>2012-03-08 16:27:01 -0500
commit1e06e150b6721212cb3facd282f7a4e85f311bdd (patch)
tree57a4bc42536fb3cd2896dacdff6cda1f2243fc74 /src
parent0ba2d285f04238572f51dee3fd33dc6d08b7f8f0 (diff)
downloadcraftbukkit-1e06e150b6721212cb3facd282f7a4e85f311bdd.tar
craftbukkit-1e06e150b6721212cb3facd282f7a4e85f311bdd.tar.gz
craftbukkit-1e06e150b6721212cb3facd282f7a4e85f311bdd.tar.lz
craftbukkit-1e06e150b6721212cb3facd282f7a4e85f311bdd.tar.xz
craftbukkit-1e06e150b6721212cb3facd282f7a4e85f311bdd.zip
[Bleeding] Only do unload-all on tick when last player leaves. Fixes BUKKIT-1060
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/PlayerManager.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerManager.java b/src/main/java/net/minecraft/server/PlayerManager.java
index a03d4dca..aaadfefb 100644
--- a/src/main/java/net/minecraft/server/PlayerManager.java
+++ b/src/main/java/net/minecraft/server/PlayerManager.java
@@ -12,6 +12,7 @@ public class PlayerManager {
private int e;
private int f;
private final int[][] g = new int[][] { { 1, 0}, { 0, 1}, { -1, 0}, { 0, -1}};
+ private boolean wasNotEmpty; // CraftBukkit
public PlayerManager(MinecraftServer minecraftserver, int i, int j) {
if (j > 15) {
@@ -36,13 +37,19 @@ public class PlayerManager {
this.c.clear();
if (this.managedPlayers.isEmpty()) {
+ if (!wasNotEmpty) return; // CraftBukkit - only do unload when we go from non-empty to empty
WorldServer worldserver = this.server.getWorldServer(this.e);
WorldProvider worldprovider = worldserver.worldProvider;
if (!worldprovider.c()) {
worldserver.chunkProviderServer.c();
}
+ // CraftBukkit start
+ wasNotEmpty = false;
+ } else {
+ wasNotEmpty = true;
}
+ // CraftBukkit end
}
private PlayerInstance a(int i, int j, boolean flag) {