Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@b45d9b6 Fix summon_entity effect attempting to add incorrect entity (#11004)
PaperMC/Paper@7eec21e [ci skip] add adventure-key javadoc (#11014)
PaperMC/Paper@8c8b227 Execute chunk tasks mid-tick
This commit is contained in:
granny
2024-07-04 02:47:07 -07:00
parent faa1f93b6f
commit 1ab7990b14
25 changed files with 138 additions and 157 deletions

View File

@@ -42,10 +42,10 @@ index d0d36a57ec4896bcb74970f8fb24d8f3e17db133..0c8fe5b2500480c3a9e9ab3285ad22e0
} catch (Exception exception) {
if (exception instanceof ReportedException) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 1de97c47735190be65c220289bcb320d7be7e2ba..6753ea878a19a8cb883db783664929a8927799ac 100644
index 3318f2f5858b453ad7a9e4eee908dc128e08faa7..5702660ef5769ab44278f30eafb517acdd358be9 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1546,15 +1546,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1609,15 +1609,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void tickServer(BooleanSupplier shouldKeepTicking) {
@@ -64,7 +64,7 @@ index 1de97c47735190be65c220289bcb320d7be7e2ba..6753ea878a19a8cb883db783664929a8
// Paper end
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
@@ -1579,9 +1579,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1642,9 +1642,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
io.papermc.paper.util.CachedLists.reset(); // Paper
// Paper start - move executeAll() into full server tick timing
@@ -76,7 +76,7 @@ index 1de97c47735190be65c220289bcb320d7be7e2ba..6753ea878a19a8cb883db783664929a8
// Paper end
// Paper start - Server Tick Events
long endTime = System.nanoTime();
@@ -1604,7 +1604,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1667,7 +1667,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.logTickMethodTime(i);
this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot
@@ -85,7 +85,7 @@ index 1de97c47735190be65c220289bcb320d7be7e2ba..6753ea878a19a8cb883db783664929a8
}
private void logTickMethodTime(long tickStartTime) {
@@ -1675,9 +1675,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1738,9 +1738,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
entityplayer.connection.suspendFlushing();
});
@@ -97,7 +97,7 @@ index 1de97c47735190be65c220289bcb320d7be7e2ba..6753ea878a19a8cb883db783664929a8
// Paper start - Folia scheduler API
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
getAllLevels().forEach(level -> {
@@ -1694,21 +1694,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1757,21 +1757,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");
@@ -124,7 +124,7 @@ index 1de97c47735190be65c220289bcb320d7be7e2ba..6753ea878a19a8cb883db783664929a8
// 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()) {
@@ -1728,7 +1728,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1791,7 +1791,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
// Paper end - Perf: Optimize time updates
@@ -133,7 +133,7 @@ index 1de97c47735190be65c220289bcb320d7be7e2ba..6753ea878a19a8cb883db783664929a8
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
@@ -1755,9 +1755,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1818,9 +1818,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.push("tick");
try {
@@ -145,7 +145,7 @@ index 1de97c47735190be65c220289bcb320d7be7e2ba..6753ea878a19a8cb883db783664929a8
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
@@ -1772,24 +1772,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1835,24 +1835,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
this.profiler.popPush("connection");
@@ -233,7 +233,7 @@ index c96740a82eac9101f74edeb44edf4b64d1d633e0..1b6c5a36e96a3845d55b0b798a8cffdc
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 82e7f7c3c2f51bc135585f43bc5167bcde2f8a98..779b7ec2f243f4a8868d78e7fe5b5c57446d60aa 100644
index 64ed296cfbe7e5d27286b8cee70454fd1d99ebb0..be22cbe607876fdf39120d6957db541146e6e589 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -357,9 +357,9 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@@ -281,7 +281,7 @@ index 82e7f7c3c2f51bc135585f43bc5167bcde2f8a98..779b7ec2f243f4a8868d78e7fe5b5c57
this.level.getProfiler().pop();
this.clearCache();
}
@@ -423,7 +422,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@@ -424,7 +423,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
gameprofilerfiller.push("filteringLoadedChunks");
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
Iterator iterator = this.chunkMap.getChunks().iterator();
@@ -290,7 +290,7 @@ index 82e7f7c3c2f51bc135585f43bc5167bcde2f8a98..779b7ec2f243f4a8868d78e7fe5b5c57
while (iterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) iterator.next();
@@ -436,7 +435,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@@ -437,7 +436,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
if (this.level.tickRateManager().runsNormally()) {
gameprofilerfiller.popPush("naturalSpawnCount");
@@ -299,7 +299,7 @@ index 82e7f7c3c2f51bc135585f43bc5167bcde2f8a98..779b7ec2f243f4a8868d78e7fe5b5c57
int k = this.distanceManager.getNaturalSpawnChunkCount();
// Paper start - Optional per player mob spawns
int naturalSpawnChunkCount = k;
@@ -461,7 +460,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@@ -462,7 +461,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, !this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new LocalMobCapCalculator(this.chunkMap) : null, false);
}
// Paper end - Optional per player mob spawns
@@ -308,7 +308,7 @@ index 82e7f7c3c2f51bc135585f43bc5167bcde2f8a98..779b7ec2f243f4a8868d78e7fe5b5c57
this.lastSpawnState = spawnercreature_d;
gameprofilerfiller.popPush("spawnAndTick");
@@ -497,21 +496,21 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@@ -503,21 +502,21 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
}
}
@@ -336,10 +336,10 @@ index 82e7f7c3c2f51bc135585f43bc5167bcde2f8a98..779b7ec2f243f4a8868d78e7fe5b5c57
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 be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe318992d6a 100644
index dfb25c24237d98159e3c58b3d800c6ab5dc5e81b..c2aaca3cdc77f14e1d19eb4ac8cbf10a3ae0b6d3 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -686,7 +686,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -703,7 +703,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
gameprofilerfiller.popPush("tickPending");
@@ -348,7 +348,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
if (!this.isDebug() && flag) {
j = this.getGameTime();
gameprofilerfiller.push("blockTicks");
@@ -695,24 +695,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -712,24 +712,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks
gameprofilerfiller.pop();
}
@@ -380,7 +380,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
}
this.handlingTick = false;
@@ -725,7 +725,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -742,7 +742,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
if (flag1 || this.emptyTime++ < 300) {
gameprofilerfiller.push("entities");
@@ -389,7 +389,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
if (this.dragonFight != null && flag) {
gameprofilerfiller.push("dragonFight");
this.dragonFight.tick();
@@ -733,7 +733,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -750,7 +750,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
@@ -398,7 +398,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
this.entityTickList.forEach((entity) -> {
if (!entity.isRemoved()) {
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
@@ -760,8 +760,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -777,8 +777,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
}
});
@@ -409,7 +409,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
gameprofilerfiller.pop();
this.tickBlockEntities();
}
@@ -894,7 +894,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -911,7 +911,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
} // Paper - Option to disable ice and snow
gameprofilerfiller.popPush("tickBlocks");
@@ -418,7 +418,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
if (randomTickSpeed > 0) {
LevelChunkSection[] achunksection = chunk.getSections();
@@ -927,7 +927,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -944,7 +944,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
}
@@ -427,7 +427,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
gameprofilerfiller.pop();
}
@@ -1241,8 +1241,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1268,8 +1268,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
// Spigot end
// Paper start- timings
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity);
@@ -438,7 +438,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
// Paper end - timings
entity.setOldPosAndRot();
ProfilerFiller gameprofilerfiller = this.getProfiler();
@@ -1258,7 +1258,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1285,7 +1285,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
entity.postTick(); // CraftBukkit
} else { entity.inactiveTick(); } // Paper - EAR 2
this.getProfiler().pop();
@@ -447,7 +447,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
Iterator iterator = entity.getPassengers().iterator();
while (iterator.hasNext()) {
@@ -1275,8 +1275,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1302,8 +1302,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
// Paper - EAR 2
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
@@ -458,7 +458,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
// Paper end
passenger.setOldPosAndRot();
++passenger.tickCount;
@@ -1306,7 +1306,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1333,7 +1333,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.tickPassenger(passenger, entity2);
}
@@ -467,7 +467,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
}
} else {
passenger.stopRiding();
@@ -1328,7 +1328,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1355,7 +1355,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
if (!savingDisabled) {
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit
@@ -476,7 +476,7 @@ index be1d11d58aca571ed5b943bcbc00bafda5ea91db..2c622aaa370bb8cf3b6d68bc6533abe3
if (progressListener != null) {
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
}
@@ -1338,10 +1338,10 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1365,10 +1365,10 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
progressListener.progressStage(Component.translatable("menu.savingChunks"));
}
@@ -558,10 +558,10 @@ index 85b4b24361e785acf75571ff98f924c00ae80748..09a7b418ddf564c0be13297f7c216db2
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 54b57081264c367fba10433f25a6ef93f18fc4ab..e353384abb69aa4cee6fb20277df874b40466ace 100644
index 9810b1cb4c771a01df93fd45e2f94019edabf6a5..1b85d31a81404ea817c892ac0bd055058fe8f079 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -985,15 +985,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -990,15 +990,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
ProfilerFiller gameprofilerfiller = this.getProfiler();
gameprofilerfiller.push("blockEntities");
@@ -580,7 +580,7 @@ index 54b57081264c367fba10433f25a6ef93f18fc4ab..e353384abb69aa4cee6fb20277df874b
// Spigot start
// Iterator<TickingBlockEntity> iterator = this.blockEntityTickers.iterator();
boolean flag = this.tickRateManager().runsNormally();
@@ -1017,7 +1017,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1027,7 +1027,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075