From 61aed65ccecf0201abb62e96e2118bed9fc7407a Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 8 Dec 2024 12:39:49 -0800 Subject: [PATCH] Update Paper --- build.gradle.kts | 2 +- gradle.properties | 2 +- patches/server/0001-Build-changes.patch | 6 +- patches/server/0003-Threaded-Regions.patch | 217 +++++++++--------- ...-getHandle-and-overrides-perform-thr.patch | 8 +- ...edOperationException-for-broken-APIs.patch | 2 +- ...access-when-waking-players-up-during.patch | 2 +- ...ition-to-player-position-on-player-d.patch | 2 +- patches/server/0017-Region-profiler.patch | 20 +- 9 files changed, 130 insertions(+), 131 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index cd742b7d7..26cf1602b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import io.papermc.paperweight.tasks.RebuildGitPatches plugins { java `maven-publish` - id("io.papermc.paperweight.patcher") version "1.7.6" + id("io.papermc.paperweight.patcher") version "1.7.7" } val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" diff --git a/gradle.properties b/gradle.properties index 42781a663..3ee525b24 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=dev.folia version=1.21.4-R0.1-SNAPSHOT mcVersion=1.21.4 -paperRef=416a73304809d94c11a2bf22bbb2ad438a0dd68c +paperRef=71a367ec8489c8a61a4c009f6a3c536438707158 org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch index 76c362bfa..11edf0d6d 100644 --- a/patches/server/0001-Build-changes.patch +++ b/patches/server/0001-Build-changes.patch @@ -46,10 +46,10 @@ index 2da91ed6363c0851e4c459188f5e8ef5475e0c97..8d2b5fec6fe27dca3ce01ba1ce505061 standardInput = System.`in` workingDir = rootProject.layout.projectDirectory diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 4b002e8b75d117b726b0de274a76d3596fce015b..cb60d58d4a7556dd896f31d0cd249f860bb3ef84 100644 +index 8f62879582195d8ae4f64bd23f752fa133b1c973..f5ff71e31516327be71924926938f1c9f0e503df 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java -@@ -593,7 +593,7 @@ public class Metrics { +@@ -592,7 +592,7 @@ public class Metrics { boolean logFailedRequests = config.getBoolean("logFailedRequests", false); // Only start Metrics, if it's enabled in the config if (config.getBoolean("enabled", true)) { @@ -58,7 +58,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..cb60d58d4a7556dd896f31d0cd249f86 metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { String minecraftVersion = Bukkit.getVersion(); -@@ -607,11 +607,11 @@ public class Metrics { +@@ -606,11 +606,11 @@ public class Metrics { final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion(); if (implVersion != null) { final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1); diff --git a/patches/server/0003-Threaded-Regions.patch b/patches/server/0003-Threaded-Regions.patch index f80d124ff..5baf6cfed 100644 --- a/patches/server/0003-Threaded-Regions.patch +++ b/patches/server/0003-Threaded-Regions.patch @@ -1115,7 +1115,7 @@ index bd68139ae635f2ad7ec8e7a21e0056a139c4c62e..48a43341b17247355a531164019d5cc9 } diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -index 17e23ca4dd2bbfba49ea00aa2b719a95feb931be..7e906e8324280ef80222305812527886e7b7ce9e 100644 +index 088b8fe5d144807f4da1e85b2fa34dfd21286f8c..4ed27c10b432ceebf4447ab8007bc3a1be09a06e 100644 --- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java @@ -354,4 +354,18 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -8489,7 +8489,7 @@ index 1f7f68aad97ee73763c042837f239bdc7167db55..d6eb8f495688a1b65a4c419aa3ee655c } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ab4f1bd1ebf0af54f3fa88ee9e2007d20445e7e9..9fa5c1628f2df441de47a38e732e7b033c3e2448 100644 +index ae4ebf509837e8d44255781c61d02873f8b74be8..25b4b0d531f0698338ffeac686013a4631d60c00 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -216,7 +216,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping + // Folia start - regionised ticking + public final io.papermc.paper.threadedregions.RegionizedServer regionizedServer = new io.papermc.paper.threadedregions.RegionizedServer(); @@ -8795,10 +8795,10 @@ index ab4f1bd1ebf0af54f3fa88ee9e2007d20445e7e9..9fa5c1628f2df441de47a38e732e7b03 if (waitForShutdown) { try { this.serverThread.join(); -@@ -1241,10 +1323,23 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop true, false); } // Paper end - avoid issues with certain tasks not processing during sleep @@ -8977,7 +8976,7 @@ index ab4f1bd1ebf0af54f3fa88ee9e2007d20445e7e9..9fa5c1628f2df441de47a38e732e7b03 // Paper start - Incremental chunk and player saving final ProfilerFiller profiler = Profiler.get(); int playerSaveInterval = io.papermc.paper.configuration.GlobalConfiguration.get().playerAutoSave.rate; -@@ -1677,15 +1805,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { String s = String.valueOf(worldserver); -@@ -1874,7 +1965,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop Math.max(this.allowedPlayerTicks, 5)) { ServerGamePacketListenerImpl.LOGGER.debug("{} is sending move packets too frequently ({} packets since last tick)", this.player.getName().getString(), i); -@@ -1627,7 +1678,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1628,7 +1679,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // If the event is cancelled we move the player back to their old location. if (event.isCancelled()) { @@ -13452,7 +13451,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 return; } -@@ -1635,7 +1686,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1636,7 +1687,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // there to avoid any 'Moved wrongly' or 'Moved too quickly' errors. // We only do this if the Event was not cancelled. if (!oldTo.equals(event.getTo()) && !event.isCancelled()) { @@ -13461,7 +13460,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 return; } -@@ -1882,9 +1933,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1883,9 +1934,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (!this.player.isSpectator()) { // limit how quickly items can be dropped // If the ticks aren't the same then the count starts from 0 and we update the lastDropTick. @@ -13473,7 +13472,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 } else { // Else we increment the drop count and check the amount. this.dropCount++; -@@ -1912,7 +1963,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1913,7 +1964,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl case ABORT_DESTROY_BLOCK: case STOP_DESTROY_BLOCK: // Paper start - Don't allow digging into unloaded chunks @@ -13482,7 +13481,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 this.player.connection.ackBlockChangesUpTo(packet.getSequence()); return; } -@@ -1997,7 +2048,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1998,7 +2049,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Paper end - improve distance check BlockPos blockposition = movingobjectpositionblock.getBlockPos(); @@ -13491,7 +13490,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 Vec3 vec3d1 = vec3d.subtract(Vec3.atCenterOf(blockposition)); double d0 = 1.0000001D; -@@ -2131,7 +2182,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2132,7 +2183,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl Entity entity = packet.getEntity(worldserver); if (entity != null) { @@ -13500,7 +13499,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 return; } } -@@ -2166,7 +2217,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2167,7 +2218,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // CraftBukkit end ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), info.reason().getString()); @@ -13509,7 +13508,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 super.onDisconnect(info, quitMessage); // Paper - Fix kick event leave message not being sent } -@@ -2175,6 +2226,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2176,6 +2227,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.removePlayerFromWorld(null); } @@ -13518,7 +13517,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 private void removePlayerFromWorld(@Nullable net.kyori.adventure.text.Component quitMessage) { // Paper end - Fix kick event leave message not being sent this.chatMessageChain.close(); -@@ -2187,6 +2240,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2188,6 +2241,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.disconnect(); // Paper start - Adventure quitMessage = quitMessage == null ? this.server.getPlayerList().remove(this.player) : this.server.getPlayerList().remove(this.player, quitMessage); // Paper - pass in quitMessage to fix kick message not being used @@ -13527,7 +13526,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 if ((quitMessage != null) && !quitMessage.equals(net.kyori.adventure.text.Component.empty())) { this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); // Paper end -@@ -2443,7 +2498,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2444,7 +2499,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.resetLastActionTime(); // CraftBukkit start if (sync) { @@ -13536,7 +13535,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 } else { runnable.run(); } -@@ -2501,7 +2556,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2502,7 +2557,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl String originalFormat = event.getFormat(), originalMessage = event.getMessage(); this.cserver.getPluginManager().callEvent(event); @@ -13545,7 +13544,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 // Evil plugins still listening to deprecated event final PlayerChatEvent queueEvent = new PlayerChatEvent(player, event.getMessage(), event.getFormat(), event.getRecipients()); queueEvent.setCancelled(event.isCancelled()); -@@ -2599,6 +2654,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2600,6 +2655,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (s.isEmpty()) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message"); } else if (this.getCraftPlayer().isConversing()) { @@ -13553,7 +13552,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 final String conversationInput = s; this.server.processQueue.add(new Runnable() { @Override -@@ -2837,8 +2893,25 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2838,8 +2894,25 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Spigot End public void switchToConfig() { @@ -13580,7 +13579,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 this.send(ClientboundStartConfigurationPacket.INSTANCE); this.connection.setupOutboundProtocol(ConfigurationProtocols.CLIENTBOUND); } -@@ -2865,7 +2938,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2866,7 +2939,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.resetLastActionTime(); this.player.setShiftKeyDown(packet.isUsingSecondaryAction()); @@ -13589,7 +13588,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 if (!worldserver.getWorldBorder().isWithinBounds(entity.blockPosition())) { return; } -@@ -3013,6 +3086,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3014,6 +3087,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl switch (packetplayinclientcommand_enumclientcommand) { case PERFORM_RESPAWN: if (this.player.wonGame) { @@ -13602,7 +13601,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 this.player.wonGame = false; this.player = this.server.getPlayerList().respawn(this.player, true, Entity.RemovalReason.CHANGED_DIMENSION, RespawnReason.END_PORTAL); // CraftBukkit this.resetPosition(); -@@ -3022,6 +3101,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3023,6 +3102,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl return; } @@ -13620,7 +13619,7 @@ index 2fbe3d8722eeacc3b27ce38145aeffa610f9daab..5a58b1218d787276d2ac95f77df78d18 this.player = this.server.getPlayerList().respawn(this.player, false, Entity.RemovalReason.KILLED, RespawnReason.DEATH); // CraftBukkit this.resetPosition(); if (this.server.isHardcore()) { -@@ -3584,7 +3674,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3585,7 +3675,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.filterTextPacket(list).thenAcceptAsync((list1) -> { this.updateSignText(packet, list1); @@ -14351,7 +14350,7 @@ index e9df8f8541b8a1b85c7d2925ff3cba813007a1ef..d3f2775a68121ca80ef55ea4c280a0c9 return blockToFallLocation(blockState); } else { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 27618d07d718cb2a5783536e11d56f712303487b..75929ae02677637500229b7b635479f92e3bd177 100644 +index 1b547be0fe97119edf4f29666cfe0037e0c778e0..faa1135996a3afccbf45c84059090248703b98ac 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -186,7 +186,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -15503,7 +15502,7 @@ index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..e6871fb4b58910043e88ea45564363aa while (!flag2 && blockposition.getY() > world.getMinY()) { diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 5a3059cadbc9735b4b48745c6b1b11196596b06d..92bda33a8d42150e66f3d2c24bdcce6b7c42471b 100644 +index 5a0b51342f4a646101f4588697bcae7d1ca8a010..e48728723e9f765099fc1cea8e6a2baa48d7fc75 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -292,9 +292,21 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @@ -15537,7 +15536,7 @@ index 5a3059cadbc9735b4b48745c6b1b11196596b06d..92bda33a8d42150e66f3d2c24bdcce6b if (fireEvent) { if (reason == EntityTargetEvent.TargetReason.UNKNOWN && this.getTarget() != null && entityliving == null) { reason = this.getTarget().isAlive() ? EntityTargetEvent.TargetReason.FORGOT_TARGET : EntityTargetEvent.TargetReason.TARGET_DIED; -@@ -1777,16 +1789,22 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -1779,16 +1791,22 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab this.goalSelector.removeAllGoals(predicate); } @@ -15938,7 +15937,7 @@ index 63a94b6068fdaef8bb26675c2927cb729ced1dac..f3f98e6276dda3bc4f290fc2d80569f7 @Override diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java -index ca706f1ac5f4248164daa613eef81e46b3e5a210..4690611c9db99156735dd60ebd180160bed61c5c 100644 +index 0bafe14342c1acce131ad34717c18aed3718deed..63ee0cd25cf595196ad67d90737daf7826925b2a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java @@ -1129,6 +1129,11 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @@ -15992,7 +15991,7 @@ index 7cb3d69a69e0e3ef4b7f9f9c8b1eb67edb5d116d..80590431ad85293effdde5fff6d0432d BlockPos blockposition = this.blockPosition(); diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -index bbdaaa1cc0b4aed28bc39385508d221055b99d4d..0db0dccecfd232a3c3f061063966abb867fc4444 100644 +index 7d83ad8a61f6aafbc063506c1858554f9b700b70..ada70345efbb620c1df6e68ab16a3fb29df43129 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java @@ -262,7 +262,9 @@ public class ItemFrame extends HangingEntity { @@ -16314,7 +16313,7 @@ index 5b8b85a295a08ae495f729c595b3a78778965342..f2817f1c29431ef2c4a45dc9ef90f06d return false; } diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index c4a8054666b1b28812a72c42755db8f1fb9348a0..ffb4a36cf14b8ce74c7f615f975fcdb027b32e61 100644 +index f4513b1887f823b088dabe425be042b8fb2bde66..5d52f67b3e379e64d23a0429679c144373d20eac 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -198,6 +198,11 @@ public abstract class AbstractArrow extends Projectile { @@ -19810,7 +19809,7 @@ index 778e6476c86d823dc8efe603a95e589e8b2ea9d9..3fc6b4f93885fe447ed068bc5e0784da LevelChunkTicks levelChunkTicks = this.allContainers.get(l); if (levelChunkTicks == null) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ac8af406180bc680d46e8edc3da0fc2e5211345a..7cc63a4a9759d3926f843cfedbc79986d1ece926 100644 +index 97b5d6ba2b19a7c730730c74175a29157aed1840..26e1584557c8ba7b6bdf4a5ca7fc801d2f33fbdf 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -315,7 +315,7 @@ public final class CraftServer implements Server { @@ -19898,10 +19897,10 @@ index ac8af406180bc680d46e8edc3da0fc2e5211345a..7cc63a4a9759d3926f843cfedbc79986 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab355daecf 100644 +index 92d9f0ea8f7810ae20d3996f49aefa539b4bcb69..f5412bdb4e80218de13b6beb62a50181fa2c3271 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -232,7 +232,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -233,7 +233,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public int getTickableTileEntityCount() { @@ -19910,7 +19909,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab } @Override -@@ -299,7 +299,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -300,7 +300,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper start - per world spawn limits for (SpawnCategory spawnCategory : SpawnCategory.values()) { if (CraftSpawnCategory.isValidForLimits(spawnCategory)) { @@ -19919,7 +19918,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab } } // Paper end - per world spawn limits -@@ -369,6 +369,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -370,6 +370,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public Chunk getChunkAt(int x, int z) { @@ -19927,7 +19926,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab warnUnsafeChunk("getting a faraway chunk", x, z); // Paper net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk) this.world.getChunk(x, z, ChunkStatus.FULL, true); return new CraftChunk(chunk); -@@ -399,10 +400,10 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -400,10 +401,10 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean isChunkGenerated(int x, int z) { // Paper start - Fix this method @@ -19940,7 +19939,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab } ChunkAccess chunk = world.getChunkSource().getChunkAtImmediately(x, z); if (chunk != null) { -@@ -459,7 +460,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -460,7 +461,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { } private boolean unloadChunk0(int x, int z, boolean save) { @@ -19949,7 +19948,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab if (!this.isChunkLoaded(x, z)) { return true; } -@@ -476,7 +477,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -477,7 +478,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean regenerateChunk(int x, int z) { @@ -19958,7 +19957,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab throw new UnsupportedOperationException("Not supported in this Minecraft version! Unless you can fix it, this is not a bug :)"); /* if (!unloadChunk0(x, z, false)) { -@@ -503,6 +504,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -504,6 +505,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean refreshChunk(int x, int z) { @@ -19966,7 +19965,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z)); if (playerChunk == null) return false; -@@ -563,7 +565,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -553,7 +555,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean loadChunk(int x, int z, boolean generate) { @@ -19975,7 +19974,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab warnUnsafeChunk("loading a faraway chunk", x, z); // Paper ChunkAccess chunk = this.world.getChunkSource().getChunk(x, z, generate || isChunkGenerated(x, z) ? ChunkStatus.FULL : ChunkStatus.EMPTY, true); // Paper -@@ -604,7 +606,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -594,7 +596,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; if (chunkDistanceManager.addRegionTicketAtDistance(TicketType.PLUGIN_TICKET, new ChunkPos(x, z), 2, plugin)) { // keep in-line with force loading, add at level 31 @@ -19984,7 +19983,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab return true; } -@@ -815,13 +817,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -805,13 +807,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) { @@ -20005,7 +20004,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab BlockPos position = ((CraftBlockState) blockstate).getPosition(); net.minecraft.world.level.block.state.BlockState oldBlock = this.world.getBlockState(position); int flag = ((CraftBlockState) blockstate).getFlag(); -@@ -829,10 +833,10 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -819,10 +823,10 @@ public class CraftWorld extends CraftRegionAccessor implements World { net.minecraft.world.level.block.state.BlockState newBlock = this.world.getBlockState(position); this.world.notifyAndUpdatePhysics(position, null, oldBlock, newBlock, newBlock, flag, 512); } @@ -20018,7 +20017,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab return false; } } -@@ -866,6 +870,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -856,6 +860,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setTime(long time) { @@ -20026,7 +20025,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab long margin = (time - this.getFullTime()) % 24000; if (margin < 0) margin += 24000; this.setFullTime(this.getFullTime() + margin); -@@ -878,6 +883,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -868,6 +873,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setFullTime(long time) { @@ -20034,7 +20033,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab // Notify anyone who's listening TimeSkipEvent event = new TimeSkipEvent(this, TimeSkipEvent.SkipReason.CUSTOM, time - this.world.getDayTime()); this.server.getPluginManager().callEvent(event); -@@ -905,7 +911,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -895,7 +901,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public long getGameTime() { @@ -20043,7 +20042,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab } @Override -@@ -930,6 +936,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -920,6 +926,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { } public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source, Consumer configurator) { // Paper end - expand explosion API @@ -20051,7 +20050,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab net.minecraft.world.level.Level.ExplosionInteraction explosionType; if (!breakBlocks) { explosionType = net.minecraft.world.level.Level.ExplosionInteraction.NONE; // Don't break blocks -@@ -939,6 +946,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -929,6 +936,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { explosionType = net.minecraft.world.level.Level.ExplosionInteraction.MOB; // Respect mobGriefing gamerule } @@ -20059,7 +20058,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab net.minecraft.world.entity.Entity entity = (source == null) ? null : ((CraftEntity) source).getHandle(); return !this.world.explode0(entity, Explosion.getDefaultDamageSource(this.world, entity), null, x, y, z, power, setFire, explosionType, ParticleTypes.EXPLOSION, ParticleTypes.EXPLOSION_EMITTER, SoundEvents.GENERIC_EXPLODE, configurator).wasCanceled; // Paper - expand explosion API } -@@ -1021,6 +1029,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1011,6 +1019,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) { @@ -20067,7 +20066,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab warnUnsafeChunk("getting a faraway chunk", x >> 4, z >> 4); // Paper // Transient load for this tick return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z); -@@ -1051,6 +1060,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1041,6 +1050,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setBiome(int x, int y, int z, Holder bb) { BlockPos pos = new BlockPos(x, 0, z); @@ -20075,7 +20074,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab if (this.world.hasChunkAt(pos)) { net.minecraft.world.level.chunk.LevelChunk chunk = this.world.getChunkAt(pos); -@@ -1361,6 +1371,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1351,6 +1361,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setStorm(boolean hasStorm) { @@ -20083,7 +20082,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.world.serverLevelData.setRaining(hasStorm, org.bukkit.event.weather.WeatherChangeEvent.Cause.PLUGIN); // Paper - Add cause to Weather/ThunderChangeEvents this.setWeatherDuration(0); // Reset weather duration (legacy behaviour) this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands) -@@ -1373,6 +1384,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1363,6 +1374,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setWeatherDuration(int duration) { @@ -20091,7 +20090,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.world.serverLevelData.setRainTime(duration); } -@@ -1383,6 +1395,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1373,6 +1385,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setThundering(boolean thundering) { @@ -20099,7 +20098,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.world.serverLevelData.setThundering(thundering, org.bukkit.event.weather.ThunderChangeEvent.Cause.PLUGIN); // Paper - Add cause to Weather/ThunderChangeEvents this.setThunderDuration(0); // Reset weather duration (legacy behaviour) this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands) -@@ -1395,6 +1408,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1385,6 +1398,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setThunderDuration(int duration) { @@ -20107,7 +20106,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.world.serverLevelData.setThunderTime(duration); } -@@ -1405,6 +1419,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1395,6 +1409,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setClearWeatherDuration(int duration) { @@ -20115,7 +20114,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.world.serverLevelData.setClearWeatherTime(duration); } -@@ -1603,6 +1618,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1593,6 +1608,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setKeepSpawnInMemory(boolean keepLoaded) { @@ -20123,7 +20122,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab if (keepLoaded) { this.setGameRule(GameRule.SPAWN_CHUNK_RADIUS, this.getGameRuleDefault(GameRule.SPAWN_CHUNK_RADIUS)); } else { -@@ -1671,6 +1687,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1661,6 +1677,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setHardcore(boolean hardcore) { @@ -20131,7 +20130,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.world.serverLevelData.settings.hardcore = hardcore; } -@@ -1683,6 +1700,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1673,6 +1690,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns) { @@ -20139,7 +20138,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.setTicksPerSpawns(SpawnCategory.ANIMAL, ticksPerAnimalSpawns); } -@@ -1695,6 +1713,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1685,6 +1703,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) { @@ -20147,7 +20146,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.setTicksPerSpawns(SpawnCategory.MONSTER, ticksPerMonsterSpawns); } -@@ -1707,6 +1726,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1697,6 +1716,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) { @@ -20155,7 +20154,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.setTicksPerSpawns(SpawnCategory.WATER_ANIMAL, ticksPerWaterSpawns); } -@@ -1719,6 +1739,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1709,6 +1729,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerWaterAmbientSpawns(int ticksPerWaterAmbientSpawns) { @@ -20163,7 +20162,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.setTicksPerSpawns(SpawnCategory.WATER_AMBIENT, ticksPerWaterAmbientSpawns); } -@@ -1731,6 +1752,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1721,6 +1742,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns) { @@ -20171,7 +20170,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.setTicksPerSpawns(SpawnCategory.WATER_UNDERGROUND_CREATURE, ticksPerWaterUndergroundCreatureSpawns); } -@@ -1743,11 +1765,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1733,11 +1755,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns) { @@ -20185,7 +20184,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null"); Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory); -@@ -1764,21 +1788,25 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1754,21 +1778,25 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setMetadata(String metadataKey, MetadataValue newMetadataValue) { @@ -20211,7 +20210,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.server.getWorldMetadata().removeMetadata(this, metadataKey, owningPlugin); } -@@ -1791,6 +1819,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1781,6 +1809,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setMonsterSpawnLimit(int limit) { @@ -20219,7 +20218,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.setSpawnLimit(SpawnCategory.MONSTER, limit); } -@@ -1803,6 +1832,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1793,6 +1822,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setAnimalSpawnLimit(int limit) { @@ -20227,7 +20226,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.setSpawnLimit(SpawnCategory.ANIMAL, limit); } -@@ -1815,6 +1845,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1805,6 +1835,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setWaterAnimalSpawnLimit(int limit) { @@ -20235,7 +20234,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.setSpawnLimit(SpawnCategory.WATER_ANIMAL, limit); } -@@ -1827,6 +1858,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1817,6 +1848,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setWaterAmbientSpawnLimit(int limit) { @@ -20243,7 +20242,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.setSpawnLimit(SpawnCategory.WATER_AMBIENT, limit); } -@@ -1839,6 +1871,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1829,6 +1861,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setWaterUndergroundCreatureSpawnLimit(int limit) { @@ -20251,7 +20250,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.setSpawnLimit(SpawnCategory.WATER_UNDERGROUND_CREATURE, limit); } -@@ -1851,6 +1884,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1841,6 +1874,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setAmbientSpawnLimit(int limit) { @@ -20259,7 +20258,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab this.setSpawnLimit(SpawnCategory.AMBIENT, limit); } -@@ -1873,6 +1907,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1863,6 +1897,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setSpawnLimit(SpawnCategory spawnCategory, int limit) { @@ -20267,7 +20266,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null"); Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory); -@@ -1955,7 +1990,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1945,7 +1980,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!(entity instanceof CraftEntity craftEntity) || entity.getWorld() != this || sound == null || category == null) return; ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(CraftSound.bukkitToMinecraftHolder(sound), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed); @@ -20276,7 +20275,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab if (entityTracker != null) { entityTracker.broadcastAndSend(packet); } -@@ -1976,7 +2011,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1966,7 +2001,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!(entity instanceof CraftEntity craftEntity) || entity.getWorld() != this || sound == null || category == null) return; ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(Holder.direct(SoundEvent.createVariableRangeEvent(ResourceLocation.parse(sound))), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed); @@ -20285,7 +20284,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab if (entityTracker != null) { entityTracker.broadcastAndSend(packet); } -@@ -2059,6 +2094,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2049,6 +2084,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean setGameRuleValue(String rule, String value) { @@ -20293,7 +20292,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab // No null values allowed if (rule == null || value == null) return false; -@@ -2101,6 +2137,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2091,6 +2127,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean setGameRule(GameRule rule, T newValue) { @@ -20301,7 +20300,7 @@ index a9f7ac8d1f5e184687d53ab3e8b348bb7f4f2ba0..ec70a4dcb9f12d55af039c008bfe47ab Preconditions.checkArgument(rule != null, "GameRule cannot be null"); Preconditions.checkArgument(newValue != null, "GameRule value cannot be null"); -@@ -2327,6 +2364,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2317,6 +2354,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void sendGameEvent(Entity sourceEntity, org.bukkit.GameEvent gameEvent, Vector position) { @@ -20696,10 +20695,10 @@ index b25b10c24a379097233e61bcc10add841b6a7115..5168cf0d58013aecfd80d37fb698014f return java.util.Collections.emptySet(); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 84c494ca81b8f58604b372ac7236147776817a4f..5ebcd6b8edc76572a3fffead4735fd5824a083f1 100644 +index 20f64850cb42d986358f01ffcdb42187e1684bca..60053f73f1992f4a11edb6af89f31574bcc32fc7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -656,7 +656,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -657,7 +657,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void kickPlayer(String message) { @@ -20708,7 +20707,7 @@ index 84c494ca81b8f58604b372ac7236147776817a4f..5ebcd6b8edc76572a3fffead4735fd58 this.getHandle().transferCookieConnection.kickPlayer(CraftChatMessage.fromStringOrEmpty(message, true), org.bukkit.event.player.PlayerKickEvent.Cause.PLUGIN); // Paper - kick event cause } -@@ -1412,6 +1412,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1413,6 +1413,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public boolean teleport(Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause, io.papermc.paper.entity.TeleportFlag... flags) { @@ -20720,7 +20719,7 @@ index 84c494ca81b8f58604b372ac7236147776817a4f..5ebcd6b8edc76572a3fffead4735fd58 Set relativeArguments; Set allFlags; if (flags.length == 0) { -@@ -2076,7 +2081,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2077,7 +2082,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private void unregisterEntity(Entity other) { // Paper end ChunkMap tracker = ((ServerLevel) this.getHandle().level()).getChunkSource().chunkMap; @@ -20729,7 +20728,7 @@ index 84c494ca81b8f58604b372ac7236147776817a4f..5ebcd6b8edc76572a3fffead4735fd58 if (entry != null) { entry.removePlayer(this.getHandle()); } -@@ -2173,7 +2178,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2174,7 +2179,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (original != null) otherPlayer.setUUID(original); // Paper - uuid override } @@ -20738,7 +20737,7 @@ index 84c494ca81b8f58604b372ac7236147776817a4f..5ebcd6b8edc76572a3fffead4735fd58 if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) { entry.updatePlayer(this.getHandle()); } -@@ -3354,7 +3359,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3355,7 +3360,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { { if ( CraftPlayer.this.getHealth() <= 0 && CraftPlayer.this.isOnline() ) { diff --git a/patches/server/0006-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch b/patches/server/0006-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch index 73a3c63cc..f7164fd19 100644 --- a/patches/server/0006-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch +++ b/patches/server/0006-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch @@ -29,7 +29,7 @@ index 41bf71d116ffc5431586ce54abba7f8def6c1dcf..1cf9a7677449ab8f03fb23d835e3fadc } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 75929ae02677637500229b7b635479f92e3bd177..20fe53cc8e9edfc7b7d50f23379e0044e520c84d 100644 +index faa1135996a3afccbf45c84059090248703b98ac..f86415bf2721835e6108408ebf05221fa17d854e 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -3244,6 +3244,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2288,10 +2288,10 @@ index 2638c341bc02f201f7ab17fdebcdbdf3a7ec05bf..074b2919be2b5544b0a46e6cd32f6c57 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5ebcd6b8edc76572a3fffead4735fd5824a083f1..95047bf77be54af6968a6e77f13dd01aa989b4d8 100644 +index 60053f73f1992f4a11edb6af89f31574bcc32fc7..e88f197dfc0e4ec06f0360ebe18914cf57d5bdf8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -674,7 +674,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -675,7 +675,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void kick(net.kyori.adventure.text.Component message, org.bukkit.event.player.PlayerKickEvent.Cause cause) { @@ -2300,7 +2300,7 @@ index 5ebcd6b8edc76572a3fffead4735fd5824a083f1..95047bf77be54af6968a6e77f13dd01a final ServerGamePacketListenerImpl connection = this.getHandle().connection; if (connection != null) { connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message, cause); -@@ -2327,9 +2327,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2328,9 +2328,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this; } diff --git a/patches/server/0007-Throw-UnsupportedOperationException-for-broken-APIs.patch b/patches/server/0007-Throw-UnsupportedOperationException-for-broken-APIs.patch index 696fdaea7..c18ada1cc 100644 --- a/patches/server/0007-Throw-UnsupportedOperationException-for-broken-APIs.patch +++ b/patches/server/0007-Throw-UnsupportedOperationException-for-broken-APIs.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Throw UnsupportedOperationException() for broken APIs diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7cc63a4a9759d3926f843cfedbc79986d1ece926..a8975cee866cf2c617b6d4976df71e5c20cf0e3d 100644 +index 26e1584557c8ba7b6bdf4a5ca7fc801d2f33fbdf..567e12e24ece2cd823b73e7337b10eb89995da21 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1320,6 +1320,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0012-Skip-worldstate-access-when-waking-players-up-during.patch b/patches/server/0012-Skip-worldstate-access-when-waking-players-up-during.patch index ca1c664ed..96a10c4d8 100644 --- a/patches/server/0012-Skip-worldstate-access-when-waking-players-up-during.patch +++ b/patches/server/0012-Skip-worldstate-access-when-waking-players-up-during.patch @@ -9,7 +9,7 @@ data deserialization and is racey even in Vanilla. But in Folia, some accesses may throw and as such we need to fix this directly. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index ea3b3f624ab9f4fbdc6ff4e90076b5616728f6ca..759eb33a5b63cae7913907f06e67e0736f50dc13 100644 +index 44c8d196b31c84ff6179d345808a10c0604206ad..93a341618bf53900d143f429b94ea295dd973f2c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -794,7 +794,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple diff --git a/patches/server/0016-Sync-vehicle-position-to-player-position-on-player-d.patch b/patches/server/0016-Sync-vehicle-position-to-player-position-on-player-d.patch index 9f1aedbe6..e8c9838a5 100644 --- a/patches/server/0016-Sync-vehicle-position-to-player-position-on-player-d.patch +++ b/patches/server/0016-Sync-vehicle-position-to-player-position-on-player-d.patch @@ -7,7 +7,7 @@ This allows the player to be re-positioned before logging into the world without causing thread checks to trip on Folia. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 759eb33a5b63cae7913907f06e67e0736f50dc13..b6f3078fa688ca61cfd45d856b95c160cfe7b2da 100644 +index 93a341618bf53900d143f429b94ea295dd973f2c..b7fe3a1119f927bf4fb4d5855f758a16a76ec779 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -920,7 +920,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple diff --git a/patches/server/0017-Region-profiler.patch b/patches/server/0017-Region-profiler.patch index b39e57330..78cb6f5a0 100644 --- a/patches/server/0017-Region-profiler.patch +++ b/patches/server/0017-Region-profiler.patch @@ -1463,10 +1463,10 @@ index d6eb8f495688a1b65a4c419aa3ee655cd8eb322a..f338b273613840ed366ab13b528373e7 if (exception instanceof ReportedException) { ReportedException reportedexception = (ReportedException) exception; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 9fa5c1628f2df441de47a38e732e7b033c3e2448..be6dc4c066efd66279301f5796451105e323089a 100644 +index 25b4b0d531f0698338ffeac686013a4631d60c00..1676c4abb3f6f71bb7b25351aa58b4e127786fca 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1714,6 +1714,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && io.papermc.paper.threadedregions.RegionizedServer.getCurrentTick() % autosavePeriod == 0; // Folia - region threading @@ -1519,7 +1519,7 @@ index 9fa5c1628f2df441de47a38e732e7b033c3e2448..be6dc4c066efd66279301f5796451105 try { this.isSaving = true; if (playerSaveInterval > 0) { -@@ -1819,6 +1831,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop