Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
SPIGOT-5225: World handle isn't closed if world is unloaded without saving
Dieser Commit ist enthalten in:
Ursprung
104b3831f8
Commit
da62a66ab7
@ -50,7 +50,21 @@
|
||||
}
|
||||
|
||||
public boolean isLoaded(int i, int j) {
|
||||
@@ -294,6 +302,18 @@
|
||||
@@ -289,11 +297,31 @@
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
- this.save(true);
|
||||
+ // CraftBukkit start
|
||||
+ close(true);
|
||||
+ }
|
||||
+
|
||||
+ public void close(boolean save) throws IOException {
|
||||
+ if (save) {
|
||||
+ this.save(true);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.lightEngine.close();
|
||||
this.playerChunkMap.close();
|
||||
}
|
||||
|
||||
@ -69,7 +83,7 @@
|
||||
public void tick(BooleanSupplier booleansupplier) {
|
||||
this.world.getMethodProfiler().enter("purge");
|
||||
this.chunkMapDistance.purgeTickets();
|
||||
@@ -313,13 +333,13 @@
|
||||
@@ -313,13 +341,13 @@
|
||||
this.lastTickTime = i;
|
||||
WorldData worlddata = this.world.getWorldData();
|
||||
boolean flag = worlddata.getType() == WorldType.DEBUG_ALL_BLOCK_STATES;
|
||||
@ -85,7 +99,7 @@
|
||||
|
||||
this.world.getMethodProfiler().enter("naturalSpawnCount");
|
||||
int l = this.chunkMapDistance.b();
|
||||
@@ -348,8 +368,30 @@
|
||||
@@ -348,8 +376,30 @@
|
||||
for (int j1 = 0; j1 < i1; ++j1) {
|
||||
EnumCreatureType enumcreaturetype = aenumcreaturetype1[j1];
|
||||
|
||||
@ -117,7 +131,7 @@
|
||||
|
||||
if (object2intmap.getInt(enumcreaturetype) <= k1) {
|
||||
SpawnerCreature.a(enumcreaturetype, (World) this.world, chunk, blockposition);
|
||||
@@ -497,12 +539,18 @@
|
||||
@@ -497,12 +547,18 @@
|
||||
|
||||
@Override
|
||||
protected boolean executeNext() {
|
||||
|
@ -981,14 +981,15 @@ public final class CraftServer implements Server {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (save) {
|
||||
try {
|
||||
if (save) {
|
||||
handle.save(null, true, true);
|
||||
handle.close();
|
||||
}
|
||||
|
||||
handle.getChunkProvider().close(save);
|
||||
} catch (Exception ex) {
|
||||
getLogger().log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
worlds.remove(world.getName().toLowerCase(java.util.Locale.ENGLISH));
|
||||
console.worldServer.remove(handle.getWorldProvider().getDimensionManager());
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren