Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@b4f04ff Add Plugin#getDataPath (#11080)
PaperMC/Paper@05e5865 Add ItemType#getItemRarity (#11049)
PaperMC/Paper@aa929d6 Call PlayerLaunchProjectileEvent for wind charge (#10911)
PaperMC/Paper@8b23018 Avoid collision shapes outside world border in findFreePosition
PaperMC/Paper@3b45454 Port random ticking optimisation from Moonrise
PaperMC/Paper@77fcb29 Apply incremental player/level saving patch
PaperMC/Paper@9fd7710 Apply automatic regionfile header recalculation patch
PaperMC/Paper@b57b24d Do not try to stop main thread during watchdog shutdown
PaperMC/Paper@2cd8c46 Add OMINOUS_ITEM_SPAWNER SpawnReason (#10897)
This commit is contained in:
granny
2024-07-15 17:14:04 -07:00
parent 87cf9f15dc
commit bf63cfab4d
39 changed files with 215 additions and 221 deletions

View File

@@ -42,10 +42,10 @@ index e2c24813f59c2fd075c740ac1842a38f20ed8554..01efbc507b3d58f13f78ee286f93df40
} 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 a83088548733c6475828301fe45c63bb840cc085..22ed622f081a39bb4695e49b350e920848f288e7 100644
index 6ab6858dcaaadb87493597598af905a9c180d211..a7554d272d13747bed32ce4190b58151b106f7e4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1610,15 +1610,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1601,15 +1601,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void tickServer(BooleanSupplier shouldKeepTicking) {
@@ -64,8 +64,8 @@ index a83088548733c6475828301fe45c63bb840cc085..22ed622f081a39bb4695e49b350e9208
// Paper end
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
@@ -1643,9 +1643,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
@@ -1646,9 +1646,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
- try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
@@ -76,7 +76,7 @@ index a83088548733c6475828301fe45c63bb840cc085..22ed622f081a39bb4695e49b350e9208
// Paper end
// Paper start - Server Tick Events
long endTime = System.nanoTime();
@@ -1668,7 +1668,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1671,7 +1671,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.logTickMethodTime(i);
this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot
@@ -85,7 +85,7 @@ index a83088548733c6475828301fe45c63bb840cc085..22ed622f081a39bb4695e49b350e9208
}
private void logTickMethodTime(long tickStartTime) {
@@ -1739,9 +1739,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1742,9 +1742,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
entityplayer.connection.suspendFlushing();
});
@@ -97,7 +97,7 @@ index a83088548733c6475828301fe45c63bb840cc085..22ed622f081a39bb4695e49b350e9208
// Paper start - Folia scheduler API
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
getAllLevels().forEach(level -> {
@@ -1758,21 +1758,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1761,21 +1761,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 a83088548733c6475828301fe45c63bb840cc085..22ed622f081a39bb4695e49b350e9208
// 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()) {
@@ -1792,7 +1792,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1795,7 +1795,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
// Paper end - Perf: Optimize time updates
@@ -133,7 +133,7 @@ index a83088548733c6475828301fe45c63bb840cc085..22ed622f081a39bb4695e49b350e9208
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
@@ -1820,9 +1820,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1823,9 +1823,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.push("tick");
try {
@@ -145,7 +145,7 @@ index a83088548733c6475828301fe45c63bb840cc085..22ed622f081a39bb4695e49b350e9208
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
@@ -1837,24 +1837,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1840,24 +1840,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 6df79aab2f0a75bbe347dc92e9ed5d62ceec7983..5d52df83c643845ffbeeba3bb640c9de
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 36fbbf45ae064a345bf4aafbb9ac527197326eb9..b004e2e69598f2d6f3a9cd47aed3f4429c9702aa 100644
index 3575fe6f57457ab865a29d20836512f6f5a98115..bb7e02af46ecd313debcfb778d3390ad5f2c3991 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
@@ -336,10 +336,10 @@ index 36fbbf45ae064a345bf4aafbb9ac527197326eb9..b004e2e69598f2d6f3a9cd47aed3f442
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 c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8dee6656e95 100644
index ff47ff94c84d05161cee5761d8a6ed0d8d32a3ac..17022327262157ad1520fb7d4fc187c8f1da00c2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -720,7 +720,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -711,7 +711,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
gameprofilerfiller.popPush("tickPending");
@@ -348,7 +348,7 @@ index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
if (!this.isDebug() && flag) {
j = this.getGameTime();
gameprofilerfiller.push("blockTicks");
@@ -729,24 +729,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -720,24 +720,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 c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
}
this.handlingTick = false;
@@ -759,7 +759,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -750,7 +750,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
if (flag1 || this.emptyTime++ < 300) {
gameprofilerfiller.push("entities");
@@ -389,7 +389,7 @@ index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
if (this.dragonFight != null && flag) {
gameprofilerfiller.push("dragonFight");
this.dragonFight.tick();
@@ -767,7 +767,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -758,7 +758,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
@@ -398,7 +398,7 @@ index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
this.entityTickList.forEach((entity) -> {
if (!entity.isRemoved()) {
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
@@ -794,8 +794,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -785,8 +785,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
}
});
@@ -409,17 +409,14 @@ index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
gameprofilerfiller.pop();
this.tickBlockEntities();
}
@@ -928,7 +928,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -976,12 +976,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
} // Paper - Option to disable ice and snow
gameprofilerfiller.popPush("tickBlocks");
- timings.chunkTicksBlocks.startTiming(); // Paper
+ //timings.chunkTicksBlocks.startTiming(); // Paper // Purpur
if (randomTickSpeed > 0) {
LevelChunkSection[] achunksection = chunk.getSections();
@@ -961,7 +961,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
this.optimiseRandomTick(chunk, randomTickSpeed); // Paper - optimise random ticking
}
- timings.chunkTicksBlocks.stopTiming(); // Paper
@@ -427,7 +424,7 @@ index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
gameprofilerfiller.pop();
}
@@ -1304,8 +1304,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1324,8 +1324,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 +435,7 @@ index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
// Paper end - timings
entity.setOldPosAndRot();
ProfilerFiller gameprofilerfiller = this.getProfiler();
@@ -1321,7 +1321,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1341,7 +1341,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
entity.postTick(); // CraftBukkit
} else { entity.inactiveTick(); } // Paper - EAR 2
this.getProfiler().pop();
@@ -447,7 +444,7 @@ index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
Iterator iterator = entity.getPassengers().iterator();
while (iterator.hasNext()) {
@@ -1344,8 +1344,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1364,8 +1364,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 +455,7 @@ index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
// Paper end
passenger.setOldPosAndRot();
++passenger.tickCount;
@@ -1375,7 +1375,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1395,7 +1395,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.tickPassenger(passenger, entity2);
}
@@ -467,7 +464,25 @@ index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
}
} else {
passenger.stopRiding();
@@ -1397,7 +1397,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1415,7 +1415,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld()));
}
- try (co.aikar.timings.Timing ignored = this.timings.worldSave.startTiming()) {
+ //try (co.aikar.timings.Timing ignored = this.timings.worldSave.startTiming()) { // Purpur
if (doFull) {
this.saveLevelData(true);
}
@@ -1432,7 +1432,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData());
}
// CraftBukkit end
- }
+ //} // Purpur
}
// Paper end - Incremental chunk and player saving
@@ -1446,7 +1446,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 +491,7 @@ index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
if (progressListener != null) {
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
}
@@ -1407,10 +1407,10 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1456,10 +1456,10 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
progressListener.progressStage(Component.translatable("menu.savingChunks"));
}
@@ -491,17 +506,21 @@ index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8de
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 3b3403e07023a70f9d53c22a288cb68925ed6f21..74c6f43a26ca1b36e7121dddd9f065b2a9254493 100644
index 71f989f5349339c2481be03c81a41704ffbe42a9..b14e56c6b117b28c604259ad179d10e79f7c4cdd 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1221,11 +1221,11 @@ public abstract class PlayerList {
@@ -1227,7 +1227,7 @@ public abstract class PlayerList {
public void saveAll() {
public void saveAll(int interval) {
io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
- MinecraftTimings.savePlayers.startTiming(); // Paper
+ //MinecraftTimings.savePlayers.startTiming(); // Paper // Purpur
int numSaved = 0;
long now = MinecraftServer.currentTick;
for (int i = 0; i < this.players.size(); ++i) {
this.save(this.players.get(i));
@@ -1238,7 +1238,7 @@ public abstract class PlayerList {
}
// Paper end - Incremental chunk and player saving
}
- MinecraftTimings.savePlayers.stopTiming(); // Paper
+ //MinecraftTimings.savePlayers.stopTiming(); // Paper // Purpur
@@ -558,10 +577,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 d61634dba1024ece540d79b64e013259502f7ca2..63d1f787f5cd4af900d22e2abba32ba52b615737 100644
index 32cc7311559b2613269e347c73a1e000ff40f686..342c8a114b9063b2fa959aae22cdd2c0d412c50d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1373,15 +1373,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1415,15 +1415,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
ProfilerFiller gameprofilerfiller = this.getProfiler();
gameprofilerfiller.push("blockEntities");
@@ -580,7 +599,7 @@ index d61634dba1024ece540d79b64e013259502f7ca2..63d1f787f5cd4af900d22e2abba32ba5
// Spigot start
// Iterator<TickingBlockEntity> iterator = this.blockEntityTickers.iterator();
boolean flag = this.tickRateManager().runsNormally();
@@ -1412,7 +1412,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1454,7 +1454,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075