From 8bf425f4569098fc33069932f7676ff96ad11436 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <nassim@njahnke.dev>
Date: Wed, 27 Jul 2022 21:18:51 +0200
Subject: [PATCH] New work

---
 .../server/Add-BeaconEffectEvent.patch        |   0
 .../server/Add-PlayerInitialSpawnEvent.patch  |   0
 ...-option-to-load-extra-plugin-jars-no.patch |   0
 ...-despawn-distances-for-living-entiti.patch |   0
 ...dd-configurable-portal-search-radius.patch |   0
 .../Add-exception-reporting-event.patch       |   0
 ...working-with-arrows-stuck-in-living-.patch |   0
 .../server/Add-velocity-warnings.patch        |   0
 ...d-version-history-to-version-command.patch |   0
 .../{unapplied => }/server/Adventure.patch    | 140 ++++++------------
 ...chunks-are-slime-spawn-chunks-toggle.patch |   0
 .../Allow-for-toggling-of-spawn-chunks.patch  |   0
 ...d-mobs-to-jump-and-take-water-damage.patch |   0
 .../server/Always-tick-falling-blocks.patch   |   0
 ...e-informative-in-maxHealth-exception.patch |   0
 ...e-before-converting-and-renaming-pla.patch |   0
 .../server/Chunk-Save-Reattempt.patch         |   0
 .../server/Complete-resource-pack-API.patch   |   2 +-
 ...urable-Disabling-Cat-Chest-Detection.patch |   0
 ...figurable-baby-zombie-movement-speed.patch |   0
 ...actus-bamboo-and-reed-growth-heights.patch |   0
 ...figurable-container-update-tick-rate.patch |   0
 .../server/Configurable-end-credits.patch     |   0
 .../Configurable-fishing-time-ranges.patch    |   0
 ...ble-inter-world-teleportation-safety.patch |   0
 .../Configurable-mob-spawner-tick-rate.patch  |   0
 ...nfigurable-top-of-nether-void-damage.patch |   0
 ...oreboards-for-non-players-by-default.patch |   0
 .../server/Disable-explosion-knockback.patch  |   0
 .../server/Disable-ice-and-snow.patch         |   0
 .../server/Disable-spigot-tick-limiters.patch |   0
 .../server/Disable-thunder.patch              |   0
 ...-don-t-need-to-when-cerealising-text.patch |  10 +-
 ...ck-and-tnt-entities-at-the-specified.patch |   0
 .../Ensure-commands-are-not-ran-async.patch   |   4 +-
 .../server/Ensure-inv-drag-is-in-bounds.patch |   0
 .../server/Entity-Origin-API.patch            |   0
 .../server/Expose-server-CommandMap.patch     |   0
 ...-explosions-processing-dead-entities.patch |   0
 .../Further-improve-server-tick-loop.patch    |   0
 .../Implement-Paper-VersionChecker.patch      |   0
 .../Implement-PlayerLocaleChangeEvent.patch   |   0
 .../server/Not-implemeneted.patch             |   0
 .../Only-refresh-abilities-if-needed.patch    |   0
 .../server/Optimize-explosions.patch          |   0
 .../server/Paper-Metrics.patch                |   0
 .../server/Paper-command.patch                |   0
 ...layer-View-Distance-API-placeholders.patch |   0
 .../Player-Tab-List-and-Title-APIs.patch      |   0
 .../server/Player-affects-spawning-API.patch  |   0
 ...event-tile-entity-and-entity-crashes.patch |   0
 ...ient-crashes-server-lists-and-Mojang.patch |   0
 .../{unapplied => }/server/Timings-v2.patch   |  25 ++--
 .../Use-UserCache-for-player-heads.patch      |   0
 54 files changed, 71 insertions(+), 110 deletions(-)
 rename patches/{unapplied => }/server/Add-BeaconEffectEvent.patch (100%)
 rename patches/{unapplied => }/server/Add-PlayerInitialSpawnEvent.patch (100%)
 rename patches/{unapplied => }/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch (100%)
 rename patches/{unapplied => }/server/Add-configurable-despawn-distances-for-living-entiti.patch (100%)
 rename patches/{unapplied => }/server/Add-configurable-portal-search-radius.patch (100%)
 rename patches/{unapplied => }/server/Add-exception-reporting-event.patch (100%)
 rename patches/{unapplied => }/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch (100%)
 rename patches/{unapplied => }/server/Add-velocity-warnings.patch (100%)
 rename patches/{unapplied => }/server/Add-version-history-to-version-command.patch (100%)
 rename patches/{unapplied => }/server/Adventure.patch (97%)
 rename patches/{unapplied => }/server/All-chunks-are-slime-spawn-chunks-toggle.patch (100%)
 rename patches/{unapplied => }/server/Allow-for-toggling-of-spawn-chunks.patch (100%)
 rename patches/{unapplied => }/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch (100%)
 rename patches/{unapplied => }/server/Always-tick-falling-blocks.patch (100%)
 rename patches/{unapplied => }/server/Be-a-bit-more-informative-in-maxHealth-exception.patch (100%)
 rename patches/{unapplied => }/server/Check-online-mode-before-converting-and-renaming-pla.patch (100%)
 rename patches/{unapplied => }/server/Chunk-Save-Reattempt.patch (100%)
 rename patches/{unapplied => }/server/Complete-resource-pack-API.patch (99%)
 rename patches/{unapplied => }/server/Configurable-Disabling-Cat-Chest-Detection.patch (100%)
 rename patches/{unapplied => }/server/Configurable-baby-zombie-movement-speed.patch (100%)
 rename patches/{unapplied => }/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch (100%)
 rename patches/{unapplied => }/server/Configurable-container-update-tick-rate.patch (100%)
 rename patches/{unapplied => }/server/Configurable-end-credits.patch (100%)
 rename patches/{unapplied => }/server/Configurable-fishing-time-ranges.patch (100%)
 rename patches/{unapplied => }/server/Configurable-inter-world-teleportation-safety.patch (100%)
 rename patches/{unapplied => }/server/Configurable-mob-spawner-tick-rate.patch (100%)
 rename patches/{unapplied => }/server/Configurable-top-of-nether-void-damage.patch (100%)
 rename patches/{unapplied => }/server/Disable-Scoreboards-for-non-players-by-default.patch (100%)
 rename patches/{unapplied => }/server/Disable-explosion-knockback.patch (100%)
 rename patches/{unapplied => }/server/Disable-ice-and-snow.patch (100%)
 rename patches/{unapplied => }/server/Disable-spigot-tick-limiters.patch (100%)
 rename patches/{unapplied => }/server/Disable-thunder.patch (100%)
 rename patches/{unapplied => }/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch (86%)
 rename patches/{unapplied => }/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch (100%)
 rename patches/{unapplied => }/server/Ensure-commands-are-not-ran-async.patch (98%)
 rename patches/{unapplied => }/server/Ensure-inv-drag-is-in-bounds.patch (100%)
 rename patches/{unapplied => }/server/Entity-Origin-API.patch (100%)
 rename patches/{unapplied => }/server/Expose-server-CommandMap.patch (100%)
 rename patches/{unapplied => }/server/Fix-lag-from-explosions-processing-dead-entities.patch (100%)
 rename patches/{unapplied => }/server/Further-improve-server-tick-loop.patch (100%)
 rename patches/{unapplied => }/server/Implement-Paper-VersionChecker.patch (100%)
 rename patches/{unapplied => }/server/Implement-PlayerLocaleChangeEvent.patch (100%)
 rename patches/{unapplied => }/server/Not-implemeneted.patch (100%)
 rename patches/{unapplied => }/server/Only-refresh-abilities-if-needed.patch (100%)
 rename patches/{unapplied => }/server/Optimize-explosions.patch (100%)
 rename patches/{unapplied => }/server/Paper-Metrics.patch (100%)
 rename patches/{unapplied => }/server/Paper-command.patch (100%)
 rename patches/{unapplied => }/server/Per-Player-View-Distance-API-placeholders.patch (100%)
 rename patches/{unapplied => }/server/Player-Tab-List-and-Title-APIs.patch (100%)
 rename patches/{unapplied => }/server/Player-affects-spawning-API.patch (100%)
 rename patches/{unapplied => }/server/Prevent-tile-entity-and-entity-crashes.patch (100%)
 rename patches/{unapplied => }/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch (100%)
 rename patches/{unapplied => }/server/Timings-v2.patch (99%)
 rename patches/{unapplied => }/server/Use-UserCache-for-player-heads.patch (100%)

diff --git a/patches/unapplied/server/Add-BeaconEffectEvent.patch b/patches/server/Add-BeaconEffectEvent.patch
similarity index 100%
rename from patches/unapplied/server/Add-BeaconEffectEvent.patch
rename to patches/server/Add-BeaconEffectEvent.patch
diff --git a/patches/unapplied/server/Add-PlayerInitialSpawnEvent.patch b/patches/server/Add-PlayerInitialSpawnEvent.patch
similarity index 100%
rename from patches/unapplied/server/Add-PlayerInitialSpawnEvent.patch
rename to patches/server/Add-PlayerInitialSpawnEvent.patch
diff --git a/patches/unapplied/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch
similarity index 100%
rename from patches/unapplied/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch
rename to patches/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch
diff --git a/patches/unapplied/server/Add-configurable-despawn-distances-for-living-entiti.patch b/patches/server/Add-configurable-despawn-distances-for-living-entiti.patch
similarity index 100%
rename from patches/unapplied/server/Add-configurable-despawn-distances-for-living-entiti.patch
rename to patches/server/Add-configurable-despawn-distances-for-living-entiti.patch
diff --git a/patches/unapplied/server/Add-configurable-portal-search-radius.patch b/patches/server/Add-configurable-portal-search-radius.patch
similarity index 100%
rename from patches/unapplied/server/Add-configurable-portal-search-radius.patch
rename to patches/server/Add-configurable-portal-search-radius.patch
diff --git a/patches/unapplied/server/Add-exception-reporting-event.patch b/patches/server/Add-exception-reporting-event.patch
similarity index 100%
rename from patches/unapplied/server/Add-exception-reporting-event.patch
rename to patches/server/Add-exception-reporting-event.patch
diff --git a/patches/unapplied/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch
similarity index 100%
rename from patches/unapplied/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch
rename to patches/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch
diff --git a/patches/unapplied/server/Add-velocity-warnings.patch b/patches/server/Add-velocity-warnings.patch
similarity index 100%
rename from patches/unapplied/server/Add-velocity-warnings.patch
rename to patches/server/Add-velocity-warnings.patch
diff --git a/patches/unapplied/server/Add-version-history-to-version-command.patch b/patches/server/Add-version-history-to-version-command.patch
similarity index 100%
rename from patches/unapplied/server/Add-version-history-to-version-command.patch
rename to patches/server/Add-version-history-to-version-command.patch
diff --git a/patches/unapplied/server/Adventure.patch b/patches/server/Adventure.patch
similarity index 97%
rename from patches/unapplied/server/Adventure.patch
rename to patches/server/Adventure.patch
index 435c5d9ad7..ddbf13804d 100644
--- a/patches/unapplied/server/Adventure.patch
+++ b/patches/server/Adventure.patch
@@ -1175,48 +1175,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
              JsonObject jsonobject = new JsonObject();
  
              if (!ichatbasecomponent.getStyle().isEmpty()) {
-diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java
-+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java
-@@ -0,0 +0,0 @@ import net.minecraft.network.chat.PlayerChatMessage;
- import net.minecraft.network.protocol.Packet;
- import net.minecraft.util.Crypt;
- 
--public record ClientboundPlayerChatPacket(Component signedContent, Optional<Component> unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) implements Packet<ClientGamePacketListener> {
-+// Paper start
-+public record ClientboundPlayerChatPacket(@org.jetbrains.annotations.Nullable net.kyori.adventure.text.Component adventure$message, Component signedContent, Optional<Component> unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) implements Packet<ClientGamePacketListener> {
-     private static final Duration MESSAGE_EXPIRES_AFTER = ServerboundChatPacket.MESSAGE_EXPIRES_AFTER.plus(Duration.ofMinutes(2L));
- 
-+    public ClientboundPlayerChatPacket(Component signedContent, Optional<Component> unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) {
-+        this(null, signedContent, unsignedContent, typeId, sender, timeStamp, saltSignature);
-+    }
-+
-+    @Deprecated // doesn't support signed messages
-+    public ClientboundPlayerChatPacket(net.kyori.adventure.text.Component adventure$message, int typeId, ChatSender sender, Instant timeStamp) {
-+        this(adventure$message, Component.empty(), Optional.empty(), typeId, sender, timeStamp, net.minecraft.util.Crypt.SaltSignaturePair.EMPTY);
-+    }
-+    // Paper end
-+
-     public ClientboundPlayerChatPacket(FriendlyByteBuf buf) {
-         this(buf.readComponent(), buf.readOptional(FriendlyByteBuf::readComponent), buf.readVarInt(), new ChatSender(buf), buf.readInstant(), new Crypt.SaltSignaturePair(buf));
-     }
-@@ -0,0 +0,0 @@ public record ClientboundPlayerChatPacket(Component signedContent, Optional<Comp
-     @Override
-     public void write(FriendlyByteBuf buf) {
-         buf.writeComponent(this.signedContent);
-+        // Paper start
-+        //TODO Proper API and writing signed contents
-+        if (this.adventure$message != null) {
-+            buf.writeBoolean(true);
-+            buf.writeComponent(this.adventure$message);
-+        } else {
-         buf.writeOptional(this.unsignedContent, FriendlyByteBuf::writeComponent);
-+        }
-+        // Paper end
-         buf.writeVarInt(this.typeId);
-         this.sender.write(buf);
-         buf.writeInstant(this.timeStamp);
 diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java
@@ -1297,17 +1255,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  import net.minecraft.network.protocol.Packet;
  
  // Spigot start
--public record ClientboundSystemChatPacket(String content, int typeId) implements Packet<ClientGamePacketListener> {
-+public record ClientboundSystemChatPacket(@javax.annotation.Nullable net.kyori.adventure.text.Component adventure$content, @javax.annotation.Nullable String content, int typeId) implements Packet<ClientGamePacketListener> { // Paper - Adventure
+-public record ClientboundSystemChatPacket(String content, boolean overlay) implements Packet<ClientGamePacketListener> {
++public record ClientboundSystemChatPacket(@javax.annotation.Nullable net.kyori.adventure.text.Component adventure$content, @javax.annotation.Nullable String content, boolean overlay) implements Packet<ClientGamePacketListener> { // Paper - Adventure
  
-     public ClientboundSystemChatPacket(Component content, int typeId) {
--        this(Component.Serializer.toJson(content), typeId);
-+        this(null, Component.Serializer.toJson(content), typeId); // Paper - Adventure
+     public ClientboundSystemChatPacket(Component content, boolean overlay) {
+-        this(Component.Serializer.toJson(content), overlay);
++        this(null, Component.Serializer.toJson(content), overlay); // Paper - Adventure
      }
  
-     public ClientboundSystemChatPacket(net.md_5.bungee.api.chat.BaseComponent[] content, int typeId) {
--        this(net.md_5.bungee.chat.ComponentSerializer.toString(content), typeId);
-+        this(null, net.md_5.bungee.chat.ComponentSerializer.toString(content), typeId); // Paper - Adventure
+     public ClientboundSystemChatPacket(net.md_5.bungee.api.chat.BaseComponent[] content, boolean overlay) {
+-        this(net.md_5.bungee.chat.ComponentSerializer.toString(content), overlay);
++        this(null, net.md_5.bungee.chat.ComponentSerializer.toString(content), overlay); // Paper - Adventure
      }
      // Spigot end
 +    // Paper start
@@ -1315,14 +1273,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +        com.google.common.base.Preconditions.checkArgument(!(adventure$content == null && content == null), "Component adventure$content and String (json) content cannot both be null");
 +    }
 +
-+    public ClientboundSystemChatPacket(net.kyori.adventure.text.Component content, int typeId) {
-+        this(content, null, typeId);
++    public ClientboundSystemChatPacket(net.kyori.adventure.text.Component content, boolean overlay) {
++        this(content, null, overlay);
 +    }
 +    // Paper end
  
      public ClientboundSystemChatPacket(FriendlyByteBuf buf) {
-         this(buf.readComponent(), buf.readVarInt());
-@@ -0,0 +0,0 @@ public record ClientboundSystemChatPacket(String content, int typeId) implements
+         this(buf.readComponent(), buf.readBoolean());
+@@ -0,0 +0,0 @@ public record ClientboundSystemChatPacket(String content, boolean overlay) imple
  
      @Override
      public void write(FriendlyByteBuf buf) {
@@ -1335,7 +1293,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +            throw new IllegalArgumentException("Must supply either adventure component or string json content");
 +        }
 +        // Paper end
-         buf.writeVarInt(this.typeId);
+         buf.writeBoolean(this.overlay);
      }
  
 diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundTabListPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundTabListPacket.java
@@ -1451,8 +1409,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +        if (deathMessage != null && deathMessage != net.kyori.adventure.text.Component.empty() && flag) { // Paper - Adventure // TODO: allow plugins to override?
 +            Component ichatbasecomponent = PaperAdventure.asVanilla(deathMessage); // Paper - Adventure
  
-             this.connection.send(new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent), (future) -> {
-                 if (!future.isSuccess()) {
+             this.connection.send(new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent), PacketSendListener.exceptionallySend(() -> {
+                 boolean flag1 = true;
 @@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
      }
  
@@ -1484,8 +1442,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +import io.papermc.paper.adventure.PaperAdventure; // Paper
  import java.util.concurrent.ExecutionException;
  import java.util.concurrent.atomic.AtomicInteger;
- import net.minecraft.world.entity.animal.Bucketable;
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+ import net.minecraft.network.chat.OutgoingPlayerChatMessage;
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
          return this.server.isSingleplayerOwner(this.player.getGameProfile());
      }
  
@@ -1509,7 +1467,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          // CraftBukkit start - fire PlayerKickEvent
          if (this.processedDisconnect) {
              return;
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
+             Waitable waitable = new Waitable() {
+                 @Override
+                 protected Object evaluate() {
+-                    ServerGamePacketListenerImpl.this.disconnect(s);
++                    ServerGamePacketListenerImpl.this.disconnect(reason); // Paper - adventure
+                     return null;
+                 }
+             };
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
+             return;
          }
+ 
 -        String leaveMessage = ChatFormatting.YELLOW + this.player.getScoreboardName() + " left the game.";
 +        net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure
  
@@ -1518,17 +1488,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  
          if (this.cserver.getServer().isRunning()) {
              this.cserver.getPluginManager().callEvent(event);
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
          }
          this.player.kickLeaveMessage = event.getLeaveMessage(); // CraftBukkit - SPIGOT-3034: Forward leave message to PlayerQuitEvent
          // Send the possibly modified leave message
--        s = event.getReason();
--        final Component ichatbasecomponent = CraftChatMessage.fromString(s, true)[0];
+-        final Component ichatbasecomponent = CraftChatMessage.fromString(event.getReason(), true)[0];
 +        final Component ichatbasecomponent = PaperAdventure.asVanilla(event.reason()); // Paper - Adventure
          // CraftBukkit end
  
-         this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> {
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+         this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> {
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
          */
  
          this.player.disconnect();
@@ -1538,12 +1507,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +        // Paper start - Adventure
 +        net.kyori.adventure.text.Component quitMessage = this.server.getPlayerList().remove(this.player);
 +        if ((quitMessage != null) && !quitMessage.equals(net.kyori.adventure.text.Component.empty())) {
-+            this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), ChatType.SYSTEM);
++            this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false);
 +            // Paper end
          }
          // CraftBukkit end
          this.player.getTextFilter().leave();
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
              this.handleCommand(s);
          } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
              // Do nothing, this is coming from a plugin
@@ -1556,8 +1525,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +        } else if (false) { // Paper
              Player player = this.getCraftPlayer();
              AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server));
-             this.cserver.getPluginManager().callEvent(event);
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+             String originalFormat = event.getFormat(), originalMessage = event.getMessage();
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
                  return;
              }
  
@@ -1571,14 +1540,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +            List<net.kyori.adventure.text.Component> lines = new java.util.ArrayList<>();
  
              for (int i = 0; i < signText.size(); ++i) {
-                 FilteredText<Component> filteredtext = (signText.get(i)).map(Component::literal); // CraftBukkit - decompile error
+                 FilteredText filteredtext = (FilteredText) signText.get(i);
  
                  if (this.player.isTextFilteringEnabled()) {
--                    lines[i] = ChatFormatting.stripFormatting(filteredtext.filteredOrElse(CommonComponents.EMPTY).getString());
-+                    lines.add(net.kyori.adventure.text.Component.text(filteredtext.filteredOrElse(CommonComponents.EMPTY).getString())); // Paper - adventure
+-                    lines[i] = ChatFormatting.stripFormatting(filteredtext.filteredOrEmpty());
++                    lines.add(net.kyori.adventure.text.Component.text(filteredtext.filteredOrEmpty())); // Paper - adventure
                  } else {
--                    lines[i] = ChatFormatting.stripFormatting(filteredtext.raw().getString());
-+                    lines.add(net.kyori.adventure.text.Component.text(filteredtext.raw().getString())); // Paper - adventure
+-                    lines[i] = ChatFormatting.stripFormatting(filteredtext.raw());
++                    lines.add(net.kyori.adventure.text.Component.text(filteredtext.raw())); // Paper - adventure
                  }
              }
              SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines);
@@ -1599,7 +1568,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListene
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
 +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
                          if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) {
                              final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId);
                              if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) {
@@ -1608,7 +1577,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
                              }
                              Waitable<PlayerPreLoginEvent.Result> waitable = new Waitable<PlayerPreLoginEvent.Result>() {
                                  @Override
-@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
  
                              ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable);
                              if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) {
@@ -1648,14 +1617,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  import java.io.File;
  import java.net.SocketAddress;
  import java.nio.file.Path;
-@@ -0,0 +0,0 @@ import net.minecraft.world.scores.Team;
- import org.slf4j.Logger;
- 
- // CraftBukkit start
-+import io.papermc.paper.adventure.PaperAdventure; // Paper
- import com.google.common.base.Predicate;
- import java.util.stream.Collectors;
- import net.minecraft.server.dedicated.DedicatedServer;
 @@ -0,0 +0,0 @@ public abstract class PlayerList {
          }
          // CraftBukkit start
@@ -1681,15 +1642,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +        final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
  
 -        if (joinMessage != null && joinMessage.length() > 0) {
--            for (Component line : org.bukkit.craftbukkit.util.CraftChatMessage.fromString(joinMessage)) {
--                this.server.getPlayerList().broadcastSystemMessage(line, ChatType.SYSTEM);
--            }
 +        if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
 +            joinMessage = PaperAdventure.asVanilla(jm); // Paper - Adventure
-+            this.server.getPlayerList().broadcastSystemMessage(joinMessage, ChatType.SYSTEM); // Paper - Adventure
-         }
-         // CraftBukkit end
- 
++            this.server.getPlayerList().broadcastSystemMessage(joinMessage, false); // Paper - Adventure
+             for (Component line : org.bukkit.craftbukkit.util.CraftChatMessage.fromString(joinMessage)) {
+                 this.server.getPlayerList().broadcastSystemMessage(line, false);
+             }
 @@ -0,0 +0,0 @@ public abstract class PlayerList {
  
      }
@@ -2771,7 +2729,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +    public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) {
 +        if (getHandle().connection == null) return;
 +        final net.minecraft.core.Registry<net.minecraft.network.chat.ChatType> chatTypeRegistry = this.getHandle().level.registryAccess().registryOrThrow(net.minecraft.core.Registry.CHAT_TYPE_REGISTRY);
-+        this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(message, chatTypeRegistry.getId(chatTypeRegistry.get(net.minecraft.network.chat.ChatType.SYSTEM))));
++        this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(message, type == net.kyori.adventure.audience.MessageType.SYSTEM));
 +    }
 +
 +    @Override
diff --git a/patches/unapplied/server/All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/All-chunks-are-slime-spawn-chunks-toggle.patch
similarity index 100%
rename from patches/unapplied/server/All-chunks-are-slime-spawn-chunks-toggle.patch
rename to patches/server/All-chunks-are-slime-spawn-chunks-toggle.patch
diff --git a/patches/unapplied/server/Allow-for-toggling-of-spawn-chunks.patch b/patches/server/Allow-for-toggling-of-spawn-chunks.patch
similarity index 100%
rename from patches/unapplied/server/Allow-for-toggling-of-spawn-chunks.patch
rename to patches/server/Allow-for-toggling-of-spawn-chunks.patch
diff --git a/patches/unapplied/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
similarity index 100%
rename from patches/unapplied/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
rename to patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
diff --git a/patches/unapplied/server/Always-tick-falling-blocks.patch b/patches/server/Always-tick-falling-blocks.patch
similarity index 100%
rename from patches/unapplied/server/Always-tick-falling-blocks.patch
rename to patches/server/Always-tick-falling-blocks.patch
diff --git a/patches/unapplied/server/Be-a-bit-more-informative-in-maxHealth-exception.patch b/patches/server/Be-a-bit-more-informative-in-maxHealth-exception.patch
similarity index 100%
rename from patches/unapplied/server/Be-a-bit-more-informative-in-maxHealth-exception.patch
rename to patches/server/Be-a-bit-more-informative-in-maxHealth-exception.patch
diff --git a/patches/unapplied/server/Check-online-mode-before-converting-and-renaming-pla.patch b/patches/server/Check-online-mode-before-converting-and-renaming-pla.patch
similarity index 100%
rename from patches/unapplied/server/Check-online-mode-before-converting-and-renaming-pla.patch
rename to patches/server/Check-online-mode-before-converting-and-renaming-pla.patch
diff --git a/patches/unapplied/server/Chunk-Save-Reattempt.patch b/patches/server/Chunk-Save-Reattempt.patch
similarity index 100%
rename from patches/unapplied/server/Chunk-Save-Reattempt.patch
rename to patches/server/Chunk-Save-Reattempt.patch
diff --git a/patches/unapplied/server/Complete-resource-pack-API.patch b/patches/server/Complete-resource-pack-API.patch
similarity index 99%
rename from patches/unapplied/server/Complete-resource-pack-API.patch
rename to patches/server/Complete-resource-pack-API.patch
index 36d5a08d04..664405f3ef 100644
--- a/patches/unapplied/server/Complete-resource-pack-API.patch
+++ b/patches/server/Complete-resource-pack-API.patch
@@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
 +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
              ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
              this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"));
          }
diff --git a/patches/unapplied/server/Configurable-Disabling-Cat-Chest-Detection.patch b/patches/server/Configurable-Disabling-Cat-Chest-Detection.patch
similarity index 100%
rename from patches/unapplied/server/Configurable-Disabling-Cat-Chest-Detection.patch
rename to patches/server/Configurable-Disabling-Cat-Chest-Detection.patch
diff --git a/patches/unapplied/server/Configurable-baby-zombie-movement-speed.patch b/patches/server/Configurable-baby-zombie-movement-speed.patch
similarity index 100%
rename from patches/unapplied/server/Configurable-baby-zombie-movement-speed.patch
rename to patches/server/Configurable-baby-zombie-movement-speed.patch
diff --git a/patches/unapplied/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch
similarity index 100%
rename from patches/unapplied/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch
rename to patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch
diff --git a/patches/unapplied/server/Configurable-container-update-tick-rate.patch b/patches/server/Configurable-container-update-tick-rate.patch
similarity index 100%
rename from patches/unapplied/server/Configurable-container-update-tick-rate.patch
rename to patches/server/Configurable-container-update-tick-rate.patch
diff --git a/patches/unapplied/server/Configurable-end-credits.patch b/patches/server/Configurable-end-credits.patch
similarity index 100%
rename from patches/unapplied/server/Configurable-end-credits.patch
rename to patches/server/Configurable-end-credits.patch
diff --git a/patches/unapplied/server/Configurable-fishing-time-ranges.patch b/patches/server/Configurable-fishing-time-ranges.patch
similarity index 100%
rename from patches/unapplied/server/Configurable-fishing-time-ranges.patch
rename to patches/server/Configurable-fishing-time-ranges.patch
diff --git a/patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch b/patches/server/Configurable-inter-world-teleportation-safety.patch
similarity index 100%
rename from patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch
rename to patches/server/Configurable-inter-world-teleportation-safety.patch
diff --git a/patches/unapplied/server/Configurable-mob-spawner-tick-rate.patch b/patches/server/Configurable-mob-spawner-tick-rate.patch
similarity index 100%
rename from patches/unapplied/server/Configurable-mob-spawner-tick-rate.patch
rename to patches/server/Configurable-mob-spawner-tick-rate.patch
diff --git a/patches/unapplied/server/Configurable-top-of-nether-void-damage.patch b/patches/server/Configurable-top-of-nether-void-damage.patch
similarity index 100%
rename from patches/unapplied/server/Configurable-top-of-nether-void-damage.patch
rename to patches/server/Configurable-top-of-nether-void-damage.patch
diff --git a/patches/unapplied/server/Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/Disable-Scoreboards-for-non-players-by-default.patch
similarity index 100%
rename from patches/unapplied/server/Disable-Scoreboards-for-non-players-by-default.patch
rename to patches/server/Disable-Scoreboards-for-non-players-by-default.patch
diff --git a/patches/unapplied/server/Disable-explosion-knockback.patch b/patches/server/Disable-explosion-knockback.patch
similarity index 100%
rename from patches/unapplied/server/Disable-explosion-knockback.patch
rename to patches/server/Disable-explosion-knockback.patch
diff --git a/patches/unapplied/server/Disable-ice-and-snow.patch b/patches/server/Disable-ice-and-snow.patch
similarity index 100%
rename from patches/unapplied/server/Disable-ice-and-snow.patch
rename to patches/server/Disable-ice-and-snow.patch
diff --git a/patches/unapplied/server/Disable-spigot-tick-limiters.patch b/patches/server/Disable-spigot-tick-limiters.patch
similarity index 100%
rename from patches/unapplied/server/Disable-spigot-tick-limiters.patch
rename to patches/server/Disable-spigot-tick-limiters.patch
diff --git a/patches/unapplied/server/Disable-thunder.patch b/patches/server/Disable-thunder.patch
similarity index 100%
rename from patches/unapplied/server/Disable-thunder.patch
rename to patches/server/Disable-thunder.patch
diff --git a/patches/unapplied/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch b/patches/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch
similarity index 86%
rename from patches/unapplied/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch
rename to patches/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch
index a133ea7e4c..f4f710b3a0 100644
--- a/patches/unapplied/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch
+++ b/patches/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch
@@ -12,15 +12,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 @@ -0,0 +0,0 @@ public record ClientboundSystemChatPacket(@javax.annotation.Nullable net.kyori.a
      }
  
-     public ClientboundSystemChatPacket(net.md_5.bungee.api.chat.BaseComponent[] content, int typeId) {
--        this(null, net.md_5.bungee.chat.ComponentSerializer.toString(content), typeId); // Paper - Adventure
-+        this(null, improveBungeeComponentSerialization(content), typeId); // Paper - Adventure & don't nest if we don't need to so that we can preserve formatting
+     public ClientboundSystemChatPacket(net.md_5.bungee.api.chat.BaseComponent[] content, boolean overlay) {
+-        this(null, net.md_5.bungee.chat.ComponentSerializer.toString(content), overlay); // Paper - Adventure
++        this(null, improveBungeeComponentSerialization(content), overlay); // Paper - Adventure
      }
      // Spigot end
      // Paper start
 @@ -0,0 +0,0 @@ public record ClientboundSystemChatPacket(@javax.annotation.Nullable net.kyori.a
-     public ClientboundSystemChatPacket(net.kyori.adventure.text.Component content, int typeId) {
-         this(content, null, typeId);
+     public ClientboundSystemChatPacket(net.kyori.adventure.text.Component content, boolean overlay) {
+         this(content, null, overlay);
      }
 +
 +    private static String improveBungeeComponentSerialization(net.md_5.bungee.api.chat.BaseComponent[] content) {
diff --git a/patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch
similarity index 100%
rename from patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch
rename to patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch
diff --git a/patches/unapplied/server/Ensure-commands-are-not-ran-async.patch b/patches/server/Ensure-commands-are-not-ran-async.patch
similarity index 98%
rename from patches/unapplied/server/Ensure-commands-are-not-ran-async.patch
rename to patches/server/Ensure-commands-are-not-ran-async.patch
index cd8f61c950..9ad910dc37 100644
--- a/patches/unapplied/server/Ensure-commands-are-not-ran-async.patch
+++ b/patches/server/Ensure-commands-are-not-ran-async.patch
@@ -17,8 +17,8 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
 +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
-         }
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
+         OutgoingPlayerChatMessage outgoing = OutgoingPlayerChatMessage.create(original);
  
          if (!async && s.startsWith("/")) {
 +            // Paper Start
diff --git a/patches/unapplied/server/Ensure-inv-drag-is-in-bounds.patch b/patches/server/Ensure-inv-drag-is-in-bounds.patch
similarity index 100%
rename from patches/unapplied/server/Ensure-inv-drag-is-in-bounds.patch
rename to patches/server/Ensure-inv-drag-is-in-bounds.patch
diff --git a/patches/unapplied/server/Entity-Origin-API.patch b/patches/server/Entity-Origin-API.patch
similarity index 100%
rename from patches/unapplied/server/Entity-Origin-API.patch
rename to patches/server/Entity-Origin-API.patch
diff --git a/patches/unapplied/server/Expose-server-CommandMap.patch b/patches/server/Expose-server-CommandMap.patch
similarity index 100%
rename from patches/unapplied/server/Expose-server-CommandMap.patch
rename to patches/server/Expose-server-CommandMap.patch
diff --git a/patches/unapplied/server/Fix-lag-from-explosions-processing-dead-entities.patch b/patches/server/Fix-lag-from-explosions-processing-dead-entities.patch
similarity index 100%
rename from patches/unapplied/server/Fix-lag-from-explosions-processing-dead-entities.patch
rename to patches/server/Fix-lag-from-explosions-processing-dead-entities.patch
diff --git a/patches/unapplied/server/Further-improve-server-tick-loop.patch b/patches/server/Further-improve-server-tick-loop.patch
similarity index 100%
rename from patches/unapplied/server/Further-improve-server-tick-loop.patch
rename to patches/server/Further-improve-server-tick-loop.patch
diff --git a/patches/unapplied/server/Implement-Paper-VersionChecker.patch b/patches/server/Implement-Paper-VersionChecker.patch
similarity index 100%
rename from patches/unapplied/server/Implement-Paper-VersionChecker.patch
rename to patches/server/Implement-Paper-VersionChecker.patch
diff --git a/patches/unapplied/server/Implement-PlayerLocaleChangeEvent.patch b/patches/server/Implement-PlayerLocaleChangeEvent.patch
similarity index 100%
rename from patches/unapplied/server/Implement-PlayerLocaleChangeEvent.patch
rename to patches/server/Implement-PlayerLocaleChangeEvent.patch
diff --git a/patches/unapplied/server/Not-implemeneted.patch b/patches/server/Not-implemeneted.patch
similarity index 100%
rename from patches/unapplied/server/Not-implemeneted.patch
rename to patches/server/Not-implemeneted.patch
diff --git a/patches/unapplied/server/Only-refresh-abilities-if-needed.patch b/patches/server/Only-refresh-abilities-if-needed.patch
similarity index 100%
rename from patches/unapplied/server/Only-refresh-abilities-if-needed.patch
rename to patches/server/Only-refresh-abilities-if-needed.patch
diff --git a/patches/unapplied/server/Optimize-explosions.patch b/patches/server/Optimize-explosions.patch
similarity index 100%
rename from patches/unapplied/server/Optimize-explosions.patch
rename to patches/server/Optimize-explosions.patch
diff --git a/patches/unapplied/server/Paper-Metrics.patch b/patches/server/Paper-Metrics.patch
similarity index 100%
rename from patches/unapplied/server/Paper-Metrics.patch
rename to patches/server/Paper-Metrics.patch
diff --git a/patches/unapplied/server/Paper-command.patch b/patches/server/Paper-command.patch
similarity index 100%
rename from patches/unapplied/server/Paper-command.patch
rename to patches/server/Paper-command.patch
diff --git a/patches/unapplied/server/Per-Player-View-Distance-API-placeholders.patch b/patches/server/Per-Player-View-Distance-API-placeholders.patch
similarity index 100%
rename from patches/unapplied/server/Per-Player-View-Distance-API-placeholders.patch
rename to patches/server/Per-Player-View-Distance-API-placeholders.patch
diff --git a/patches/unapplied/server/Player-Tab-List-and-Title-APIs.patch b/patches/server/Player-Tab-List-and-Title-APIs.patch
similarity index 100%
rename from patches/unapplied/server/Player-Tab-List-and-Title-APIs.patch
rename to patches/server/Player-Tab-List-and-Title-APIs.patch
diff --git a/patches/unapplied/server/Player-affects-spawning-API.patch b/patches/server/Player-affects-spawning-API.patch
similarity index 100%
rename from patches/unapplied/server/Player-affects-spawning-API.patch
rename to patches/server/Player-affects-spawning-API.patch
diff --git a/patches/unapplied/server/Prevent-tile-entity-and-entity-crashes.patch b/patches/server/Prevent-tile-entity-and-entity-crashes.patch
similarity index 100%
rename from patches/unapplied/server/Prevent-tile-entity-and-entity-crashes.patch
rename to patches/server/Prevent-tile-entity-and-entity-crashes.patch
diff --git a/patches/unapplied/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
similarity index 100%
rename from patches/unapplied/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
rename to patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
diff --git a/patches/unapplied/server/Timings-v2.patch b/patches/server/Timings-v2.patch
similarity index 99%
rename from patches/unapplied/server/Timings-v2.patch
rename to patches/server/Timings-v2.patch
index 6a44ed704e..4d5a49a8cc 100644
--- a/patches/unapplied/server/Timings-v2.patch
+++ b/patches/server/Timings-v2.patch
@@ -732,7 +732,7 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/server/MinecraftServer.java
 +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.generator.CustomWorldChunkManager;
+@@ -0,0 +0,0 @@ import org.bukkit.event.player.AsyncPlayerChatPreviewEvent;
  import org.bukkit.event.server.ServerLoadEvent;
  // CraftBukkit end
  
@@ -1265,15 +1265,15 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
 +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
-     // CraftBukkit end
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
  
+     @Override
      public void tick() {
 -        org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.startTiming(); // Spigot
          if (this.ackBlockChangesUpTo > -1) {
              this.send(new ClientboundBlockChangedAckPacket(this.ackBlockChangesUpTo));
              this.ackBlockChangesUpTo = -1;
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
              this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
              this.disconnect(Component.translatable("multiplayer.disconnect.idling"));
          }
@@ -1281,7 +1281,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  
          this.chatPreviewThrottler.tick();
      }
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
      }
  
      private void handleCommand(String s) {
@@ -1290,7 +1290,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
          this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
  
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
          this.cserver.getPluginManager().callEvent(event);
  
          if (event.isCancelled()) {
@@ -1299,7 +1299,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
              return;
          }
  
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
              java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
              return;
          } finally {
@@ -1449,9 +1449,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
              }
          }
  
--        SpigotTimings.timerEntityBaseTick.stopTiming(); // Spigot
-         this.aiStep();
--        SpigotTimings.timerEntityTickRest.startTiming(); // Spigot
+-        if (!this.isRemoved()) {
+-            SpigotTimings.timerEntityBaseTick.stopTiming(); // Spigot
+-            this.aiStep();
+-            SpigotTimings.timerEntityTickRest.startTiming(); // Spigot
+-        }
+-
          double d0 = this.getX() - this.xo;
          double d1 = this.getZ() - this.zo;
          float f = (float) (d0 * d0 + d1 * d1);
@@ -1844,7 +1847,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
 @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
  
-             CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, i));
+             CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR));
          }
 +
 +        // Paper start
diff --git a/patches/unapplied/server/Use-UserCache-for-player-heads.patch b/patches/server/Use-UserCache-for-player-heads.patch
similarity index 100%
rename from patches/unapplied/server/Use-UserCache-for-player-heads.patch
rename to patches/server/Use-UserCache-for-player-heads.patch