Updated Upstream (Bukkit/CraftBukkit/Spigot)
Developers!: You will need to clean up your work/Minecraft/1.13.2 folder for this Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: b850a822 SPIGOT-4526: Add conversion time API for Zombie & subclasses CraftBukkit Changes: 38cf676e SPIGOT-4534: CreatureSpawnEvent not being called for CHUNK_GEN b446cb5d SPIGOT-4527: Fix sponges with waterlogged blocks 6ec8ea5c SPIGOT-4526: Add conversion time API for Zombie & subclasses c64fe508 Mappings Update a3c2ec03 Fix missing ServerListPingEvent call for legacy pings Spigot Changes: 1dc156ce Rebuild patches 140f654d Mappings Update
This commit is contained in:
@@ -43,7 +43,7 @@ index 42d951554..d8f258105 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index d065d88f7..2a9bfd7af 100644
|
||||
index f470eba29..86bdd6e7f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
@@ -55,7 +55,7 @@ index d065d88f7..2a9bfd7af 100644
|
||||
public final int locZ;
|
||||
private boolean l;
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java
|
||||
index 2ebb2d834..e14ae2b42 100644
|
||||
index 8b3738c8f..2021c0d02 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkMap.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
|
||||
@@ -67,7 +67,7 @@ index 2ebb2d834..e14ae2b42 100644
|
||||
+ if (chunk.world.paperConfig.delayChunkUnloadsBy > 0) {
|
||||
+ chunk.scheduledForUnload = System.currentTimeMillis();
|
||||
+ } else {
|
||||
+ ((WorldServer) chunk.world).getChunkProviderServer().unload(chunk);
|
||||
+ ((WorldServer) chunk.world).getChunkProvider().unload(chunk);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
@@ -99,17 +99,17 @@ index 1d08ec37f..516a583a8 100644
|
||||
this.chunkScheduler.a(booleansupplier);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
index c7ea17e25..7cb1327a8 100644
|
||||
index 1d672eaa1..5497a458d 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunk {
|
||||
public void run() {
|
||||
loadInProgress = false;
|
||||
PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(location.x, location.z, true, true);
|
||||
+ markChunkUsed(); // Paper - delay chunk unloads
|
||||
}
|
||||
};
|
||||
+ // Paper start - delay chunk unloads
|
||||
ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider();
|
||||
chunkproviderserver.a(ix, j);
|
||||
this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false);
|
||||
+ markChunkUsed(); // Paper - delay chunk unloads
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ private void markChunkUsed() {
|
||||
+ if (chunk == null) {
|
||||
+ return;
|
||||
@@ -122,30 +122,23 @@ index c7ea17e25..7cb1327a8 100644
|
||||
+ }
|
||||
+ private boolean chunkHasPlayers = false;
|
||||
+ // Paper end
|
||||
// CraftBukkit end
|
||||
|
||||
public PlayerChunk(PlayerChunkMap playerchunkmap, int i, int j) {
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunk {
|
||||
|
||||
chunkproviderserver.a(i, j);
|
||||
this.chunk = chunkproviderserver.getChunkAt(i, j, true, false);
|
||||
+ markChunkUsed(); // Paper - delay chunk unloads
|
||||
}
|
||||
|
||||
+
|
||||
public ChunkCoordIntPair a() {
|
||||
return this.location;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunk {
|
||||
} else {
|
||||
if (this.c.isEmpty()) {
|
||||
if (this.players.isEmpty()) {
|
||||
this.i = this.playerChunkMap.getWorld().getTime();
|
||||
+ chunkHasPlayers = true; // Paper - delay chunk unloads
|
||||
+ markChunkUsed(); // Paper - delay chunk unloads
|
||||
}
|
||||
|
||||
this.c.add(entityplayer);
|
||||
this.players.add(entityplayer);
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunk {
|
||||
|
||||
this.c.remove(entityplayer);
|
||||
if (this.c.isEmpty()) {
|
||||
this.players.remove(entityplayer);
|
||||
if (this.players.isEmpty()) {
|
||||
+ chunkHasPlayers = false; // Paper - delay chunk unloads
|
||||
+ markChunkUsed(); // Paper - delay chunk unloads
|
||||
this.playerChunkMap.b(this);
|
||||
@@ -154,23 +147,23 @@ index c7ea17e25..7cb1327a8 100644
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunk {
|
||||
return true;
|
||||
} else {
|
||||
this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z, true, flag);
|
||||
this.chunk = this.playerChunkMap.getWorld().getChunkProvider().getChunkAt(this.location.x, this.location.z, true, flag);
|
||||
+ markChunkUsed(); // Paper - delay chunk unloads
|
||||
return this.chunk != null;
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index b8d8fc779..e5605c309 100644
|
||||
index 3d17ad646..c3ac66d35 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap {
|
||||
Chunk chunk = playerchunk.f();
|
||||
|
||||
if (chunk != null) {
|
||||
- this.getWorld().getChunkProviderServer().unload(chunk);
|
||||
- this.getWorld().getChunkProvider().unload(chunk);
|
||||
+ // Paper start - delay chunk unloads
|
||||
+ if (world.paperConfig.delayChunkUnloadsBy <= 0) {
|
||||
+ this.getWorld().getChunkProviderServer().unload(chunk);
|
||||
+ this.getWorld().getChunkProvider().unload(chunk);
|
||||
+ } else {
|
||||
+ chunk.scheduledForUnload = System.currentTimeMillis();
|
||||
+ }
|
||||
@@ -179,7 +172,7 @@ index b8d8fc779..e5605c309 100644
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 49432f2eb..288152775 100644
|
||||
index 5d7370029..6f672aa22 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
@@ -198,11 +191,11 @@ index 49432f2eb..288152775 100644
|
||||
this.methodProfiler.a(() -> {
|
||||
return String.valueOf(TileEntityTypes.a(tileentity.C()));
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 24e504c27..f0e974dff 100644
|
||||
index b19eef1b1..f1320f5ac 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
ChunkProviderServer cps = world.getChunkProviderServer();
|
||||
ChunkProviderServer cps = world.getChunkProvider();
|
||||
for (net.minecraft.server.Chunk chunk : cps.chunks.values()) {
|
||||
// If in use, skip it
|
||||
- if (isChunkInUse(chunk.locX, chunk.locZ)) {
|
||||
|
||||
Reference in New Issue
Block a user