From fa018cc37228f81347c5824274bd1e31c123be13 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 13 Jun 2023 14:24:31 -0700 Subject: [PATCH] Update to 1.20.1 No changes to note --- gradle.properties | 6 +- patches/api/0002-Region-scheduler-API.patch | 8 +- ...king-ownership-of-region-by-position.patch | 8 +- patches/server/0001-Build-changes.patch | 14 +- patches/server/0003-Threaded-Regions.patch | 367 +++++++++--------- patches/server/0004-Max-pending-logins.patch | 2 +- ...-getHandle-and-overrides-perform-thr.patch | 66 ++-- ...0007-Disable-mid-tick-task-execution.patch | 4 +- ...edOperationException-for-broken-APIs.patch | 26 +- ...s-github.com-PaperMC-paperweight-iss.patch | 2 +- ...access-when-waking-players-up-during.patch | 6 +- 11 files changed, 255 insertions(+), 254 deletions(-) diff --git a/gradle.properties b/gradle.properties index 2feb846..0fa4eb2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ group=dev.folia -version=1.20-R0.1-SNAPSHOT -mcVersion=1.20 -paperRef=bc3496ea58f8f66c8d0af8ceff317d28f18ab0f6 +version=1.20.1-R0.1-SNAPSHOT +mcVersion=1.20.1 +paperRef=2e363c73ba3c0a7b3d5138ec55a6e93c7befb5bb org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/api/0002-Region-scheduler-API.patch b/patches/api/0002-Region-scheduler-API.patch index bcd4c2e..e8f4d80 100644 --- a/patches/api/0002-Region-scheduler-API.patch +++ b/patches/api/0002-Region-scheduler-API.patch @@ -485,10 +485,10 @@ index 0000000000000000000000000000000000000000..a6b50c9d8af589cc4747e14d343d2045 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index b0bc2df41506770e2854a287813f1c53f003eda1..dc94b729179b0590fe53658a7c98030933993082 100644 +index ef36d793ab77c7b7208f8f5994815599cff470d1..fdf5597804640839c3d92b5e7ee55a3388a63592 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2478,6 +2478,44 @@ public final class Bukkit { +@@ -2495,6 +2495,44 @@ public final class Bukkit { return server.getPotionBrewer(); } // Paper end @@ -534,10 +534,10 @@ index b0bc2df41506770e2854a287813f1c53f003eda1..dc94b729179b0590fe53658a7c980309 @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 1d1a1d087dabc9794e0062a064da2cced4062309..33426325abc9d63cc473b0e017044a3b72356069 100644 +index 5b225bbb128893d67251a96ab318035802a0cf76..52e900cdd06b6927646f82f779c19aa7dc1e5c1e 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -2162,4 +2162,36 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2175,4 +2175,36 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ @NotNull org.bukkit.potion.PotionBrewer getPotionBrewer(); // Paper end 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 d226336..56c65f4 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,10 +11,10 @@ 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 dc94b729179b0590fe53658a7c98030933993082..dc27f6be4e89be464bc100eb849ffe063464ebdc 100644 +index fdf5597804640839c3d92b5e7ee55a3388a63592..db1944bc41ab0bae9b825c7839e8d1ee86eddff0 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2515,6 +2515,107 @@ public final class Bukkit { +@@ -2532,6 +2532,107 @@ public final class Bukkit { public static @NotNull io.papermc.paper.threadedregions.scheduler.GlobalRegionScheduler getGlobalRegionScheduler() { return server.getGlobalRegionScheduler(); } @@ -123,10 +123,10 @@ index dc94b729179b0590fe53658a7c98030933993082..dc27f6be4e89be464bc100eb849ffe06 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 33426325abc9d63cc473b0e017044a3b72356069..5e427d5c5ce58927eb87b4f4f2466a27e70bc7c1 100644 +index 52e900cdd06b6927646f82f779c19aa7dc1e5c1e..1ef4cf3b19d58565e052829358eb5902f070ae02 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -2193,5 +2193,90 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2206,5 +2206,90 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @return the global region scheduler */ public @NotNull io.papermc.paper.threadedregions.scheduler.GlobalRegionScheduler getGlobalRegionScheduler(); diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch index 210a385..f3d8fbf 100644 --- a/patches/server/0001-Build-changes.patch +++ b/patches/server/0001-Build-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Build changes diff --git a/build.gradle.kts b/build.gradle.kts -index e7a03ea1dab56e7725f718da0b44c736018ac995..59bc7ef3d26d3fb3bc7a0d79861acd68e5062fe6 100644 +index a0c5592530d2a59bfde87d1e9eb3752e7d4694da..0bbdb3f47b674d0553eaf083b709f1ded3b5bff7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,8 +7,12 @@ plugins { @@ -23,7 +23,7 @@ index e7a03ea1dab56e7725f718da0b44c736018ac995..59bc7ef3d26d3fb3bc7a0d79861acd68 // Paper start implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("net.minecrell:terminalconsoleappender:1.3.0") -@@ -62,7 +66,7 @@ tasks.jar { +@@ -63,7 +67,7 @@ tasks.jar { attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", "Implementation-Title" to "CraftBukkit", @@ -32,7 +32,7 @@ index e7a03ea1dab56e7725f718da0b44c736018ac995..59bc7ef3d26d3fb3bc7a0d79861acd68 "Implementation-Vendor" to date, // Paper "Specification-Title" to "Bukkit", "Specification-Version" to project.version, -@@ -134,7 +138,7 @@ fun TaskContainer.registerRunTask( +@@ -135,7 +139,7 @@ fun TaskContainer.registerRunTask( name: String, block: JavaExec.() -> Unit ): TaskProvider = register(name) { @@ -88,10 +88,10 @@ index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..e2f704c115fd6e00960bb56bb0779f11 ).openBufferedStream()) { JsonObject json = new Gson().fromJson(reader, JsonObject.class); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fb82bb52f219e7683fe1d3c0fb3acbe2251de8d4..cdb9925e8c4771831a7fe8bbcb705278c51aa0d2 100644 +index 80cf4852e4010eeeadaf920ab927a40df0179b40..c7a762abdfdc88fd26ec751c34e7b42bb3514515 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> { @@ -11152,7 +11152,7 @@ index c45c1d519aba414557bf1a4c9260f928bd8d9b14..cf9719ae27d7f11a23637f2507da79b1 private Component disconnectedReason; private boolean encrypted; private boolean disconnectionHandled; -@@ -177,6 +177,32 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -179,6 +179,32 @@ public class Connection extends SimpleChannelInboundHandler> { this.receiving = side; } @@ -11185,15 +11185,16 @@ index c45c1d519aba414557bf1a4c9260f928bd8d9b14..cf9719ae27d7f11a23637f2507da79b1 public void channelActive(ChannelHandlerContext channelhandlercontext) throws Exception { super.channelActive(channelhandlercontext); this.channel = channelhandlercontext.channel(); -@@ -191,6 +217,7 @@ public class Connection extends SimpleChannelInboundHandler> { - Connection.LOGGER.error(LogUtils.FATAL_MARKER, "Failed to change protocol to handshake", throwable); +@@ -196,7 +222,7 @@ public class Connection extends SimpleChannelInboundHandler> { + if (this.delayedDisconnect != null) { + this.disconnect(this.delayedDisconnect); } - +- + this.becomeActive = true; // Folia - region threading } public void setProtocol(ConnectionProtocol state) { -@@ -376,13 +403,6 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -382,13 +408,6 @@ public class Connection extends SimpleChannelInboundHandler> { return; // Do nothing } packet.onPacketDispatch(getPlayer()); @@ -11207,7 +11208,7 @@ index c45c1d519aba414557bf1a4c9260f928bd8d9b14..cf9719ae27d7f11a23637f2507da79b1 // write the packets to the queue, then flush - antixray hooks there already java.util.List extraPackets = InnerUtil.buildExtraPackets(packet); boolean hasExtraPackets = extraPackets != null && !extraPackets.isEmpty(); -@@ -504,66 +524,58 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -510,66 +529,58 @@ public class Connection extends SimpleChannelInboundHandler> { // Paper start - rewrite this to be safer if ran off main thread private boolean flushQueue() { // void -> boolean @@ -11267,11 +11268,7 @@ index c45c1d519aba414557bf1a4c9260f928bd8d9b14..cf9719ae27d7f11a23637f2507da79b1 - } - // Paper end - checking isConsumed flag and skipping packet sending + boolean justFlushed = true; - -- Packet packet = queued.packet; -- if (!packet.isReady()) { -- // Paper start - make only one flush call per sendPacketQueue() call -- if (hasWrotePacket && (needsFlush || this.canFlush)) { ++ + PacketHolder holder; + for (;;) { + // synchronise so that queue clears appear atomic @@ -11286,7 +11283,11 @@ index c45c1d519aba414557bf1a4c9260f928bd8d9b14..cf9719ae27d7f11a23637f2507da79b1 + justFlushed = (!this.canWritePackets() && (needsFlush || this.canFlush)); + this.sendPacket(holder.packet, holder.listener, justFlushed ? Boolean.TRUE : Boolean.FALSE); // Paper - make only one flush call per sendPacketQueue() call + } -+ + +- Packet packet = queued.packet; +- if (!packet.isReady()) { +- // Paper start - make only one flush call per sendPacketQueue() call +- if (hasWrotePacket && (needsFlush || this.canFlush)) { + if (!justFlushed) { this.flush(); } @@ -11313,7 +11314,7 @@ index c45c1d519aba414557bf1a4c9260f928bd8d9b14..cf9719ae27d7f11a23637f2507da79b1 } // Paper end -@@ -572,21 +584,41 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -578,21 +589,41 @@ public class Connection extends SimpleChannelInboundHandler> { private static int currTick; // Paper public void tick() { this.flushQueue(); @@ -11363,7 +11364,7 @@ index c45c1d519aba414557bf1a4c9260f928bd8d9b14..cf9719ae27d7f11a23637f2507da79b1 // Paper start - detailed watchdog information net.minecraft.network.protocol.PacketUtils.packetProcessing.push(this.packetListener); try { // Paper end - detailed watchdog information -@@ -626,13 +658,21 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -632,13 +663,21 @@ public class Connection extends SimpleChannelInboundHandler> { // Paper start public void clearPacketQueue() { net.minecraft.server.level.ServerPlayer player = getPlayer(); @@ -11388,7 +11389,7 @@ index c45c1d519aba414557bf1a4c9260f928bd8d9b14..cf9719ae27d7f11a23637f2507da79b1 } // Paper end public void disconnect(Component disconnectReason) { -@@ -644,6 +684,7 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -654,6 +693,7 @@ public class Connection extends SimpleChannelInboundHandler> { this.channel.close(); // We can't wait as this may be called from an event loop. this.disconnectedReason = disconnectReason; } @@ -11396,7 +11397,7 @@ index c45c1d519aba414557bf1a4c9260f928bd8d9b14..cf9719ae27d7f11a23637f2507da79b1 } -@@ -806,13 +847,27 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -822,13 +862,27 @@ public class Connection extends SimpleChannelInboundHandler> { final net.minecraft.server.network.ServerGamePacketListenerImpl playerConnection = (net.minecraft.server.network.ServerGamePacketListenerImpl) packetListener; new com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent(playerConnection.player.getUUID(), playerConnection.player.getScoreboardName(), ((java.net.InetSocketAddress)address).getAddress(), false).callEvent(); @@ -11469,7 +11470,7 @@ 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 cdb9925e8c4771831a7fe8bbcb705278c51aa0d2..ff48c19ce668ed584d0e55787c665a2a3b77f889 100644 +index c7a762abdfdc88fd26ec751c34e7b42bb3514515..26d332a46556416bb70b6276786b43e1a8ec8449 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -242,7 +242,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -308,12 +308,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 -@@ -605,7 +633,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return worldserver + " " + worldserver.dimension().location(); -@@ -1542,7 +1675,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); -@@ -1613,7 +1640,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1616,7 +1643,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // 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()) { @@ -16653,7 +16654,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c return; } -@@ -1827,9 +1854,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1830,9 +1857,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic 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. @@ -16665,7 +16666,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c } else { // Else we increment the drop count and check the amount. this.dropCount++; -@@ -1857,7 +1884,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1860,7 +1887,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic case ABORT_DESTROY_BLOCK: case STOP_DESTROY_BLOCK: // Paper start - Don't allow digging in unloaded chunks @@ -16674,7 +16675,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c this.player.connection.ackBlockChangesUpTo(packet.getSequence()); return; } -@@ -1941,7 +1968,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1944,7 +1971,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic BlockPos blockposition = movingobjectpositionblock.getBlockPos(); Vec3 vec3d1 = Vec3.atCenterOf(blockposition); @@ -16683,7 +16684,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c Vec3 vec3d2 = vec3d.subtract(vec3d1); double d0 = 1.0000001D; -@@ -2054,7 +2081,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2057,7 +2084,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic Entity entity = packet.getEntity(worldserver); if (entity != null) { @@ -16692,7 +16693,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c return; } } -@@ -2117,6 +2144,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2120,6 +2147,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic 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 @@ -16701,7 +16702,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c if ((quitMessage != null) && !quitMessage.equals(net.kyori.adventure.text.Component.empty())) { this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); // Paper end -@@ -2202,9 +2231,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2205,9 +2234,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } // CraftBukkit end if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) { @@ -16713,7 +16714,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c } else { Optional optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages()); -@@ -2238,23 +2267,22 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2241,23 +2270,22 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleChatCommand(ServerboundChatCommandPacket packet) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) { @@ -16741,7 +16742,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c } } -@@ -2328,9 +2356,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2331,9 +2359,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private Optional tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { if (!this.updateChatOrder(timestamp)) { ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper @@ -16753,7 +16754,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c return Optional.empty(); } else { Optional optional = this.unpackAndApplyLastSeen(acknowledgment); -@@ -2405,7 +2433,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2408,7 +2436,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic String originalFormat = event.getFormat(), originalMessage = event.getMessage(); this.cserver.getPluginManager().callEvent(event); @@ -16762,7 +16763,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c // Evil plugins still listening to deprecated event final PlayerChatEvent queueEvent = new PlayerChatEvent(player, event.getMessage(), event.getFormat(), event.getRecipients()); queueEvent.setCancelled(event.isCancelled()); -@@ -2483,6 +2511,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2486,6 +2514,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic public void handleCommand(String s) { // Paper - private -> public // Paper Start if (!org.spigotmc.AsyncCatcher.shuttingDown && !org.bukkit.Bukkit.isPrimaryThread()) { @@ -16770,7 +16771,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c LOGGER.error("Command Dispatched Async: " + s); LOGGER.error("Please notify author of plugin causing this execution to fix this bug! see: http://bit.ly/1oSiM6C", new Throwable()); Waitable wait = new Waitable<>() { -@@ -2543,6 +2572,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2546,6 +2575,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (s.isEmpty()) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message"); } else if (this.getCraftPlayer().isConversing()) { @@ -16778,7 +16779,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c final String conversationInput = s; this.server.processQueue.add(new Runnable() { @Override -@@ -2784,7 +2814,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2787,7 +2817,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.player.resetLastActionTime(); this.player.setShiftKeyDown(packet.isUsingSecondaryAction()); @@ -16787,7 +16788,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c if (!worldserver.getWorldBorder().isWithinBounds(entity.blockPosition())) { return; } -@@ -2924,6 +2954,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2927,6 +2957,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic switch (packetplayinclientcommand_enumclientcommand) { case PERFORM_RESPAWN: if (this.player.wonGame) { @@ -16800,7 +16801,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c this.player.wonGame = false; this.player = this.server.getPlayerList().respawn(this.player, this.server.getLevel(this.player.getRespawnDimension()), true, null, true, RespawnReason.END_PORTAL, org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag.END_PORTAL); // Paper - add isEndCreditsRespawn argument CriteriaTriggers.CHANGED_DIMENSION.trigger(this.player, Level.END, Level.OVERWORLD); -@@ -2932,6 +2968,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2935,6 +2971,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return; } @@ -16819,7 +16820,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH); if (this.server.isHardcore()) { this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper -@@ -3285,7 +3333,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3288,7 +3336,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // Paper start if (!org.bukkit.Bukkit.isPrimaryThread()) { if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { @@ -16828,7 +16829,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c return; } } -@@ -3427,7 +3475,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3430,7 +3478,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.filterTextPacket(list).thenAcceptAsync((list1) -> { this.updateSignText(packet, list1); @@ -16848,7 +16849,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..f461db9abd9a7d9bed145cd1a053835c } private void updateSignText(ServerboundSignUpdatePacket packet, List signText) { -@@ -3460,9 +3519,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3463,9 +3522,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.keepAlivePending = false; } else if (!this.isSingleplayerOwner()) { // Paper start - This needs to be handled on the main thread for plugins @@ -17069,7 +17070,7 @@ index 7edd4b88eb0476f0630630bc4681e859bd145b2b..f3586a5c5b5d4cae817aa7c15fc0c2fc date1 = fallback; } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 683b5d78f9e3dc34e40c54683f64be32317797ac..fc58f714b069453b5f6d2f0ca801fbe1beef07aa 100644 +index 8547e7ff2f1f5b7701fb0f3c3010c14601a5f83e..5b4e7e22b0e989b7d19b0b28cf74e08acacd1fa1 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -139,10 +139,10 @@ public abstract class PlayerList { @@ -17627,7 +17628,7 @@ index 25a5a3b949a0eb632611355e74ccd4865be108ca..1df8d601e41c2ab35921b6a1534fdec6 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 92202262eff01ae3bbeff0e6ebdcf26ad613c169..4e78647f1bba68741eeef08a85caf2d053436472 100644 +index b38c4cbcf0405d82c7b6e018e80a3174e460c1a4..37b90c70196717c3a68b6d3b652e5716ab89998c 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -166,7 +166,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -18677,7 +18678,7 @@ index 92202262eff01ae3bbeff0e6ebdcf26ad613c169..4e78647f1bba68741eeef08a85caf2d0 public void unsetRemoved() { this.removalReason = null; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 67627bbf84f5aab2872f636b1dcb6728c8494147..7da79a21f5ff0bd546cfc602099916dac2ab0e51 100644 +index a189461330a4d427a7450d504ef13de3605497e3..99192dd2da243b3e5992adcef525c500dd9db958 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -482,7 +482,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -18726,7 +18727,7 @@ index 67627bbf84f5aab2872f636b1dcb6728c8494147..7da79a21f5ff0bd546cfc602099916da if (this.isTickingEffects) { this.effectsToProcess.add(new ProcessableEffect(mobeffect, cause)); return true; -@@ -2307,7 +2309,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2310,7 +2312,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @Nullable public LivingEntity getKillCredit() { @@ -18735,7 +18736,7 @@ index 67627bbf84f5aab2872f636b1dcb6728c8494147..7da79a21f5ff0bd546cfc602099916da } public final float getMaxHealth() { -@@ -3443,7 +3445,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3446,7 +3448,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.pushEntities(); this.level().getProfiler().pop(); // Paper start @@ -18744,7 +18745,7 @@ index 67627bbf84f5aab2872f636b1dcb6728c8494147..7da79a21f5ff0bd546cfc602099916da if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { Location from = new Location(this.level().getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO); Location to = new Location (this.level().getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot()); -@@ -4103,7 +4105,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4106,7 +4108,7 @@ public abstract class LivingEntity extends Entity implements Attackable { BlockPos blockposition = BlockPos.containing(d0, d1, d2); Level world = this.level(); @@ -23073,10 +23074,10 @@ index 1d7c663fa0e550bd0cfb9a4b83ccd7e2968666f0..f3df9c9b6cff85565514f990597f3fe5 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 c927ff1250e6bc7b1fbdfa80b189dc9efc471a1e..a2e688607194167ebf9ca646561d61b41f2ff915 100644 +index 9987df6c0ef96a2600298d2be4e57137ee201c1c..e35777b6501fa8290176b757b08893490322dd25 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -310,6 +310,82 @@ public final class CraftServer implements Server { +@@ -309,6 +309,82 @@ public final class CraftServer implements Server { CraftItemFactory.instance(); } @@ -23196,8 +23197,8 @@ index c927ff1250e6bc7b1fbdfa80b189dc9efc471a1e..a2e688607194167ebf9ca646561d61b4 + @Override public boolean dispatchCommand(CommandSender sender, String commandLine) { - Validate.notNull(sender, "Sender cannot be null"); - Validate.notNull(commandLine, "CommandLine cannot be null"); + Preconditions.checkArgument(sender != null, "sender cannot be null"); + Preconditions.checkArgument(commandLine != null, "commandLine cannot be null"); org.spigotmc.AsyncCatcher.catchOp("command dispatch"); // Spigot + // Folia start - region threading @@ -23214,7 +23215,7 @@ index c927ff1250e6bc7b1fbdfa80b189dc9efc471a1e..a2e688607194167ebf9ca646561d61b4 // Paper Start if (!org.spigotmc.AsyncCatcher.shuttingDown && !Bukkit.isPrimaryThread()) { final CommandSender fSender = sender; -@@ -2947,7 +3058,7 @@ public final class CraftServer implements Server { +@@ -2964,7 +3075,7 @@ public final class CraftServer implements Server { @Override public int getCurrentTick() { @@ -23224,10 +23225,10 @@ index c927ff1250e6bc7b1fbdfa80b189dc9efc471a1e..a2e688607194167ebf9ca646561d61b4 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d8c0ccd85 100644 +index 1a481fb4f4228f0fea8a7dc6132248c98b727c90..23b8dde3cd185b372d4adc97201a422cebbbe804 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -184,7 +184,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -183,7 +183,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public int getTickableTileEntityCount() { @@ -23236,7 +23237,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d } @Override -@@ -241,7 +241,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -240,7 +240,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper start - per world spawn limits for (SpawnCategory spawnCategory : SpawnCategory.values()) { if (CraftSpawnCategory.isValidForLimits(spawnCategory)) { @@ -23245,7 +23246,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d } } // Paper end -@@ -328,6 +328,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -327,6 +327,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public Chunk getChunkAt(int x, int z) { @@ -23253,7 +23254,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d warnUnsafeChunk("getting a faraway chunk", x, z); // Paper // Paper start - add ticket to hold chunk for a little while longer if plugin accesses it net.minecraft.world.level.chunk.LevelChunk chunk = this.world.getChunkSource().getChunkAtIfLoadedImmediately(x, z); -@@ -351,7 +352,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -350,7 +351,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper start private void addTicket(int x, int z) { @@ -23262,7 +23263,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d } // Paper end -@@ -370,10 +371,10 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -369,10 +370,10 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean isChunkGenerated(int x, int z) { // Paper start - Fix this method @@ -23275,7 +23276,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d } ChunkAccess chunk = world.getChunkSource().getChunkAtImmediately(x, z); if (chunk == null) { -@@ -427,7 +428,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -426,7 +427,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { } private boolean unloadChunk0(int x, int z, boolean save) { @@ -23284,7 +23285,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d if (!this.isChunkLoaded(x, z)) { return true; } -@@ -442,7 +443,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -441,7 +442,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean regenerateChunk(int x, int z) { @@ -23293,7 +23294,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d warnUnsafeChunk("regenerating a faraway chunk", x, z); // Paper // Paper start - implement regenerateChunk method final ServerLevel serverLevel = this.world; -@@ -503,6 +504,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -502,6 +503,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean refreshChunk(int x, int z) { @@ -23301,7 +23302,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z)); if (playerChunk == null) return false; -@@ -538,7 +540,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -537,7 +539,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean loadChunk(int x, int z, boolean generate) { @@ -23310,7 +23311,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d warnUnsafeChunk("loading a faraway chunk", x, z); // Paper // Paper start - Optimize this method ChunkPos chunkPos = new ChunkPos(x, z); -@@ -610,7 +612,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -609,7 +611,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 @@ -23319,7 +23320,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d return true; } -@@ -795,13 +797,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -800,13 +802,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) { @@ -23340,7 +23341,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d BlockPos position = ((CraftBlockState) blockstate).getPosition(); net.minecraft.world.level.block.state.BlockState oldBlock = this.world.getBlockState(position); int flag = ((CraftBlockState) blockstate).getFlag(); -@@ -809,10 +813,10 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -814,10 +818,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); } @@ -23353,7 +23354,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d return false; } } -@@ -846,6 +850,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -851,6 +855,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setTime(long time) { @@ -23361,7 +23362,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d long margin = (time - this.getFullTime()) % 24000; if (margin < 0) margin += 24000; this.setFullTime(this.getFullTime() + margin); -@@ -858,6 +863,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -863,6 +868,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setFullTime(long time) { @@ -23369,7 +23370,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d // Notify anyone who's listening TimeSkipEvent event = new TimeSkipEvent(this, TimeSkipEvent.SkipReason.CUSTOM, time - this.world.getDayTime()); this.server.getPluginManager().callEvent(event); -@@ -885,7 +891,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -890,7 +896,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public long getGameTime() { @@ -23378,7 +23379,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d } @Override -@@ -905,11 +911,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -910,11 +916,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) { @@ -23392,7 +23393,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d return !world.explode(source != null ? ((org.bukkit.craftbukkit.entity.CraftEntity) source).getHandle() : null, loc.getX(), loc.getY(), loc.getZ(), power, setFire, breakBlocks ? net.minecraft.world.level.Level.ExplosionInteraction.MOB : net.minecraft.world.level.Level.ExplosionInteraction.NONE).wasCanceled; } // Paper end -@@ -979,6 +987,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -984,6 +992,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) { @@ -23400,7 +23401,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d 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); -@@ -1009,6 +1018,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1014,6 +1023,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); @@ -23408,7 +23409,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d if (this.world.hasChunkAt(pos)) { net.minecraft.world.level.chunk.LevelChunk chunk = this.world.getChunkAt(pos); -@@ -1284,6 +1294,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1289,6 +1299,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setStorm(boolean hasStorm) { @@ -23416,7 +23417,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d world.serverLevelData.setRaining(hasStorm, org.bukkit.event.weather.WeatherChangeEvent.Cause.PLUGIN); // Paper this.setWeatherDuration(0); // Reset weather duration (legacy behaviour) this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands) -@@ -1296,6 +1307,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1301,6 +1312,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setWeatherDuration(int duration) { @@ -23424,7 +23425,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d world.serverLevelData.setRainTime(duration); } -@@ -1306,6 +1318,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1311,6 +1323,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setThundering(boolean thundering) { @@ -23432,7 +23433,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d world.serverLevelData.setThundering(thundering, org.bukkit.event.weather.ThunderChangeEvent.Cause.PLUGIN); // Paper this.setThunderDuration(0); // Reset weather duration (legacy behaviour) this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands) -@@ -1318,6 +1331,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1323,6 +1336,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setThunderDuration(int duration) { @@ -23440,7 +23441,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d world.serverLevelData.setThunderTime(duration); } -@@ -1328,6 +1342,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1333,6 +1347,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setClearWeatherDuration(int duration) { @@ -23448,7 +23449,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d world.serverLevelData.setClearWeatherTime(duration); } -@@ -1521,6 +1536,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1527,6 +1542,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setKeepSpawnInMemory(boolean keepLoaded) { @@ -23456,7 +23457,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d // Paper start - Configurable spawn radius if (keepLoaded == world.keepSpawnInMemory) { // do nothing, nothing has changed -@@ -1599,6 +1615,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1605,6 +1621,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setHardcore(boolean hardcore) { @@ -23464,7 +23465,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d world.serverLevelData.settings.hardcore = hardcore; } -@@ -1611,6 +1628,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1617,6 +1634,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns) { @@ -23472,7 +23473,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.setTicksPerSpawns(SpawnCategory.ANIMAL, ticksPerAnimalSpawns); } -@@ -1623,6 +1641,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1629,6 +1647,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) { @@ -23480,7 +23481,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.setTicksPerSpawns(SpawnCategory.MONSTER, ticksPerMonsterSpawns); } -@@ -1635,6 +1654,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1641,6 +1660,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) { @@ -23488,7 +23489,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.setTicksPerSpawns(SpawnCategory.WATER_ANIMAL, ticksPerWaterSpawns); } -@@ -1647,6 +1667,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1653,6 +1673,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerWaterAmbientSpawns(int ticksPerWaterAmbientSpawns) { @@ -23496,7 +23497,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.setTicksPerSpawns(SpawnCategory.WATER_AMBIENT, ticksPerWaterAmbientSpawns); } -@@ -1659,6 +1680,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1665,6 +1686,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns) { @@ -23504,7 +23505,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.setTicksPerSpawns(SpawnCategory.WATER_UNDERGROUND_CREATURE, ticksPerWaterUndergroundCreatureSpawns); } -@@ -1671,11 +1693,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1677,11 +1699,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns) { @@ -23515,10 +23516,10 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d @Override public void setTicksPerSpawns(SpawnCategory spawnCategory, int ticksPerCategorySpawn) { + io.papermc.paper.threadedregions.RegionizedServer.ensureGlobalTickThread("Cannot modify server settings off of the global region"); // Folia - region threading - Validate.notNull(spawnCategory, "SpawnCategory cannot be null"); - Validate.isTrue(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory." + spawnCategory + " are not supported."); + Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null"); + Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory); -@@ -1692,21 +1716,25 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1698,21 +1722,25 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setMetadata(String metadataKey, MetadataValue newMetadataValue) { @@ -23544,7 +23545,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.server.getWorldMetadata().removeMetadata(this, metadataKey, owningPlugin); } -@@ -1719,6 +1747,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1725,6 +1753,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setMonsterSpawnLimit(int limit) { @@ -23552,7 +23553,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.setSpawnLimit(SpawnCategory.MONSTER, limit); } -@@ -1731,6 +1760,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1737,6 +1766,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setAnimalSpawnLimit(int limit) { @@ -23560,7 +23561,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.setSpawnLimit(SpawnCategory.ANIMAL, limit); } -@@ -1743,6 +1773,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1749,6 +1779,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setWaterAnimalSpawnLimit(int limit) { @@ -23568,7 +23569,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.setSpawnLimit(SpawnCategory.WATER_ANIMAL, limit); } -@@ -1755,6 +1786,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1761,6 +1792,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setWaterAmbientSpawnLimit(int limit) { @@ -23576,7 +23577,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.setSpawnLimit(SpawnCategory.WATER_AMBIENT, limit); } -@@ -1767,6 +1799,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1773,6 +1805,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setWaterUndergroundCreatureSpawnLimit(int limit) { @@ -23584,7 +23585,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.setSpawnLimit(SpawnCategory.WATER_UNDERGROUND_CREATURE, limit); } -@@ -1779,6 +1812,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1785,6 +1818,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override @Deprecated public void setAmbientSpawnLimit(int limit) { @@ -23592,15 +23593,15 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d this.setSpawnLimit(SpawnCategory.AMBIENT, limit); } -@@ -1801,6 +1835,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1807,6 +1841,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setSpawnLimit(SpawnCategory spawnCategory, int limit) { + io.papermc.paper.threadedregions.RegionizedServer.ensureGlobalTickThread("Cannot modify server settings off of the global region"); // Folia - region threading - Validate.notNull(spawnCategory, "SpawnCategory cannot be null"); - Validate.isTrue(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory." + spawnCategory + " are not supported."); + Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null"); + Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory); -@@ -1855,7 +1890,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1861,7 +1896,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(BuiltInRegistries.SOUND_EVENT.wrapAsHolder(CraftSound.getSoundEffect(sound)), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, this.getHandle().getRandom().nextLong()); @@ -23609,7 +23610,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d if (entityTracker != null) { entityTracker.broadcastAndSend(packet); } -@@ -1866,7 +1901,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1872,7 +1907,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(new ResourceLocation(sound))), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, this.getHandle().getRandom().nextLong()); @@ -23618,7 +23619,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d if (entityTracker != null) { entityTracker.broadcastAndSend(packet); } -@@ -1952,6 +1987,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1958,6 +1993,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean setGameRuleValue(String rule, String value) { @@ -23626,15 +23627,15 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d // No null values allowed if (rule == null || value == null) return false; -@@ -1993,6 +2029,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2000,6 +2036,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean setGameRule(GameRule rule, T newValue) { + io.papermc.paper.threadedregions.RegionizedServer.ensureGlobalTickThread("Cannot modify server settings off of the global region"); // Folia - region threading - Validate.notNull(rule, "GameRule cannot be null"); - Validate.notNull(newValue, "GameRule value cannot be null"); + Preconditions.checkArgument(rule != null, "GameRule cannot be null"); + Preconditions.checkArgument(newValue != null, "GameRule value cannot be null"); -@@ -2258,6 +2295,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2265,6 +2302,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void sendGameEvent(Entity sourceEntity, org.bukkit.GameEvent gameEvent, Vector position) { @@ -23647,7 +23648,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d getHandle().gameEvent(sourceEntity != null ? ((CraftEntity) sourceEntity).getHandle(): null, net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT.get(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(gameEvent.getKey())), org.bukkit.craftbukkit.util.CraftVector.toBlockPos(position)); } // Paper end -@@ -2390,7 +2433,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2397,7 +2440,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper start public java.util.concurrent.CompletableFuture getChunkAtAsync(int x, int z, boolean gen, boolean urgent) { warnUnsafeChunk("getting a faraway chunk async", x, z); // Paper @@ -23656,7 +23657,7 @@ index 89514af7f3771db496e7e2a40fa4e7fdf527f095..5e7f8f4cc24bc14e1a2639b60c33a04d net.minecraft.world.level.chunk.LevelChunk immediate = this.world.getChunkSource().getChunkAtIfLoadedImmediately(x, z); if (immediate != null) { return java.util.concurrent.CompletableFuture.completedFuture(new CraftChunk(immediate)); -@@ -2407,7 +2450,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2414,7 +2457,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { java.util.concurrent.CompletableFuture ret = new java.util.concurrent.CompletableFuture<>(); io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> { @@ -23678,10 +23679,10 @@ index a3d5e319473e2f6316b3ef8edf719296e02d85a1..55abed5fdf8dc699ade5b25b1f194941 tileentitybeehive.addOccupantWithPresetTicks(entitybee, false, random.nextInt(599)); } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268f3b604db 100644 +index 5401ab9f8f6ce12e1c5368dbc3acc78a250b3822..66ee61f27dc435e27c4792b6cf4f320b91a54c57 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -80,6 +80,11 @@ public class CraftBlock implements Block { +@@ -79,6 +79,11 @@ public class CraftBlock implements Block { } public net.minecraft.world.level.block.state.BlockState getNMS() { @@ -23693,7 +23694,7 @@ index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268 return this.world.getBlockState(position); } -@@ -156,6 +161,11 @@ public class CraftBlock implements Block { +@@ -155,6 +160,11 @@ public class CraftBlock implements Block { } private void setData(final byte data, int flag) { @@ -23705,7 +23706,7 @@ index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268 this.world.setBlock(position, CraftMagicNumbers.getBlock(this.getType(), data), flag); } -@@ -197,6 +207,11 @@ public class CraftBlock implements Block { +@@ -196,6 +206,11 @@ public class CraftBlock implements Block { } public static boolean setTypeAndData(LevelAccessor world, BlockPos position, net.minecraft.world.level.block.state.BlockState old, net.minecraft.world.level.block.state.BlockState blockData, boolean applyPhysics) { @@ -23717,7 +23718,7 @@ index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268 // SPIGOT-611: need to do this to prevent glitchiness. Easier to handle this here (like /setblock) than to fix weirdness in tile entity cleanup if (old.hasBlockEntity() && blockData.getBlock() != old.getBlock()) { // SPIGOT-3725 remove old tile entity if block changes // SPIGOT-4612: faster - just clear tile -@@ -342,18 +357,33 @@ public class CraftBlock implements Block { +@@ -341,18 +356,33 @@ public class CraftBlock implements Block { @Override public Biome getBiome() { @@ -23751,7 +23752,7 @@ index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268 this.getWorld().setBiome(this.getX(), this.getY(), this.getZ(), bio); } -@@ -424,6 +454,11 @@ public class CraftBlock implements Block { +@@ -422,6 +452,11 @@ public class CraftBlock implements Block { @Override public boolean isBlockFaceIndirectlyPowered(BlockFace face) { @@ -23763,7 +23764,7 @@ index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268 int power = this.world.getMinecraftWorld().getSignal(position, CraftBlock.blockFaceToNotch(face)); Block relative = this.getRelative(face); -@@ -436,6 +471,11 @@ public class CraftBlock implements Block { +@@ -434,6 +469,11 @@ public class CraftBlock implements Block { @Override public int getBlockPower(BlockFace face) { @@ -23775,7 +23776,7 @@ index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268 int power = 0; net.minecraft.world.level.Level world = this.world.getMinecraftWorld(); int x = this.getX(); -@@ -522,6 +562,11 @@ public class CraftBlock implements Block { +@@ -520,6 +560,11 @@ public class CraftBlock implements Block { @Override public boolean breakNaturally(ItemStack item, boolean triggerEffect, boolean dropExperience) { @@ -23787,7 +23788,7 @@ index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268 // Paper end // Order matters here, need to drop before setting to air so skulls can get their data net.minecraft.world.level.block.state.BlockState iblockdata = this.getNMS(); -@@ -565,21 +610,27 @@ public class CraftBlock implements Block { +@@ -563,21 +608,27 @@ public class CraftBlock implements Block { @Override public boolean applyBoneMeal(BlockFace face) { @@ -23822,31 +23823,31 @@ index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268 StructureGrowEvent structureEvent = null; if (treeType != null) { -@@ -665,6 +716,11 @@ public class CraftBlock implements Block { +@@ -663,6 +714,11 @@ public class CraftBlock implements Block { @Override public RayTraceResult rayTrace(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode) { + // Folia start - region threading -+ if (world instanceof ServerLevel serverWorld) { -+ io.papermc.paper.util.TickThread.ensureTickThread(serverWorld, position, "Cannot read world asynchronously"); ++ if (this.world instanceof ServerLevel serverWorld) { ++ io.papermc.paper.util.TickThread.ensureTickThread(serverWorld, this.position, "Cannot read world asynchronously"); + } + // Folia end - region threading - Validate.notNull(start, "Start location is null!"); - Validate.isTrue(this.getWorld().equals(start.getWorld()), "Start location is from different world!"); + Preconditions.checkArgument(start != null, "Location start cannot be null"); + Preconditions.checkArgument(this.getWorld().equals(start.getWorld()), "Location start cannot be a different world"); start.checkFinite(); -@@ -706,6 +762,11 @@ public class CraftBlock implements Block { +@@ -704,6 +760,11 @@ public class CraftBlock implements Block { @Override public boolean canPlace(BlockData data) { + // Folia start - region threading -+ if (world instanceof ServerLevel serverWorld) { -+ io.papermc.paper.util.TickThread.ensureTickThread(serverWorld, position, "Cannot read world asynchronously"); ++ if (this.world instanceof ServerLevel serverWorld) { ++ io.papermc.paper.util.TickThread.ensureTickThread(serverWorld, this.position, "Cannot read world asynchronously"); + } + // Folia end - region threading - Preconditions.checkArgument(data != null, "Provided block data is null!"); + Preconditions.checkArgument(data != null, "BlockData cannot be null"); net.minecraft.world.level.block.state.BlockState iblockdata = ((CraftBlockData) data).getState(); net.minecraft.world.level.Level world = this.world.getMinecraftWorld(); -@@ -736,6 +797,11 @@ public class CraftBlock implements Block { +@@ -734,6 +795,11 @@ public class CraftBlock implements Block { @Override public float getDestroySpeed(ItemStack itemStack, boolean considerEnchants) { @@ -23858,7 +23859,7 @@ index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268 net.minecraft.world.item.ItemStack nmsItemStack; if (itemStack instanceof CraftItemStack) { nmsItemStack = ((CraftItemStack) itemStack).handle; -@@ -761,6 +827,11 @@ public class CraftBlock implements Block { +@@ -759,6 +825,11 @@ public class CraftBlock implements Block { @Override public void tick() { @@ -23870,7 +23871,7 @@ index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268 net.minecraft.world.level.block.state.BlockState blockData = this.getNMS(); net.minecraft.server.level.ServerLevel level = this.world.getMinecraftWorld(); -@@ -769,6 +840,11 @@ public class CraftBlock implements Block { +@@ -767,6 +838,11 @@ public class CraftBlock implements Block { @Override public void randomTick() { @@ -23883,10 +23884,10 @@ index 01b401f7d691ef451266bbc3a94980d613b96f21..d4a1d17d5dde68b9bc2fbae370ef2268 net.minecraft.server.level.ServerLevel level = this.world.getMinecraftWorld(); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -index 577a352dab0f8a71558cb6dedce788e78053ef52..2fbd5f98862bbd179aac002f751a3e6169e67292 100644 +index b1abb332eca597b23888bca42d21d5b587f61b13..38b4d0870d21467e415d5e84457706df80c15e23 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -@@ -207,6 +207,12 @@ public class CraftBlockState implements BlockState { +@@ -201,6 +201,12 @@ public class CraftBlockState implements BlockState { LevelAccessor access = this.getWorldHandle(); CraftBlock block = this.getBlock(); @@ -23899,7 +23900,7 @@ index 577a352dab0f8a71558cb6dedce788e78053ef52..2fbd5f98862bbd179aac002f751a3e61 if (block.getType() != this.getType()) { if (!force) { return false; -@@ -344,6 +350,9 @@ public class CraftBlockState implements BlockState { +@@ -336,6 +342,9 @@ public class CraftBlockState implements BlockState { @Override public java.util.Collection getDrops(org.bukkit.inventory.ItemStack item, org.bukkit.entity.Entity entity) { @@ -23932,7 +23933,7 @@ index cd4ad8261e56365850068db1d83d6a8454026737..78f7e72f2912dae503c2dab7d1992b65 List offers = waitable.get(); if (offers == null) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index ea056babe2f8123f20dc608d8a636da1de634b8c..6a54b582fdab953c452a32e9839e2a916c659c2e 100644 +index 733158b6f2c2bd03fbe798562ff7bc33280548dc..f001d811e930230f729b0340fb54f083fc4a9eb1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -203,6 +203,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -23964,7 +23965,7 @@ index ea056babe2f8123f20dc608d8a636da1de634b8c..6a54b582fdab953c452a32e9839e2a91 // Paper end Preconditions.checkArgument(location != null, "location cannot be null"); location.checkFinite(); -@@ -1244,7 +1259,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1237,7 +1252,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } ServerLevel world = ((CraftWorld) this.getWorld()).getHandle(); @@ -23973,7 +23974,7 @@ index ea056babe2f8123f20dc608d8a636da1de634b8c..6a54b582fdab953c452a32e9839e2a91 if (entityTracker == null) { return; -@@ -1308,30 +1323,43 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1301,30 +1316,43 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { Preconditions.checkArgument(location != null, "location"); location.checkFinite(); Location locationClone = location.clone(); // clone so we don't need to worry about mutations after this call. @@ -24038,10 +24039,10 @@ index ea056babe2f8123f20dc608d8a636da1de634b8c..6a54b582fdab953c452a32e9839e2a91 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 548eddde8b0558b780f672d321507cfcbac92558..4b4fd590574bb0a41bc84bbb18397f95cb61555c 100644 +index 03bb444705916ffe0b9eb4b7496524dc3459ebe0..a7611e16b884b6f6d0fa2486057b5c0cbffc7c6c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -573,7 +573,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -570,7 +570,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void kickPlayer(String message) { @@ -24050,7 +24051,7 @@ index 548eddde8b0558b780f672d321507cfcbac92558..4b4fd590574bb0a41bc84bbb18397f95 if (this.getHandle().connection == null) return; this.getHandle().connection.disconnect(message == null ? "" : message, org.bukkit.event.player.PlayerKickEvent.Cause.PLUGIN); // Paper - kick event cause -@@ -1288,6 +1288,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1278,6 +1278,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) { @@ -24062,7 +24063,7 @@ index 548eddde8b0558b780f672d321507cfcbac92558..4b4fd590574bb0a41bc84bbb18397f95 java.util.Set relativeArguments; java.util.Set allFlags; if (flags.length == 0) { -@@ -1819,7 +1824,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1806,7 +1811,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private void unregisterEntity(Entity other) { // Paper end ChunkMap tracker = ((ServerLevel) this.getHandle().level()).getChunkSource().chunkMap; @@ -24071,7 +24072,7 @@ index 548eddde8b0558b780f672d321507cfcbac92558..4b4fd590574bb0a41bc84bbb18397f95 if (entry != null) { entry.removePlayer(this.getHandle()); } -@@ -1903,7 +1908,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1890,7 +1895,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(otherPlayer))); } @@ -24081,11 +24082,11 @@ index 548eddde8b0558b780f672d321507cfcbac92558..4b4fd590574bb0a41bc84bbb18397f95 entry.updatePlayer(this.getHandle()); } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index a9a58f0bb19e034cffdafcc38fdc9003744a5d6c..4b0736339caf2fe47e9b4ebd0dd50ff956c365ae 100644 +index 32fe1e498ee988566213bfcf56bf98c92a3c9871..48d45688cb03edce420c3f30fa041e3da7c2d551 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -230,8 +230,8 @@ import org.bukkit.potion.PotionEffect; - import org.bukkit.event.entity.SpawnerSpawnEvent; // Spigot +@@ -230,8 +230,8 @@ import org.bukkit.inventory.meta.BookMeta; + import org.bukkit.potion.PotionEffect; public class CraftEventFactory { - public static org.bukkit.block.Block blockDamage; // For use in EntityDamageByBlockEvent @@ -24181,10 +24182,10 @@ index a9a58f0bb19e034cffdafcc38fdc9003744a5d6c..4b0736339caf2fe47e9b4ebd0dd50ff9 cause = DamageCause.FALLING_BLOCK; } else if (damager instanceof LightningStrike) { diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index cdefb2025eedea7e204d70d568adaf1c1ec4c03c..9136fb30db749737e9f189d0901024fcad02e402 100644 +index d7ce4971d9271dbeff4adb9d852e4e7bdf60bf03..eb84a8dd97f92de4a7dd3826d9e124a442cba565 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -@@ -533,6 +533,7 @@ public class CraftScheduler implements BukkitScheduler { +@@ -530,6 +530,7 @@ public class CraftScheduler implements BukkitScheduler { } protected CraftTask handle(final CraftTask task, final long delay) { // Paper @@ -24193,10 +24194,10 @@ index cdefb2025eedea7e204d70d568adaf1c1ec4c03c..9136fb30db749737e9f189d0901024fc if (!this.isAsyncScheduler && !task.isSync()) { this.asyncScheduler.handle(task, delay); diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index b059bb46b649cbf82debdb8d58fe4ba77d040276..340b3fb265048eb6fffad5fda33cd0735f7377c1 100644 +index 83cef5ec27c31f133a23cd27349f722799c786ea..61e40979a68017eb730f14a1a0978402f44c1865 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -375,6 +375,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -373,6 +373,12 @@ public final class CraftMagicNumbers implements UnsafeValues { String minimumVersion = MinecraftServer.getServer().server.minimumAPI; int minimumIndex = CraftMagicNumbers.SUPPORTED_API.indexOf(minimumVersion); @@ -24210,7 +24211,7 @@ index b059bb46b649cbf82debdb8d58fe4ba77d040276..340b3fb265048eb6fffad5fda33cd073 int pluginIndex = CraftMagicNumbers.SUPPORTED_API.indexOf(pdf.getAPIVersion()); diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index d4da9ec6e00bb92b70598ee9a0d0ca5816562378..3e1cf981e77839acee8a825a47102df1ecf8579f 100644 +index eda7f0bb42f7269676d5d2193e1155912ede9920..7c4daa8557f1956c8b823d4764791c60957d1091 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -65,26 +65,27 @@ public class ActivationRange @@ -24313,7 +24314,7 @@ index d4da9ec6e00bb92b70598ee9a0d0ca5816562378..3e1cf981e77839acee8a825a47102df1 } } @@ -262,10 +265,10 @@ public class ActivationRange - if (entity.remainingFireTicks > 0) { + if (entity.getRemainingFireTicks() > 0) { return 2; } - if (entity.activatedImmunityTick >= MinecraftServer.currentTick) { diff --git a/patches/server/0004-Max-pending-logins.patch b/patches/server/0004-Max-pending-logins.patch index a7a1a43..0128d87 100644 --- a/patches/server/0004-Max-pending-logins.patch +++ b/patches/server/0004-Max-pending-logins.patch @@ -19,7 +19,7 @@ index 2e96377d628b3a07fb565020074d665f594f32e8..75b1877f8c3e4da3183437f327ef3376 } // Folia - region threading - remove delayed accept diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index fc58f714b069453b5f6d2f0ca801fbe1beef07aa..7dc9114a994ff265eb66d99c4f15be197b327e55 100644 +index 5b4e7e22b0e989b7d19b0b28cf74e08acacd1fa1..d4620ddfcd06a037f647ab0a8938797405e001b2 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -180,6 +180,17 @@ public abstract class PlayerList { 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 9cecd24..fab0da1 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 @@ -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 4e78647f1bba68741eeef08a85caf2d053436472..08a11d18c0f507ee91163b8693b2a1f8fd9856aa 100644 +index 37b90c70196717c3a68b6d3b652e5716ab89998c..deaf4b65b6c9f3dbab6578c25fb78ca84507f70b 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2889,6 +2889,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -87,10 +87,10 @@ index 4e78647f1bba68741eeef08a85caf2d053436472..08a11d18c0f507ee91163b8693b2a1f8 if (this.passengers.size() == 1 && this.passengers.get(0) == entity) { this.passengers = ImmutableList.of(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a2e688607194167ebf9ca646561d61b41f2ff915..f83d112a6f55a75aae114bb1c0cb5db4e5e009a3 100644 +index e35777b6501fa8290176b757b08893490322dd25..ac38ba1f697351f9787c758ae5c206c49899c3c5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -376,7 +376,7 @@ public final class CraftServer implements Server { +@@ -375,7 +375,7 @@ public final class CraftServer implements Server { @Override public final boolean isOwnedByCurrentRegion(Entity entity) { @@ -133,7 +133,7 @@ index 5e82b2d57833fea1adb342f5c8d25f55491945cb..2c46527dfe832919b055579a0876a043 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java -index 299ab868252c8f326e3a56e878c9ee230c9635dc..e0f2104154f1499ef7cd388d24ffc3983aef7f42 100644 +index 90a989c7c9de6f9ba55ab640761915e98320642a..c43ce4c9f6d011a7403dd37ff62953aba29852aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java @@ -17,8 +17,16 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac @@ -281,7 +281,7 @@ index 56bc26f227b97e8e935a20c6393d3f2eb806b285..5cf8ea3a7dd4e8ea96ca6061aa1aaefc } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java -index fec308cbc8fb27036301fe27a1169ac7368f9732..9ef569fad87838171198ff444538a401d664a710 100644 +index 0f9e1d7aaee8ae870acd41934d52964c4d1aaff3..2e5cc1c7cbe4fc7cbcc2b2aeb37d497e4909053d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java @@ -24,8 +24,16 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud @@ -323,10 +323,10 @@ index 17d08d2c90047ebfc4098b087be091b83111a40f..f678c151938ddd3e5277a05d6d8884c1 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -index d53e1dc949359e9157e92c75d8655a1619bba568..16c55774a622b3325af091c9e7cc657cf7717d95 100644 +index 10e2d251ec398245786a0b3bd41f3bc7155a49fe..6050a3209d893dc4b1f65f14f815840390c14eb0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -@@ -145,8 +145,16 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow { +@@ -143,8 +143,16 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow { this.getHandle().setShotFromCrossbow(shotFromCrossbow); } @@ -932,10 +932,10 @@ index 75c7645fb5732c43d1da15181cf5c7ee4c3ecd6c..6d3325436a77153438bc40aa86819562 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 6a54b582fdab953c452a32e9839e2a916c659c2e..b23e399f65a75e10b6b3aabe8d3ea3660104125b 100644 +index f001d811e930230f729b0340fb54f083fc4a9eb1..76bcfda336e9cfa039d80ea3ccbebbc3d2b13f7f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -827,7 +827,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -822,7 +822,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @Override public UUID getUniqueId() { @@ -944,7 +944,7 @@ index 6a54b582fdab953c452a32e9839e2a916c659c2e..b23e399f65a75e10b6b3aabe8d3ea366 } @Override -@@ -843,7 +843,14 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -836,7 +836,14 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { this.getHandle().tickCount = value; } @@ -1044,7 +1044,7 @@ index e99314b905a7ed54ceeb156ed92ff1a5793df99a..61bed78df554dc6a9689ea19e159fde9 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java -index 2dd2149e8af5cb47027ab24159b48e1d67b45f19..d5ce8c22474c90300ed843bf3e5021f38a4d5751 100644 +index 1fdf52edc47591bf3d8bbcb9db9d41773aace42f..bd1ed5b1e58cb3ce40036a602acbb0b7a7e6322b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java @@ -47,8 +47,16 @@ public class CraftFireball extends AbstractProjectile implements Fireball { @@ -1107,10 +1107,10 @@ index 3c64461119391ec2e987fc936104e21ef0a95ce4..d702e34f65de28df677a9d3616f38b2c } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -index bac5c30d3aae1b3a7dbfb78f6fd37c11038fc735..20b12701979daf1185332cffdc3895384da30fbb 100644 +index 41e8167766383a6fcb1e9fb78933d74784caddbb..d73d18e10d9a75a43f9352f5eebaa3be485e3572 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -@@ -16,8 +16,16 @@ public class CraftFishHook extends CraftProjectile implements FishHook { +@@ -15,8 +15,16 @@ public class CraftFishHook extends CraftProjectile implements FishHook { super(server, entity); } @@ -1149,7 +1149,7 @@ index 8038e1bdac4166bfaf228118e87cb246cb49b9a1..e1e51f050959aa23bd85bb794a7098a5 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java -index 6c71be9b453fb662276869a24257969941501c0e..17f94426754557082348375ec9a33ac82d2d13e8 100644 +index 9e5c9b1c4299986b2fae7e191d7661549376a331..36997290fa276275bbcf890a7b368f40a9ad8e02 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java @@ -15,8 +15,16 @@ public class CraftFox extends CraftAnimals implements Fox { @@ -1380,10 +1380,10 @@ index 5c83b20566cad98c47c8d1aa127a7d2659b952a8..1e312733b266e8350bc1a59113b19588 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHorse.java -index 1f474ef8f9e86da383206bd50ba00c7ed8352c5d..4dd82aef0d4e37336c076f74fe01cbd43ebaab2a 100644 +index 794dc15d5e09d0b73b2d297a2da60d2b6b407f6c..a34608c74daced31ec45a96b643176a4d2ff72dc 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHorse.java -@@ -17,8 +17,16 @@ public class CraftHorse extends CraftAbstractHorse implements Horse { +@@ -14,8 +14,16 @@ public class CraftHorse extends CraftAbstractHorse implements Horse { super(server, entity); } @@ -1401,10 +1401,10 @@ index 1f474ef8f9e86da383206bd50ba00c7ed8352c5d..4dd82aef0d4e37336c076f74fe01cbd4 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index cba6ead3f937f2b3d59c15a864e07e5cb2f2330c..773c07d78877e23f557e448b8d2631534a067350 100644 +index 0f3e696582cd288357598490e8af0131ab30bdfc..07347858bff8a764a140cb3fbd484301803cfa00 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -293,8 +293,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -291,8 +291,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { this.mode = mode; } @@ -1527,10 +1527,10 @@ index 9b7b98e21e757ab2caca68de20d0191d0011bc9d..06e2580653db00110b0f0a05cfda9d0e } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java -index 5d6cb013fbc4e5bfe335211b3cc63d2788b5868b..1122ce7763988af38a1f48e789a626d87d8cb4fd 100644 +index 5c05ab52e6ea8ec23ff3778f4074ce21b87238db..9f5825c037d26528740ba02aaf9eb1e36d564f67 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java -@@ -157,8 +157,16 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame { +@@ -156,8 +156,16 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame { this.getHandle().fixed = fixed; } @@ -1611,10 +1611,10 @@ index e515e819774bfb31ec03f05a5502921e66f2b0e2..80cac5d7362577e53ef5ca215ab32618 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 42a4a45ece562d543cc4fab9d9e7c70573705f10..d065dfacb0980c7997b99ef7ed6e61a85a3c3055 100644 +index 7880631fe8a4b06f29ef69ab850129737a99521b..564c72d6351721505dbffaf5af732db2dd3210ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -419,8 +419,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -415,8 +415,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { this.getHandle().invulnerableTime = ticks; } @@ -2146,10 +2146,10 @@ 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 4b4fd590574bb0a41bc84bbb18397f95cb61555c..e98c8d54ef30837da40e8f4ab9f7f46444d77359 100644 +index a7611e16b884b6f6d0fa2486057b5c0cbffc7c6c..2e49f35376435529ac48ad5f9b2d098809200f90 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -593,7 +593,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -590,7 +590,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) { @@ -2158,7 +2158,7 @@ index 4b4fd590574bb0a41bc84bbb18397f95cb61555c..e98c8d54ef30837da40e8f4ab9f7f464 final ServerGamePacketListenerImpl connection = this.getHandle().connection; if (connection != null) { connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message, cause); -@@ -2024,9 +2024,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2011,9 +2011,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this; } @@ -2176,7 +2176,7 @@ index 4b4fd590574bb0a41bc84bbb18397f95cb61555c..e98c8d54ef30837da40e8f4ab9f7f464 } public void setHandle(final ServerPlayer entity) { -@@ -3025,7 +3032,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3019,7 +3026,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { { if ( CraftPlayer.this.getHealth() <= 0 && CraftPlayer.this.isOnline() ) { @@ -2817,10 +2817,10 @@ index 00f8e1130620a3a167733ca3297cc90561cce1f0..34de9dcd6fa0e978c65bf48ae7892378 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -index a926f4dc51821a05c28872dc90ad000fe8cb51f7..f06d08fa5d693047a3bbf92428dc56bcae5cb66e 100644 +index 5c3bc680c4e4e6dc4b2d9edc666d6a8d95c2e7b7..6c15ba92215634a06a1d95fbd7d64bff2bb935dc 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -@@ -64,8 +64,17 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw +@@ -61,8 +61,17 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw this.getHandle().splash(null); } // Paper end @@ -2839,7 +2839,7 @@ index a926f4dc51821a05c28872dc90ad000fe8cb51f7..f06d08fa5d693047a3bbf92428dc56bc } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java -index 0068f0b3a5f8d53ff91f16b3fe18a4c8cbefc9d7..f59a777987284b733ad8e8dd7e4d3e18baacd2af 100644 +index 0b39bb689717c13f03753f49d66b85cb2b964d83..8c4c07db82ed8aa1a1f746cfc43eef5ff81d085b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java @@ -20,8 +20,16 @@ public class CraftTippedArrow extends CraftArrow implements Arrow { @@ -2965,10 +2965,10 @@ index bcfca66c7b99b9d514fe850d6cc6abd7e36ccaf7..90c295ff95bbee4f51fda1be2f58312d } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -index e986767316a717bdbdff7a9ccaaeba068ab2a6d8..ca6a6507cadc6c3ada1a9d8ce35cd48d295e2884 100644 +index f21c715ea109164efa755cddb35ef656a9859759..4b4167edcf9e30d50a103c5b85685e7175842f4b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -@@ -31,8 +31,16 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { +@@ -30,8 +30,16 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { super(server, entity); } @@ -2986,10 +2986,10 @@ index e986767316a717bdbdff7a9ccaaeba068ab2a6d8..ca6a6507cadc6c3ada1a9d8ce35cd48d } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java -index 3954fe7e5f9ce8ea9300bfb92b7e4f4b55f0e6da..c0e268b470dfa1c2f74c9cd8d21e49fdb50ae7ec 100644 +index 7d63e9b8c92da089886ce9118bea07077f0541cd..6231a4948fd934d2e73f15b364035c64d7e03cc8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java -@@ -21,8 +21,16 @@ public class CraftVillagerZombie extends CraftZombie implements ZombieVillager { +@@ -19,8 +19,16 @@ public class CraftVillagerZombie extends CraftZombie implements ZombieVillager { super(server, entity); } diff --git a/patches/server/0007-Disable-mid-tick-task-execution.patch b/patches/server/0007-Disable-mid-tick-task-execution.patch index 3375b24..d5dd786 100644 --- a/patches/server/0007-Disable-mid-tick-task-execution.patch +++ b/patches/server/0007-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 ff48c19ce668ed584d0e55787c665a2a3b77f889..5b484004488b6b413bd78a1dc6dc1828c89ce046 100644 +index 26d332a46556416bb70b6276786b43e1a8ec8449..11ff1bc559316da426070867f045720ebd8c1962 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2877,6 +2877,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop