Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@484d6bf [ci skip] Move some disruptive patches back
PaperMC/Paper@52619e7 [ci skip] Add more patch identifying comments
PaperMC/Paper@e660379 [ci skip] Move some disruptive patches back
PaperMC/Paper@c57d1aa Move diffs around to compile without later ones applied
PaperMC/Paper@581b101 Add world to Entity AddTo/RemoveFrom Events (#10183)
PaperMC/Paper@24dc2bf Add BlockStateMeta#clearBlockState (#10160)
PaperMC/Paper@76da4bc Expose LootTable of DecoratedPot (#10023)
PaperMC/Paper@11645e3 [ci skip] (Mostly) finish adding identifying patch comments
PaperMC/Paper@51bef80 [ci skip] Remove removed patches
PaperMC/Paper@ad2cf68 [ci skip] Move chunk system patch back a bit
PaperMC/Paper@d405ff1 [ci skip] Fixup last commit
PaperMC/Paper@a4a08b7 [ci skip] Move chunk system patch a bit back
PaperMC/Paper@b700460 Convert average tick value in the GUI to the correct granularity
PaperMC/Paper@1831240 [ci skip] Move chunk system patch back
This commit is contained in:
granny
2024-01-25 01:07:43 -08:00
parent 11391a2b82
commit 8ac38d927f
63 changed files with 422 additions and 432 deletions

View File

@@ -56,10 +56,10 @@ index 3e2d5dcd62775b6ed7c0ce0ba51a71b635b1d644..166cd0f8e72189d10e56cd7bc095409a
} catch (Exception exception) {
label25:
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 18e69effb48634dfc28061b5e0a669a8bb5ba002..1169088d9aa970e834ddfb43bf3be35ead16f96e 100644
index add9d9900908ea8ee7787f38d37d8626840d4a6b..22659bfb081a022ed0f7ffb67293e3584ba7fff4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1427,7 +1427,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1425,7 +1425,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return;
}
@@ -68,7 +68,7 @@ index 18e69effb48634dfc28061b5e0a669a8bb5ba002..1169088d9aa970e834ddfb43bf3be35e
try {
for (;;) {
boolean moreTasks = this.tickMidTickTasks();
@@ -1454,7 +1454,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1452,7 +1452,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
} finally {
@@ -77,7 +77,7 @@ index 18e69effb48634dfc28061b5e0a669a8bb5ba002..1169088d9aa970e834ddfb43bf3be35e
}
}
// Paper end - execute chunk tasks mid tick
@@ -1529,15 +1529,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1527,15 +1527,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void tickServer(BooleanSupplier shouldKeepTicking) {
@@ -96,7 +96,7 @@ index 18e69effb48634dfc28061b5e0a669a8bb5ba002..1169088d9aa970e834ddfb43bf3be35e
// Paper end
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
@@ -1574,9 +1574,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1572,9 +1572,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end - Incremental chunk and player saving
io.papermc.paper.util.CachedLists.reset(); // Paper
// Paper start - move executeAll() into full server tick timing
@@ -108,7 +108,7 @@ index 18e69effb48634dfc28061b5e0a669a8bb5ba002..1169088d9aa970e834ddfb43bf3be35e
// Paper end
// Paper start - Server Tick Events
long endTime = System.nanoTime();
@@ -1601,7 +1601,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1599,7 +1599,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.logTickTime(l - i);
this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot
@@ -117,7 +117,7 @@ index 18e69effb48634dfc28061b5e0a669a8bb5ba002..1169088d9aa970e834ddfb43bf3be35e
}
private int computeNextAutosaveInterval() {
@@ -1663,9 +1663,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1661,9 +1661,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
entityplayer.connection.suspendFlushing();
});
@@ -129,7 +129,7 @@ index 18e69effb48634dfc28061b5e0a669a8bb5ba002..1169088d9aa970e834ddfb43bf3be35e
// Paper start - Folia scheduler API
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
getAllLevels().forEach(level -> {
@@ -1682,21 +1682,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1680,21 +1680,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end - Folia scheduler API
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
this.profiler.push("commandFunctions");
@@ -156,7 +156,7 @@ index 18e69effb48634dfc28061b5e0a669a8bb5ba002..1169088d9aa970e834ddfb43bf3be35e
// Send time updates to everyone, it will get the right time from the world the player is in.
// Paper start - Perf: Optimize time updates
for (final ServerLevel level : this.getAllLevels()) {
@@ -1716,7 +1716,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1714,7 +1714,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
// Paper end - Perf: Optimize time updates
@@ -165,7 +165,7 @@ index 18e69effb48634dfc28061b5e0a669a8bb5ba002..1169088d9aa970e834ddfb43bf3be35e
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down
@@ -1742,14 +1742,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1740,14 +1740,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.push("tick");
try {
@@ -182,7 +182,7 @@ index 18e69effb48634dfc28061b5e0a669a8bb5ba002..1169088d9aa970e834ddfb43bf3be35e
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
@@ -1764,24 +1764,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1762,24 +1762,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
this.profiler.popPush("connection");
@@ -236,10 +236,10 @@ index 5a4446c09ef016e9dfb16438089a6880f7da68d8..ef08907f151c660d6c069b276f9291e6
@Override
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index b72969b3bc4319387e3946ea01c5b05acd8a87cb..18a42d8c8c038cb94e06909d96d05e0627c512a7 100644
index 28d05b46952397bb664a1c8dae71816cafee89ce..c6c4d6cf59742b555af5469eaf751ebef753e249 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -547,15 +547,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -540,15 +540,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
protected void tick(BooleanSupplier shouldKeepTicking) {
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
@@ -259,7 +259,7 @@ index b72969b3bc4319387e3946ea01c5b05acd8a87cb..18a42d8c8c038cb94e06909d96d05e06
}
gameprofilerfiller.pop();
@@ -1151,24 +1151,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1141,24 +1141,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper start - optimised tracker
private final void processTrackQueue() {
@@ -288,7 +288,7 @@ index b72969b3bc4319387e3946ea01c5b05acd8a87cb..18a42d8c8c038cb94e06909d96d05e06
}
}
// Paper end - optimised tracker
@@ -1183,7 +1183,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1173,7 +1173,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator();
@@ -297,7 +297,7 @@ index b72969b3bc4319387e3946ea01c5b05acd8a87cb..18a42d8c8c038cb94e06909d96d05e06
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
@@ -1208,17 +1208,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1198,17 +1198,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker.serverEntity.sendChanges();
}
}
@@ -319,23 +319,23 @@ index b72969b3bc4319387e3946ea01c5b05acd8a87cb..18a42d8c8c038cb94e06909d96d05e06
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index ad8e79c72841ff80f8af3580d2cdb89c13f6d688..e828f3d14af21318a716b9eba4b9bf80e377b073 100644
index 097f6eb96c2df203565a0c50aba6221e67a7e026..13ba576ad447a8bbc0712126ec86524f5bbd9a6d 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -296,10 +296,10 @@ public class ServerChunkCache extends ChunkSource {
@@ -281,10 +281,10 @@ public class ServerChunkCache extends ChunkSource {
if (!completablefuture.isDone()) { // Paper
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.pushChunkWait(this.level, x1, z1); // Paper - rewrite chunk system
// Paper end
com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x1, z1); // Paper - Add debug for sync chunk loads
com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x, z); // Paper - Add debug for sync chunk loads
- this.level.timings.syncChunkLoad.startTiming(); // Paper
+ //this.level.timings.syncChunkLoad.startTiming(); // Paper // Purpur
chunkproviderserver_b.managedBlock(completablefuture::isDone);
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.popChunkWait(); // Paper - async chunk debug // Paper - rewrite chunk system
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.popChunkWait(); // Paper - rewrite chunk system
- this.level.timings.syncChunkLoad.stopTiming(); // Paper
+ //this.level.timings.syncChunkLoad.stopTiming(); // Paper // Purpur
} // Paper
ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
return ichunkaccess1;
@@ -448,17 +448,17 @@ public class ServerChunkCache extends ChunkSource {
@@ -433,17 +433,17 @@ public class ServerChunkCache extends ChunkSource {
public void save(boolean flush) {
this.runDistanceManagerUpdates();
@@ -357,7 +357,7 @@ index ad8e79c72841ff80f8af3580d2cdb89c13f6d688..e828f3d14af21318a716b9eba4b9bf80
}
// Paper end - Incremental chunk and player saving
@@ -495,23 +495,23 @@ public class ServerChunkCache extends ChunkSource {
@@ -480,23 +480,23 @@ public class ServerChunkCache extends ChunkSource {
@Override
public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) {
this.level.getProfiler().push("purge");
@@ -387,7 +387,7 @@ index ad8e79c72841ff80f8af3580d2cdb89c13f6d688..e828f3d14af21318a716b9eba4b9bf80
this.level.getProfiler().pop();
this.clearCache();
}
@@ -527,14 +527,14 @@ public class ServerChunkCache extends ChunkSource {
@@ -512,14 +512,14 @@ public class ServerChunkCache extends ChunkSource {
gameprofilerfiller.push("pollingChunks");
gameprofilerfiller.push("filteringLoadedChunks");
// Paper - optimise chunk tick iteration
@@ -404,7 +404,7 @@ index ad8e79c72841ff80f8af3580d2cdb89c13f6d688..e828f3d14af21318a716b9eba4b9bf80
int k = this.distanceManager.getNaturalSpawnChunkCount();
// Paper start - Optional per player mob spawns
int naturalSpawnChunkCount = k;
@@ -564,7 +564,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -549,7 +549,7 @@ public class ServerChunkCache extends ChunkSource {
// Pufferfish end
}
// Paper end - Optional per player mob spawns
@@ -413,7 +413,7 @@ index ad8e79c72841ff80f8af3580d2cdb89c13f6d688..e828f3d14af21318a716b9eba4b9bf80
// this.lastSpawnState = spawnercreature_d; // Pufferfish - this is managed asynchronously
gameprofilerfiller.popPush("spawnAndTick");
@@ -673,19 +673,19 @@ public class ServerChunkCache extends ChunkSource {
@@ -658,19 +658,19 @@ public class ServerChunkCache extends ChunkSource {
}
}
// Paper end - optimise chunk tick iteration
@@ -437,7 +437,7 @@ index ad8e79c72841ff80f8af3580d2cdb89c13f6d688..e828f3d14af21318a716b9eba4b9bf80
// Paper start - optimise chunk tick iteration
if (!this.chunkMap.needsChangeBroadcasting.isEmpty()) {
it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<ChunkHolder> copy = this.chunkMap.needsChangeBroadcasting.clone();
@@ -699,7 +699,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -684,7 +684,7 @@ public class ServerChunkCache extends ChunkSource {
}
}
// Paper end - optimise chunk tick iteration
@@ -447,7 +447,7 @@ index ad8e79c72841ff80f8af3580d2cdb89c13f6d688..e828f3d14af21318a716b9eba4b9bf80
gameprofilerfiller.pop();
gameprofilerfiller.pop();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 979448b2260484375c70cb83d65be25914a2ab76..11a457103c59d230617e404b5523691ea493da96 100644
index 009d077f979d5ae85b359f3829038015af347429..b4b256721b7a5d25deec717123501a163fcfd8fe 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -866,7 +866,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -521,7 +521,7 @@ index 979448b2260484375c70cb83d65be25914a2ab76..11a457103c59d230617e404b5523691e
this.tickBlockEntities();
}
@@ -1099,7 +1099,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} // Paper
} // Paper - Option to disable ice and snow
gameprofilerfiller.popPush("tickBlocks");
- timings.chunkTicksBlocks.startTiming(); // Paper
@@ -630,7 +630,7 @@ index 979448b2260484375c70cb83d65be25914a2ab76..11a457103c59d230617e404b5523691e
} else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 962dd813a9422ae14f7a149c605c7df4fee61f91..ecd94a7927da0f7a048c6628a9edb01d39ee2ba7 100644
index 7ac11a52e88248de227ab7b85260be9ed5654739..de61e915475a1b3b6faba16673ac1f271527a1b4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2442,7 +2442,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -661,10 +661,10 @@ index 962dd813a9422ae14f7a149c605c7df4fee61f91..ecd94a7927da0f7a048c6628a9edb01d
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 10723caec1b099596607d23c8a32691765803181..061bdd934f31c9e1d9a37f7831eb1f19d0e46805 100644
index d1afad129159d5ce7cf9530a7dfb6ed5b4fa25f3..b230739cf929c8f2b51a812fffe54be343ce3e05 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1274,7 +1274,7 @@ public abstract class PlayerList {
@@ -1273,7 +1273,7 @@ public abstract class PlayerList {
public void saveAll(int interval) {
io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
@@ -673,7 +673,7 @@ index 10723caec1b099596607d23c8a32691765803181..061bdd934f31c9e1d9a37f7831eb1f19
int numSaved = 0;
long now = MinecraftServer.currentTick;
for (int i = 0; i < this.players.size(); ++i) {
@@ -1285,7 +1285,7 @@ public abstract class PlayerList {
@@ -1284,7 +1284,7 @@ public abstract class PlayerList {
}
// Paper end - Incremental chunk and player saving
}
@@ -732,7 +732,7 @@ index fcdb9bde8e1605e30dde3e580491522d4b62cdc0..7094701d213c73ba47ace806962244c1
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index cf9b76f596409803904f53b8d8fb90888d5fcb95..061a546ff8421d16fa37cf2337cded4bdfc943f3 100644
index af6def325c97b5a71a671a401d02c1f43b8acd96..ef8b596a02970c514fc6e5e0fb7ded76d82240ac 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1317,15 +1317,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -764,7 +764,7 @@ index cf9b76f596409803904f53b8d8fb90888d5fcb95..061a546ff8421d16fa37cf2337cded4b
co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
gameprofilerfiller.pop();
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 00b965de947cb13a178061278d1ffa4342e8e065..f2f778d876703c06e0d1bfd7a35adde35abe4939 100644
index 96fc603c2fccc1d9610248b2116d35696bc65e4e..3d99667fa297ea15c5d3a0526a846ce177a5037a 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -133,7 +133,7 @@ public final class NaturalSpawner {
@@ -786,7 +786,7 @@ index 00b965de947cb13a178061278d1ffa4342e8e065..f2f778d876703c06e0d1bfd7a35adde3
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index c3fb622845770bcee9ddd6ebbeee174b06ee16eb..134d2d56af71aceb1ca33d7bb708124655c5d319 100644
index 5fab6909bd2ee303f49b7e667617bcae608e82d7..8c0df10efd59594c63cca2a1c22386acf17e5299 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -799,7 +799,7 @@ public class LevelChunk extends ChunkAccess {
@@ -817,7 +817,7 @@ index c3fb622845770bcee9ddd6ebbeee174b06ee16eb..134d2d56af71aceb1ca33d7bb7081246
if (this.blockEntity.getType().isValid(iblockdata)) {
@@ -1199,7 +1199,7 @@ public class LevelChunk extends ChunkAccess {
// Paper end
// Paper end - Prevent block entity and entity crashes
// Spigot start
} finally {
- this.blockEntity.tickTimer.stopTiming();
@@ -903,7 +903,7 @@ index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..d3ec817e95628f1fc8be4a29c9a0f13c
// Paper end - add timings for scoreboard search
}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 1085d90f6db968760a52f9d00a25299618264c5f..9113c8ebff5e71f859a19f024969582052c57546 100644
index f9e3f4e15719ed9284ec315b8a1ef63dc242e009..2e9aed328e576abbe216fdb2071c13421e6645b8 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -170,7 +170,7 @@ public class ActivationRange
@@ -915,7 +915,7 @@ index 1085d90f6db968760a52f9d00a25299618264c5f..9113c8ebff5e71f859a19f0249695820
final int miscActivationRange = world.spigotConfig.miscActivationRange;
final int raiderActivationRange = world.spigotConfig.raiderActivationRange;
final int animalActivationRange = world.spigotConfig.animalActivationRange;
@@ -250,7 +250,7 @@ public class ActivationRange
@@ -249,7 +249,7 @@ public class ActivationRange
}
// Paper end
}