From 00864ac5b1409ea73e5ff77c759bbe5d6e41f18a Mon Sep 17 00:00:00 2001 From: Riley Park Date: Wed, 29 Mar 2023 18:26:03 -0700 Subject: [PATCH] Update Upstream (PaperMC/Paper@cbcdfd03e7d4042a8812d70d3e20fc216bdc5e02) --- gradle.properties | 2 +- patches/api/0001-Force-disable-timings.patch | 6 +- patches/api/0002-Region-scheduler-API.patch | 6 +- ...king-ownership-of-region-by-position.patch | 4 +- patches/server/0001-Build-changes.patch | 4 +- .../0002-New-player-chunk-loader-system.patch | 10 +- patches/server/0004-Threaded-Regions.patch | 141 +++++++++--------- ...-getHandle-and-overrides-perform-thr.patch | 12 +- ...0010-Disable-mid-tick-task-execution.patch | 4 +- ...to-be-explicitly-marked-as-Folia-sup.patch | 6 +- 10 files changed, 97 insertions(+), 98 deletions(-) diff --git a/gradle.properties b/gradle.properties index dd9b568..fb18bda 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=dev.folia version=1.19.4-R0.1-SNAPSHOT mcVersion=1.19.4 -paperRef=e8b82590d0c3dd57ac1728b236117d2fcd531c4f +paperRef=cbcdfd03e7d4042a8812d70d3e20fc216bdc5e02 org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/api/0001-Force-disable-timings.patch b/patches/api/0001-Force-disable-timings.patch index f3f46df..0cdd00d 100644 --- a/patches/api/0001-Force-disable-timings.patch +++ b/patches/api/0001-Force-disable-timings.patch @@ -6,14 +6,14 @@ Subject: [PATCH] Force disable timings Need a new profiler system with region threading diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java -index dd72a34eaa4bedd9ea0b92eaa79091b00eb4dd09..d886b909d74ad49198204199f7472f5d5bf4f06e 100644 +index c5ae86919e7ad8cc902405e34ddca633d6354e6b..85536ea8dc7943415c8cdb3c2c175ac2d21f7a90 100644 --- a/src/main/java/co/aikar/timings/Timings.java +++ b/src/main/java/co/aikar/timings/Timings.java -@@ -135,6 +135,7 @@ public final class Timings { +@@ -141,6 +141,7 @@ public final class Timings { * @param enabled Should timings be reported */ public static void setTimingsEnabled(boolean enabled) { + enabled = false; // Folia - region threading - disable timings timingsEnabled = enabled; + warnAboutDeprecationOnEnable(); reset(); - } diff --git a/patches/api/0002-Region-scheduler-API.patch b/patches/api/0002-Region-scheduler-API.patch index dab5f82..6fd7423 100644 --- a/patches/api/0002-Region-scheduler-API.patch +++ b/patches/api/0002-Region-scheduler-API.patch @@ -485,7 +485,7 @@ index 0000000000000000000000000000000000000000..a6b50c9d8af589cc4747e14d343d2045 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index ac9b690fcccb60b587e5345f12f1383afd0a73a1..7986b9fcaf256e9042f6d9ddc38e8bd76645cbb7 100644 +index a6bdd42b38454fe481f9210e1a0f5f94023a0543..aa2d0af0b0a783000e993fa622dd14e32b1914e3 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -2459,6 +2459,44 @@ public final class Bukkit { @@ -534,7 +534,7 @@ index ac9b690fcccb60b587e5345f12f1383afd0a73a1..7986b9fcaf256e9042f6d9ddc38e8bd7 @NotNull public static Server.Spigot spigot() { diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 2204336d8800311b65e894739ab1b27273e7c6f2..5caa00a413450dee18739f6430ffaf5095ea3036 100644 +index ce2ef5cff6ad10b64791e67f6d3cff328c2cf7dc..2f1d1edbe802f66962e2763d49a025fbc657c99f 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -2139,4 +2139,36 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -575,7 +575,7 @@ index 2204336d8800311b65e894739ab1b27273e7c6f2..5caa00a413450dee18739f6430ffaf50 + // Folia end - region threading API } diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 365350d38b2eee00d22bad09ab95c6054f11d536..86a86ad5555c5f9f6ed1938615f1cae9149b2805 100644 +index 8c58018b155c52a7b2a139f784abceb6aa00a268..d8c447b4c01e82efab6f68b0c668fc10404ef202 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -953,4 +953,13 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent diff --git a/patches/api/0005-Add-API-for-checking-ownership-of-region-by-position.patch b/patches/api/0005-Add-API-for-checking-ownership-of-region-by-position.patch index ad9c3ac..6f1c705 100644 --- a/patches/api/0005-Add-API-for-checking-ownership-of-region-by-position.patch +++ b/patches/api/0005-Add-API-for-checking-ownership-of-region-by-position.patch @@ -11,7 +11,7 @@ the schedulers depending on the result of the ownership check. diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 7986b9fcaf256e9042f6d9ddc38e8bd76645cbb7..3c940426f1ea03bb1279b4f397549642e98dd72d 100644 +index aa2d0af0b0a783000e993fa622dd14e32b1914e3..92678097e5255a8c7ff7b6b302ccb99f13c6f2e6 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -2496,6 +2496,107 @@ public final class Bukkit { @@ -123,7 +123,7 @@ index 7986b9fcaf256e9042f6d9ddc38e8bd76645cbb7..3c940426f1ea03bb1279b4f397549642 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 5caa00a413450dee18739f6430ffaf5095ea3036..c230a10aff36f6b484d7e3963cbf8073f8676fb1 100644 +index 2f1d1edbe802f66962e2763d49a025fbc657c99f..717635388aa449fd2e24692b14ceccc8a0f762c1 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -2170,5 +2170,90 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch index ebf3408..c80007f 100644 --- a/patches/server/0001-Build-changes.patch +++ b/patches/server/0001-Build-changes.patch @@ -79,10 +79,10 @@ index bf42969859545a8a520923ef1836ffa4a5cc24a0..719b0e318a85d4a1fb8f616deeb31193 return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4450d825a5474da211f0e83f845d8c7129fa08aa..8ccc92836bfda8e00eea649430174dcd5664af70 100644 +index 9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c..3219482b96cab8262e393a790c88d903d7de5166 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1681,7 +1681,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { // IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index ca5291a9573a62cb5c19539cf5c7aceff11f9829..a3cef477646abf6172d4e50a28ed30f04c30d667 100644 +index 1d4d02f26391ac55c7631817f09d05e2769b0d29..4231c3fe14a621d237bdc3d56c593f0adc0a7bc6 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -275,6 +275,48 @@ public class ServerPlayer extends Player { +@@ -276,6 +276,48 @@ public class ServerPlayer extends Player { public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event @@ -2203,7 +2203,7 @@ index 5e9055fdf411029ea2fed91acd6b981f79156418..ff6559bf563f2fdcc0f2843d4f4aa24d // Paper end - view distance api diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1bada55af5d16437da4d16f9ded55f88a6121eb4..e769c1c2a99a13941124c7442d44a509e7859666 100644 +index 0ae1fce0c1a2e3bfbbab756a088fc76545e263fa..fec408416aa63e1022802a644bb95131601f0c3b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -189,44 +189,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0004-Threaded-Regions.patch b/patches/server/0004-Threaded-Regions.patch index 0276ed0..869c720 100644 --- a/patches/server/0004-Threaded-Regions.patch +++ b/patches/server/0004-Threaded-Regions.patch @@ -11691,10 +11691,10 @@ index d2f0a0755317f5fa9a1ccf7db346aa77fd287d80..b07df826a3028c14b48b09dbaeccc907 // CraftBukkit start - SPIGOT-5477, MC-142590 } else if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2be06fd587 100644 +index 3219482b96cab8262e393a790c88d903d7de5166..f5977082a31d44088ab5ba31fad88e823cfe56e0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -294,7 +294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -307,12 +307,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system -@@ -604,7 +632,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0) { this.playerList.saveAll(playerSaveInterval); } @@ -12046,7 +12046,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b } } } finally { -@@ -1423,16 +1568,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return worldserver + " " + worldserver.dimension().location(); -@@ -1542,7 +1693,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 2147483647L ? Integer.MAX_VALUE : (int) l; @@ -16034,7 +16034,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e return horizontalSpawnArea <= 16 ? horizontalSpawnArea - 1 : 17; } -@@ -1159,6 +1198,343 @@ public class ServerPlayer extends Player { +@@ -1160,6 +1199,343 @@ public class ServerPlayer extends Player { } } @@ -16378,7 +16378,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e @Nullable @Override public Entity changeDimension(ServerLevel destination) { -@@ -1168,6 +1544,11 @@ public class ServerPlayer extends Player { +@@ -1169,6 +1545,11 @@ public class ServerPlayer extends Player { @Nullable public Entity changeDimension(ServerLevel worldserver, PlayerTeleportEvent.TeleportCause cause) { @@ -16390,7 +16390,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e // CraftBukkit end if (this.isSleeping()) return this; // CraftBukkit - SPIGOT-3154 // this.isChangingDimension = true; // CraftBukkit - Moved down and into PlayerList#changeDimension -@@ -2098,6 +2479,12 @@ public class ServerPlayer extends Player { +@@ -2109,6 +2490,12 @@ public class ServerPlayer extends Player { public void setCamera(@Nullable Entity entity) { Entity entity1 = this.getCamera(); @@ -16403,7 +16403,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e this.camera = (Entity) (entity == null ? this : entity); if (entity1 != this.camera) { // Paper start - Add PlayerStartSpectatingEntityEvent and PlayerStopSpectatingEntity Event -@@ -2559,7 +2946,7 @@ public class ServerPlayer extends Player { +@@ -2570,7 +2957,7 @@ public class ServerPlayer extends Player { this.experienceLevel = this.newLevel; this.totalExperience = this.newTotalExp; this.experienceProgress = 0; @@ -16413,7 +16413,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e this.removeAllEffects(org.bukkit.event.entity.EntityPotionEffectEvent.Cause.DEATH); this.effectsDirty = true; diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 0a3eb5e929c605d9eb7369de8ade8b49951f5d37..6b7b44ad8cb7ece5cfbf69bc54ed589a34f448a2 100644 +index 1d33c02088c150189d7f4b0aa27f6a1de96b11cf..59a9a9633ac924c606564b75298fae22f1ffd4ec 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -123,11 +123,11 @@ public class ServerPlayerGameMode { @@ -16439,7 +16439,7 @@ index 0a3eb5e929c605d9eb7369de8ade8b49951f5d37..6b7b44ad8cb7ece5cfbf69bc54ed589a if (iblockdata == null) { this.isDestroyingBlock = false; return; -@@ -408,7 +408,7 @@ public class ServerPlayerGameMode { +@@ -416,7 +416,7 @@ public class ServerPlayerGameMode { } else { // CraftBukkit start org.bukkit.block.BlockState state = bblock.getState(); @@ -16448,7 +16448,7 @@ index 0a3eb5e929c605d9eb7369de8ade8b49951f5d37..6b7b44ad8cb7ece5cfbf69bc54ed589a // CraftBukkit end block.playerWillDestroy(this.level, pos, iblockdata, this.player); boolean flag = this.level.removeBlock(pos, false); -@@ -436,8 +436,8 @@ public class ServerPlayerGameMode { +@@ -444,8 +444,8 @@ public class ServerPlayerGameMode { // return true; // CraftBukkit } // CraftBukkit start @@ -17710,7 +17710,7 @@ index 93a1e990b0a6caae4143c2f9d09bfb368fa1d6db..ad3166481dd37f4b5380f8bf28653bb4 itemstack = entityliving2.getMainHandItem(); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191405ee7bb 100644 +index 4705d7066207250c03a5f98eef61554c901f2e35..17b3c16008d801fa61cb3e7d89f31a4e0c166ac7 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -165,7 +165,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -18657,7 +18657,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191 // CraftBukkit end // Paper start - fix bad state entities causing dupes if (!isAlive() || !valid) { -@@ -3904,17 +4680,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3910,17 +4686,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { // Paper start public void startSeenByPlayer(ServerPlayer player) { @@ -18677,7 +18677,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191 } // Paper end -@@ -4405,7 +5177,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4411,7 +5183,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } } // Paper end - fix MC-4 @@ -18687,7 +18687,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191 synchronized (this.posLock) { // Paper this.position = new Vec3(x, y, z); } // Paper -@@ -4426,7 +5199,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4432,7 +5205,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { // Paper start - never allow AABB to become desynced from position // hanging has its own special logic @@ -18696,7 +18696,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191 this.setBoundingBox(this.makeBoundingBox()); } // Paper end -@@ -4513,6 +5286,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4519,6 +5292,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return this.removalReason != null; } @@ -18709,7 +18709,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191 @Nullable public Entity.RemovalReason getRemovalReason() { return this.removalReason; -@@ -4537,7 +5316,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4543,7 +5322,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { if (reason != RemovalReason.UNLOADED_TO_CHUNK) this.getPassengers().forEach(Entity::stopRiding); // Paper - chunk system - don't adjust passenger state when unloading, it's just not safe (and messes with our logic in entity chunk unload) this.levelCallback.onRemove(reason); @@ -19492,7 +19492,7 @@ index 6023b9eb3001e1a98ab8b970d853c4e7c7603f4d..0d16b7ea1e2c7d430b09721d50ea199a } }); diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java -index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba8566547e5766af 100644 +index 5d199fe497bd852827d3d18fb7566a09e70331a3..db6139c04ce9a1bc17e4305f5644c0e1ff9bf02e 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java @@ -32,16 +32,14 @@ public class WanderingTraderSpawner implements CustomSpawner { @@ -19515,7 +19515,7 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654 //this.spawnDelay = properties.getWanderingTraderSpawnDelay(); // Paper - This value is read from the world file only for the first spawn, after which vanilla uses a hardcoded value //this.spawnChance = properties.getWanderingTraderSpawnChance(); // Paper - This value is read from the world file only for the first spawn, after which vanilla uses a hardcoded value //if (this.spawnDelay == 0 && this.spawnChance == 0) { -@@ -56,37 +54,37 @@ public class WanderingTraderSpawner implements CustomSpawner { +@@ -56,36 +54,37 @@ public class WanderingTraderSpawner implements CustomSpawner { @Override public int tick(ServerLevel world, boolean spawnMonsters, boolean spawnAnimals) { @@ -19555,10 +19555,9 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654 - int i = this.spawnChance; + int i = worldData.wanderingTraderSpawnChance; // Folia - region threading -- this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); + // this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); // Paper - We don't need to save this value to disk if it gets set back to a hardcoded value anyways - this.spawnChance = Mth.clamp(i + world.paperConfig().entities.spawning.wanderingTrader.spawnChanceFailureIncrement, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMax); + worldData.wanderingTraderSpawnChance = Mth.clamp(i + world.paperConfig().entities.spawning.wanderingTrader.spawnChanceFailureIncrement, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMax); // Folia - region threading - //this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); // Paper - We don't need to save this value to disk if it gets set back to a hardcoded value anyways if (this.random.nextInt(100) > i) { return 0; } else if (this.spawn(world)) { @@ -19567,7 +19566,7 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654 // Paper end return 1; } else { -@@ -98,7 +96,7 @@ public class WanderingTraderSpawner implements CustomSpawner { +@@ -97,7 +96,7 @@ public class WanderingTraderSpawner implements CustomSpawner { } private boolean spawn(ServerLevel world) { @@ -19576,7 +19575,7 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654 if (entityplayer == null) { return true; -@@ -128,7 +126,7 @@ public class WanderingTraderSpawner implements CustomSpawner { +@@ -127,7 +126,7 @@ public class WanderingTraderSpawner implements CustomSpawner { this.tryToSpawnLlamaFor(world, entityvillagertrader, 4); } @@ -20082,7 +20081,7 @@ index d7a0cbde8f8c99276307502674c71463fbe7e89c..2a501b3fa8d69f627b279fd035fd2cb1 } diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5b2aaa3f0 100644 +index d690b8d0c1da1f56b226376df8c76c34375e3c73..6e6f73d50725057bc713bc6ae3a31b77ee97d415 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -334,6 +334,7 @@ public final class ItemStack { @@ -20131,7 +20130,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5 StructureGrowEvent structureEvent = null; if (treeType != null) { boolean isBonemeal = this.getItem() == Items.BONE_MEAL; -@@ -393,12 +395,12 @@ public final class ItemStack { +@@ -394,12 +396,12 @@ public final class ItemStack { SignItem.openSign = null; // SPIGOT-6758 - Reset on early return return enuminteractionresult; } @@ -20147,7 +20146,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5 if (blocks.size() > 1) { placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ()); } else if (blocks.size() == 1 && item != Items.POWDER_SNOW_BUCKET) { // Paper - don't call event twice for snow buckets -@@ -409,13 +411,13 @@ public final class ItemStack { +@@ -410,13 +412,13 @@ public final class ItemStack { enuminteractionresult = InteractionResult.FAIL; // cancel placement // PAIL: Remove this when MC-99075 fixed placeEvent.getPlayer().updateInventory(); @@ -20164,7 +20163,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5 // Brute force all possible updates BlockPos placedPos = ((CraftBlock) placeEvent.getBlock()).getPosition(); -@@ -430,7 +432,7 @@ public final class ItemStack { +@@ -431,7 +433,7 @@ public final class ItemStack { this.setCount(newCount); } @@ -20173,7 +20172,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5 world.setBlockEntity(e.getValue()); } -@@ -504,8 +506,8 @@ public final class ItemStack { +@@ -505,8 +507,8 @@ public final class ItemStack { entityhuman.awardStat(Stats.ITEM_USED.get(item)); } } @@ -23751,10 +23750,10 @@ index ff6559bf563f2fdcc0f2843d4f4aa24d7ddfb6db..2ead9af36c4d41c61b68a960ff17e258 if (chunk != null) addTicket(x, z); // Paper ret.complete(chunk == null ? null : chunk.getBukkitChunk()); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java -index fb6454cc64ebc549f61ad7d51efb16ef15f8384d..903408d4d8f9ce5c9566ec96312281ab15f16c2f 100644 +index a3d5e319473e2f6316b3ef8edf719296e02d85a1..55abed5fdf8dc699ade5b25b1f1949417dbf7a69 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java -@@ -40,6 +40,7 @@ public final class CapturedBlockState extends CraftBlockState { +@@ -46,6 +46,7 @@ public final class CapturedBlockState extends CraftBlockState { for (int k = 0; k < j; ++k) { Bee entitybee = new Bee(EntityType.BEE, generatoraccessseed.getMinecraftWorld()); @@ -24117,7 +24116,7 @@ index 57a0dbb23a32123d30c3b3572f4d129be9d97847..3f46d9398add0e97a2b8b072f66b48b0 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e769c1c2a99a13941124c7442d44a509e7859666..aac6d175e17b8419f7938c432a8fbbf3c34f3fbe 100644 +index fec408416aa63e1022802a644bb95131601f0c3b..c6e6ce4a077550e8e86995f18a4deda4b7b369eb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -564,7 +564,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -24150,7 +24149,7 @@ index e769c1c2a99a13941124c7442d44a509e7859666..aac6d175e17b8419f7938c432a8fbbf3 if (entry != null) { entry.removePlayer(this.getHandle()); } -@@ -1858,7 +1863,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1863,7 +1868,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(otherPlayer))); } diff --git a/patches/server/0009-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch b/patches/server/0009-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch index ec0ab62..3e6ab1d 100644 --- a/patches/server/0009-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch +++ b/patches/server/0009-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch @@ -51,7 +51,7 @@ index d9687722e02dfd4088c7030abbf5008eb0a092c8..62484ebf4550b05182f693a3180bbac5 TickThread.ensureTickThread(thisEntity, "May not tick entity scheduler asynchronously"); final List toRun; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f038f6d4e9fc4b76d5774fc637171191405ee7bb..55a03a3b22c37338d32aeb0878169c4462d1a1d0 100644 +index 17b3c16008d801fa61cb3e7d89f31a4e0c166ac7..068d4a60db0c5c849e4ea555c7e8936906d812f6 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2767,6 +2767,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2147,7 +2147,7 @@ index beea227855f0b978e655efc298024120df8f4945..e1b7922ed298b6b3068c3f5fbe3b4030 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index aac6d175e17b8419f7938c432a8fbbf3c34f3fbe..34bddd5478a2bb6cd880970765933abcfdde173f 100644 +index c6e6ce4a077550e8e86995f18a4deda4b7b369eb..545a7c3ba18c983681eb5489ff6c6da41ee18988 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -584,7 +584,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2159,7 +2159,7 @@ index aac6d175e17b8419f7938c432a8fbbf3c34f3fbe..34bddd5478a2bb6cd880970765933abc final ServerGamePacketListenerImpl connection = this.getHandle().connection; if (connection != null) { connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message, cause); -@@ -1968,9 +1968,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1978,9 +1978,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this; } @@ -2177,7 +2177,7 @@ index aac6d175e17b8419f7938c432a8fbbf3c34f3fbe..34bddd5478a2bb6cd880970765933abc } public void setHandle(final ServerPlayer entity) { -@@ -2996,7 +3003,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3006,7 +3013,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { { if ( CraftPlayer.this.getHealth() <= 0 && CraftPlayer.this.isOnline() ) { @@ -2524,10 +2524,10 @@ index d8b4df1300791aaf310465ec1577b1b8c202901a..17b83eb8563586f1ddf252f438d52d55 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java -index 92d1c7943c7ddb5d29b657f8da74e29dfe051c2b..5dc45789f92a49ce461db06b322d14e897d2f951 100644 +index 5fde54aa18cc3e474e5ea252efed91a7e1809929..a1dfa6c6368311e78b76c8c30227461ccb3eea9e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java -@@ -10,8 +10,16 @@ public class CraftSniffer extends CraftAnimals implements Sniffer { +@@ -16,8 +16,16 @@ public class CraftSniffer extends CraftAnimals implements Sniffer { super(server, entity); } diff --git a/patches/server/0010-Disable-mid-tick-task-execution.patch b/patches/server/0010-Disable-mid-tick-task-execution.patch index d07253f..7c5a7c9 100644 --- a/patches/server/0010-Disable-mid-tick-task-execution.patch +++ b/patches/server/0010-Disable-mid-tick-task-execution.patch @@ -10,10 +10,10 @@ the impact from scaling the region threads, but is not a fix to the underlying issue. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 26350a185cadbb64696b2a1ac88b1a2be06fd587..61a7d2728c6f4b936dc8f1031950374f2c35cac7 100644 +index f5977082a31d44088ab5ba31fad88e823cfe56e0..f5721f6d719b7055fdccc81d5e67ed758e90cb10 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2906,6 +2906,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop getProvidedPlugins() { return this.provides; diff --git a/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java b/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java -index eb0464a52d99a916bca8f93cd9294cdc30893671..923019a5823033871ab61ed9ed7625a2bc4d2b3d 100644 +index 1ba051931d3ce6ac0bef559911e4453044266aab..dc81e1a9faa54ba677bede6d7ca2414b1d7b6003 100644 --- a/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java +++ b/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java @@ -24,6 +24,11 @@ class PaperPluginProviderFactory implements PluginTypeFactory