Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
[Bleeding] Only do unload-all on tick when last player leaves. Fixes BUKKIT-1060
Dieser Commit ist enthalten in:
Ursprung
0ba2d285f0
Commit
1e06e150b6
@ -12,6 +12,7 @@ public class PlayerManager {
|
|||||||
private int e;
|
private int e;
|
||||||
private int f;
|
private int f;
|
||||||
private final int[][] g = new int[][] { { 1, 0}, { 0, 1}, { -1, 0}, { 0, -1}};
|
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) {
|
public PlayerManager(MinecraftServer minecraftserver, int i, int j) {
|
||||||
if (j > 15) {
|
if (j > 15) {
|
||||||
@ -36,13 +37,19 @@ public class PlayerManager {
|
|||||||
|
|
||||||
this.c.clear();
|
this.c.clear();
|
||||||
if (this.managedPlayers.isEmpty()) {
|
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);
|
WorldServer worldserver = this.server.getWorldServer(this.e);
|
||||||
WorldProvider worldprovider = worldserver.worldProvider;
|
WorldProvider worldprovider = worldserver.worldProvider;
|
||||||
|
|
||||||
if (!worldprovider.c()) {
|
if (!worldprovider.c()) {
|
||||||
worldserver.chunkProviderServer.c();
|
worldserver.chunkProviderServer.c();
|
||||||
}
|
}
|
||||||
|
// CraftBukkit start
|
||||||
|
wasNotEmpty = false;
|
||||||
|
} else {
|
||||||
|
wasNotEmpty = true;
|
||||||
}
|
}
|
||||||
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
private PlayerInstance a(int i, int j, boolean flag) {
|
private PlayerInstance a(int i, int j, boolean flag) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren