Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@2aaf436 Validate slot in PlayerInventory#setSlot (#11399)
PaperMC/Paper@5c82955 Only mark decorations dirty if a removal actually occurs (#11413)
PaperMC/Paper@c5a1066 Remove wall-time / unused skip tick protection (#11412)
This commit is contained in:
granny
2024-09-19 19:21:27 -07:00
parent 8332fa45d9
commit be61a07bf6
19 changed files with 97 additions and 97 deletions

View File

@@ -83,10 +83,10 @@ index e9775b4506909bee65a74964f0d5391a0513de1d..684f7f202305c09b1037c5d38a52a5ea
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54737f1acc 100644
index 43b2902bb015001de5939da801979194af7bf501..cef8a7eae708a47dc50c8392ab0e1a35882bfcfa 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -423,13 +423,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -422,13 +422,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
super("Server");
SERVER = this; // Paper - better singleton
@@ -106,7 +106,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
this.random = RandomSource.create();
this.port = -1;
this.levels = Maps.newLinkedHashMap();
@@ -1037,9 +1037,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1036,9 +1036,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
org.spigotmc.WatchdogThread.doStop(); // Paper
// Paper end
// CraftBukkit end
@@ -118,7 +118,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
MinecraftServer.LOGGER.info("Stopping server");
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
@@ -1312,16 +1312,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1310,16 +1310,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
boolean flag = i == 0L;
@@ -139,7 +139,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
this.tickServer(flag ? () -> {
return false;
} : this::haveTime);
@@ -1332,7 +1332,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1330,7 +1330,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw new RuntimeException("Chunk system crash propagated to tick()", crash);
}
// Paper end - rewrite chunk system
@@ -148,7 +148,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
// Pufferfish start - tps catchup
@@ -1348,9 +1348,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1346,9 +1346,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.tickRateManager.endTickWork();
}
@@ -161,7 +161,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
this.isReady = true;
JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis);
}
@@ -1560,7 +1560,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1558,7 +1558,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
@@ -170,7 +170,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
super.doRunTask(ticktask);
}
@@ -1634,7 +1634,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1632,7 +1632,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (playerSaveInterval < 0) {
playerSaveInterval = autosavePeriod;
}
@@ -179,7 +179,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
try {
this.isSaving = true;
@@ -1649,7 +1649,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1647,7 +1647,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} finally {
this.isSaving = false;
}
@@ -188,7 +188,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
// Paper end - Incremental chunk and player saving
// Paper start - move executeAll() into full server tick timing
//try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) { // Purpur
@@ -1662,7 +1662,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1660,7 +1660,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
this.server.spark.tickEnd(((double)(endTime - lastTick) / 1000000D)); // Paper - spark
// Paper end - Server Tick Events
@@ -197,7 +197,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
long j = Util.getNanos() - i;
int k = this.tickCount % 100;
@@ -1676,7 +1676,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1674,7 +1674,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.tickTimes60s.add(this.tickCount, j);
// Paper end - Add tick times API and /mspt command
this.logTickMethodTime(i);
@@ -206,7 +206,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
org.spigotmc.WatchdogThread.tick(); // Spigot
//co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper // Purpur
}
@@ -1767,11 +1767,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1765,11 +1765,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
});
// Paper end - Folia scheduler API
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
@@ -220,7 +220,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
//Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; moved down
// CraftBukkit start
@@ -1814,20 +1814,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1812,20 +1812,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worldserver.updateLagCompensationTick(); // Paper - lag compensation
worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
@@ -246,7 +246,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
try {
//worldserver.timings.doTick.startTiming(); // Spigot // Purpur
@@ -1840,17 +1840,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1838,17 +1838,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw new ReportedException(crashreport);
}
@@ -268,7 +268,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
//MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper // Purpur
this.playerList.tick();
//MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper // Purpur
@@ -1858,7 +1858,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1856,7 +1856,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
GameTestTicker.SINGLETON.tick();
}
@@ -277,7 +277,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
//MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper // Purpur
for (int i = 0; i < this.tickables.size(); ++i) {
@@ -1866,7 +1866,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1864,7 +1864,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
//MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper // Purpur
@@ -286,7 +286,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
iterator = this.playerList.getPlayers().iterator();
while (iterator.hasNext()) {
@@ -1876,7 +1876,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1874,7 +1874,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.resumeFlushing();
}
@@ -295,7 +295,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
}
private void synchronizeTime(ServerLevel world) {
@@ -1884,7 +1884,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1882,7 +1882,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void forceTimeSynchronization() {
@@ -304,7 +304,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
Iterator iterator = this.getAllLevels().iterator();
while (iterator.hasNext()) {
@@ -1893,7 +1893,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1891,7 +1891,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.synchronizeTime(worldserver);
}
@@ -313,7 +313,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
}
public boolean isLevelEnabled(Level world) {
@@ -2605,7 +2605,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2603,7 +2603,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public ProfilerFiller getProfiler() {
@@ -322,7 +322,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
return this.profiler;
}
@@ -2852,7 +2852,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2850,7 +2850,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end
private void startMetricsRecordingTick() {
@@ -331,7 +331,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
this.executeBlocking(() -> {
this.saveDebugReport(path.resolve("server"));
@@ -2862,40 +2862,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2860,40 +2860,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.willStartRecordingMetrics = false;
}
@@ -384,7 +384,7 @@ index 3c382484dcf1205890a2f284ab27b9722ffd5c35..1089238297ee7d129d71553205574f54
}
public Path getWorldPath(LevelResource worldSavePath) {
@@ -2948,15 +2948,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2946,15 +2946,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public boolean isTimeProfilerRunning() {