From 14136b85d13ca7235ad6e53a574aca392406deac Mon Sep 17 00:00:00 2001 From: granny Date: Fri, 12 Jul 2024 21:09:10 -0700 Subject: [PATCH] Updated Upstream (Paper) Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@ffe31a1 Readd async saveddata io PaperMC/Paper@5a503d7 Bulk bugfixes for itemstack damage API (#11063) --- gradle.properties | 2 +- ...0144-Config-to-allow-unsafe-enchants.patch | 4 ++-- patches/server/0250-Remove-Timings.patch | 14 ++++++------- .../server/0251-Remove-Mojang-Profiler.patch | 20 +++++++++---------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0b35ddaf4..e59d14d81 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group = org.purpurmc.purpur version = 1.21-R0.1-SNAPSHOT mcVersion = 1.21 -paperCommit = 70ff1ec0793d2176915e8da3e3ef100093d5bedf +paperCommit = 5a503d7db42eee8d287b7ed32db22a369e9e3146 org.gradle.caching = true org.gradle.parallel = true diff --git a/patches/server/0144-Config-to-allow-unsafe-enchants.patch b/patches/server/0144-Config-to-allow-unsafe-enchants.patch index ea32e3b38..15de724eb 100644 --- a/patches/server/0144-Config-to-allow-unsafe-enchants.patch +++ b/patches/server/0144-Config-to-allow-unsafe-enchants.patch @@ -78,10 +78,10 @@ index 2d300905c05c7c23a4da30b3651b331381a1dc0d..30746b3ae45840206bf23e811a9819f3 ((ServerPlayer) this.player).connection.send(new ClientboundContainerSetDataPacket(this.containerId, 0, this.cost.get())); } diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 00665c3e81264b440cd27431f7632f3bc2b1ceef..293771fd6e86447b219d0936b67cdcdf2bc5f0ee 100644 +index 50d82217aade8bb6db557df9655e5746608af3ef..fab7bebb8c7fd21a3bcfbd2f04702eb56f9eb310 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -1249,6 +1249,12 @@ public final class ItemStack implements DataComponentHolder { +@@ -1251,6 +1251,12 @@ public final class ItemStack implements DataComponentHolder { return !((ItemEnchantments) this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY)).isEmpty(); } diff --git a/patches/server/0250-Remove-Timings.patch b/patches/server/0250-Remove-Timings.patch index 262b62f9a..8ee002f39 100644 --- a/patches/server/0250-Remove-Timings.patch +++ b/patches/server/0250-Remove-Timings.patch @@ -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 64ed296cfbe7e5d27286b8cee70454fd1d99ebb0..be22cbe607876fdf39120d6957db541146e6e589 100644 +index 36fbbf45ae064a345bf4aafbb9ac527197326eb9..b004e2e69598f2d6f3a9cd47aed3f4429c9702aa 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 @@ -248,7 +248,7 @@ index 64ed296cfbe7e5d27286b8cee70454fd1d99ebb0..be22cbe607876fdf39120d6957db5411 } @Override -@@ -387,26 +387,25 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -394,26 +394,25 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon @Override public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) { this.level.getProfiler().push("purge"); @@ -281,7 +281,7 @@ index 64ed296cfbe7e5d27286b8cee70454fd1d99ebb0..be22cbe607876fdf39120d6957db5411 this.level.getProfiler().pop(); this.clearCache(); } -@@ -424,7 +423,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -431,7 +430,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon gameprofilerfiller.push("filteringLoadedChunks"); List list = Lists.newArrayListWithCapacity(this.chunkMap.size()); Iterator iterator = this.chunkMap.getChunks().iterator(); @@ -290,7 +290,7 @@ index 64ed296cfbe7e5d27286b8cee70454fd1d99ebb0..be22cbe607876fdf39120d6957db5411 while (iterator.hasNext()) { ChunkHolder playerchunk = (ChunkHolder) iterator.next(); -@@ -437,7 +436,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -444,7 +443,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon if (this.level.tickRateManager().runsNormally()) { gameprofilerfiller.popPush("naturalSpawnCount"); @@ -299,7 +299,7 @@ index 64ed296cfbe7e5d27286b8cee70454fd1d99ebb0..be22cbe607876fdf39120d6957db5411 int k = this.distanceManager.getNaturalSpawnChunkCount(); // Paper start - Optional per player mob spawns int naturalSpawnChunkCount = k; -@@ -462,7 +461,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -469,7 +468,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 64ed296cfbe7e5d27286b8cee70454fd1d99ebb0..be22cbe607876fdf39120d6957db5411 this.lastSpawnState = spawnercreature_d; gameprofilerfiller.popPush("spawnAndTick"); -@@ -503,21 +502,21 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -510,21 +509,21 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } } } @@ -336,7 +336,7 @@ index 64ed296cfbe7e5d27286b8cee70454fd1d99ebb0..be22cbe607876fdf39120d6957db5411 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 19ca4094148cacedd878212adcf81766aff3171e..4a748149d1cbf4e99be76e1d9eca410d65f86e8f 100644 +index c1c280ea396d0bef5e0eba79ecd19ee2b26f0f6a..ca3ee624904c9fe195d4eb0d8a7ea8dee6656e95 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. diff --git a/patches/server/0251-Remove-Mojang-Profiler.patch b/patches/server/0251-Remove-Mojang-Profiler.patch index a422c6f74..96f7ad429 100644 --- a/patches/server/0251-Remove-Mojang-Profiler.patch +++ b/patches/server/0251-Remove-Mojang-Profiler.patch @@ -468,10 +468,10 @@ index 5d52df83c643845ffbeeba3bb640c9deeae11139..4f02f8b6003580fc178991cbece8ad43 public boolean hasWork() { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index be22cbe607876fdf39120d6957db541146e6e589..63b03939a15150eeafc0498a6c810153bcc0e271 100644 +index b004e2e69598f2d6f3a9cd47aed3f4429c9702aa..efe15505342e10baacadb61275c8f8d270f2de2c 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -374,26 +374,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -381,26 +381,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon // CraftBukkit start - modelled on below public void purgeUnload() { @@ -503,7 +503,7 @@ index be22cbe607876fdf39120d6957db541146e6e589..63b03939a15150eeafc0498a6c810153 if (tickChunks) { //this.level.timings.chunks.startTiming(); // Paper - timings // Purpur ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getPlayerChunkLoader().tick(); // Paper - rewrite chunk system -@@ -403,10 +403,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -410,10 +410,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } //this.level.timings.doChunkUnload.startTiming(); // Spigot // Purpur @@ -516,7 +516,7 @@ index be22cbe607876fdf39120d6957db541146e6e589..63b03939a15150eeafc0498a6c810153 this.clearCache(); } -@@ -417,10 +417,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -424,10 +424,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon this.lastInhabitedUpdate = i; if (!this.level.isDebug()) { @@ -530,7 +530,7 @@ index be22cbe607876fdf39120d6957db541146e6e589..63b03939a15150eeafc0498a6c810153 List list = Lists.newArrayListWithCapacity(this.chunkMap.size()); Iterator iterator = this.chunkMap.getChunks().iterator(); //if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper // Purpur -@@ -435,7 +435,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -442,7 +442,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } if (this.level.tickRateManager().runsNormally()) { @@ -539,7 +539,7 @@ index be22cbe607876fdf39120d6957db541146e6e589..63b03939a15150eeafc0498a6c810153 //this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur int k = this.distanceManager.getNaturalSpawnChunkCount(); // Paper start - Optional per player mob spawns -@@ -464,7 +464,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -471,7 +471,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon // this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur this.lastSpawnState = spawnercreature_d; @@ -548,7 +548,7 @@ index be22cbe607876fdf39120d6957db541146e6e589..63b03939a15150eeafc0498a6c810153 boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit Util.shuffle(list, this.level.random); -@@ -504,7 +504,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -511,7 +511,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } //this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur @@ -557,7 +557,7 @@ index be22cbe607876fdf39120d6957db541146e6e589..63b03939a15150eeafc0498a6c810153 if (flag) { //try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings // Purpur this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies); -@@ -512,14 +512,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -519,14 +519,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } } @@ -575,7 +575,7 @@ index be22cbe607876fdf39120d6957db541146e6e589..63b03939a15150eeafc0498a6c810153 } } -@@ -700,7 +700,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -707,7 +707,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon @Override protected void doRunTask(Runnable task) { @@ -585,7 +585,7 @@ index be22cbe607876fdf39120d6957db541146e6e589..63b03939a15150eeafc0498a6c810153 } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 4a748149d1cbf4e99be76e1d9eca410d65f86e8f..b3ddd5eba13f03d30104c9a163da835126b29115 100644 +index ca3ee624904c9fe195d4eb0d8a7ea8dee6656e95..0f28eabc50366f35b3804b16db8cc4c38777de6e 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -678,16 +678,16 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.