From 7b6a88056cbeab3eb2056c06e2d5a8a3ab01bdb0 Mon Sep 17 00:00:00 2001
From: Noah van der Aa <ndvdaa@gmail.com>
Date: Thu, 21 Sep 2023 22:35:39 +0200
Subject: [PATCH] more more more more work

---
 ...to-control-if-armour-stands-can-move.patch |  0
 .../server/Add-EntityZapEvent.patch           |  0
 .../server/Add-PlayerJumpEvent.patch          |  2 +-
 .../server/Add-ProjectileCollideEvent.patch   |  0
 .../server/Add-UnknownCommandEvent.patch      |  0
 ...n-option-to-prevent-player-names-fro.patch |  0
 ...ke-parrots-stay-on-shoulders-despite.patch |  2 +-
 .../server/Add-server-name-parameter.patch    |  0
 ...setting-for-proxy-online-mode-status.patch |  8 +++----
 .../Add-source-to-PlayerExpChangeEvent.patch  |  0
 .../Allow-Reloading-of-Command-Aliases.patch  |  0
 ...-a-custom-authentication-servers-dow.patch |  4 ++--
 ...blocking-on-Network-Manager-creation.patch |  6 ++---
 .../server/Basic-PlayerProfile-API.patch      |  6 ++---
 ...player-logins-during-server-shutdown.patch |  6 ++---
 .../Bound-Treasure-Maps-to-World-Border.patch |  0
 .../Cache-user-authenticator-threads.patch    | 22 ++++++++---------
 .../server/Cap-Entity-Collisions.patch        | 18 +++++++-------
 ...figurable-Cartographer-Treasure-Maps.patch |  0
 .../Configurable-flying-kick-messages.patch   |  4 ++--
 ...onfigurable-packet-in-spam-threshold.patch |  2 +-
 .../server/Do-not-let-armorstands-drown.patch |  0
 ...-profile-lookups-to-worldgen-threads.patch | 24 +++++++++----------
 ...e-profiles-that-have-no-UUID-and-no-.patch |  2 +-
 .../server/Enforce-Sync-Player-Saves.patch    |  0
 .../server/Entity-fromMobSpawner.patch        |  0
 ...PI-for-Reason-Source-Triggering-play.patch |  0
 ...nt-protocol-version-and-virtual-host.patch |  8 +++----
 ...-entity-nbt-data-from-falling-blocks.patch |  0
 .../server/Firework-API-s.patch               |  0
 .../server/Fix-this-stupid-bullshit.patch     |  2 +-
 ...n-prefixes-using-Log4J-configuration.patch |  0
 ...mplement-ensureServerConversions-API.patch |  0
 .../server/Implement-getI18NDisplayName.patch |  0
 ...e-Log4J-Configuration-Plugin-Loggers.patch |  0
 .../Improve-the-Saddle-API-for-Horses.patch   |  0
 .../server/Item-canEntityPickup.patch         |  0
 .../server/LivingEntity-setKiller.patch       |  0
 ...awns-should-honor-nametags-and-leash.patch |  0
 ...-sounds-to-same-world-if-limiting-ra.patch |  0
 ...ptimise-BlockState-s-hashCode-equals.patch |  6 ++---
 ...imize-World.isLoaded-BlockPosition-Z.patch |  0
 .../server/PlayerAttemptPickupItemEvent.patch |  0
 ...PlayerPickupItemEvent-setFlyAtPlayer.patch |  0
 .../PlayerTeleportEndGatewayEvent.patch       |  0
 ...vent-Pathfinding-out-of-World-Border.patch |  0
 .../server/Profile-Lookup-Events.patch        |  0
 .../server/ProfileWhitelistVerifyEvent.patch  |  2 +-
 .../Properly-fix-item-duplication-bug.patch   |  8 +++----
 ...le-async-calls-to-restart-the-server.patch |  0
 ...rovide-E-TE-Chunk-count-stat-methods.patch |  0
 ...e-CraftScheduler-Async-Task-Debugger.patch |  0
 ...imer-when-spawner-event-is-cancelled.patch |  0
 .../Shoulder-Entities-Release-API.patch       |  0
 .../server/String-based-Action-Bar-API.patch  |  0
 ...oleAppender-for-console-improvements.patch |  4 ++--
 ...dle-ServerboundKeepAlivePacket-async.patch | 15 ++++++------
 ...urable-option-to-disable-creeper-lin.patch |  0
 58 files changed, 77 insertions(+), 74 deletions(-)
 rename patches/{unapplied => }/server/Add-API-methods-to-control-if-armour-stands-can-move.patch (100%)
 rename patches/{unapplied => }/server/Add-EntityZapEvent.patch (100%)
 rename patches/{unapplied => }/server/Add-PlayerJumpEvent.patch (96%)
 rename patches/{unapplied => }/server/Add-ProjectileCollideEvent.patch (100%)
 rename patches/{unapplied => }/server/Add-UnknownCommandEvent.patch (100%)
 rename patches/{unapplied => }/server/Add-configuration-option-to-prevent-player-names-fro.patch (100%)
 rename patches/{unapplied => }/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch (96%)
 rename patches/{unapplied => }/server/Add-server-name-parameter.patch (100%)
 rename patches/{unapplied => }/server/Add-setting-for-proxy-online-mode-status.patch (89%)
 rename patches/{unapplied => }/server/Add-source-to-PlayerExpChangeEvent.patch (100%)
 rename patches/{unapplied => }/server/Allow-Reloading-of-Command-Aliases.patch (100%)
 rename patches/{unapplied => }/server/Allow-specifying-a-custom-authentication-servers-dow.patch (82%)
 rename patches/{unapplied => }/server/Avoid-blocking-on-Network-Manager-creation.patch (89%)
 rename patches/{unapplied => }/server/Basic-PlayerProfile-API.patch (99%)
 rename patches/{unapplied => }/server/Block-player-logins-during-server-shutdown.patch (84%)
 rename patches/{unapplied => }/server/Bound-Treasure-Maps-to-World-Border.patch (100%)
 rename patches/{unapplied => }/server/Cache-user-authenticator-threads.patch (90%)
 rename patches/{unapplied => }/server/Cap-Entity-Collisions.patch (73%)
 rename patches/{unapplied => }/server/Configurable-Cartographer-Treasure-Maps.patch (100%)
 rename patches/{unapplied => }/server/Configurable-flying-kick-messages.patch (90%)
 rename patches/{unapplied => }/server/Configurable-packet-in-spam-threshold.patch (94%)
 rename patches/{unapplied => }/server/Do-not-let-armorstands-drown.patch (100%)
 rename patches/{unapplied => }/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch (79%)
 rename patches/{unapplied => }/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch (89%)
 rename patches/{unapplied => }/server/Enforce-Sync-Player-Saves.patch (100%)
 rename patches/{unapplied => }/server/Entity-fromMobSpawner.patch (100%)
 rename patches/{unapplied => }/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch (100%)
 rename patches/{unapplied => }/server/Expose-client-protocol-version-and-virtual-host.patch (96%)
 rename patches/{unapplied => }/server/Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch (100%)
 rename patches/{unapplied => }/server/Firework-API-s.patch (100%)
 rename patches/{unapplied => }/server/Fix-this-stupid-bullshit.patch (97%)
 rename patches/{unapplied => }/server/Handle-plugin-prefixes-using-Log4J-configuration.patch (100%)
 rename patches/{unapplied => }/server/Implement-ensureServerConversions-API.patch (100%)
 rename patches/{unapplied => }/server/Implement-getI18NDisplayName.patch (100%)
 rename patches/{unapplied => }/server/Improve-Log4J-Configuration-Plugin-Loggers.patch (100%)
 rename patches/{unapplied => }/server/Improve-the-Saddle-API-for-Horses.patch (100%)
 rename patches/{unapplied => }/server/Item-canEntityPickup.patch (100%)
 rename patches/{unapplied => }/server/LivingEntity-setKiller.patch (100%)
 rename patches/{unapplied => }/server/Ocelot-despawns-should-honor-nametags-and-leash.patch (100%)
 rename patches/{unapplied => }/server/Only-send-global-sounds-to-same-world-if-limiting-ra.patch (100%)
 rename patches/{unapplied => }/server/Optimise-BlockState-s-hashCode-equals.patch (93%)
 rename patches/{unapplied => }/server/Optimize-World.isLoaded-BlockPosition-Z.patch (100%)
 rename patches/{unapplied => }/server/PlayerAttemptPickupItemEvent.patch (100%)
 rename patches/{unapplied => }/server/PlayerPickupItemEvent-setFlyAtPlayer.patch (100%)
 rename patches/{unapplied => }/server/PlayerTeleportEndGatewayEvent.patch (100%)
 rename patches/{unapplied => }/server/Prevent-Pathfinding-out-of-World-Border.patch (100%)
 rename patches/{unapplied => }/server/Profile-Lookup-Events.patch (100%)
 rename patches/{unapplied => }/server/ProfileWhitelistVerifyEvent.patch (96%)
 rename patches/{unapplied => }/server/Properly-fix-item-duplication-bug.patch (74%)
 rename patches/{unapplied => }/server/Properly-handle-async-calls-to-restart-the-server.patch (100%)
 rename patches/{unapplied => }/server/Provide-E-TE-Chunk-count-stat-methods.patch (100%)
 rename patches/{unapplied => }/server/Remove-CraftScheduler-Async-Task-Debugger.patch (100%)
 rename patches/{unapplied => }/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch (100%)
 rename patches/{unapplied => }/server/Shoulder-Entities-Release-API.patch (100%)
 rename patches/{unapplied => }/server/String-based-Action-Bar-API.patch (100%)
 rename patches/{unapplied => }/server/Use-TerminalConsoleAppender-for-console-improvements.patch (99%)
 rename patches/{unapplied => }/server/handle-ServerboundKeepAlivePacket-async.patch (68%)
 rename patches/{unapplied => }/server/provide-a-configurable-option-to-disable-creeper-lin.patch (100%)

diff --git a/patches/unapplied/server/Add-API-methods-to-control-if-armour-stands-can-move.patch b/patches/server/Add-API-methods-to-control-if-armour-stands-can-move.patch
similarity index 100%
rename from patches/unapplied/server/Add-API-methods-to-control-if-armour-stands-can-move.patch
rename to patches/server/Add-API-methods-to-control-if-armour-stands-can-move.patch
diff --git a/patches/unapplied/server/Add-EntityZapEvent.patch b/patches/server/Add-EntityZapEvent.patch
similarity index 100%
rename from patches/unapplied/server/Add-EntityZapEvent.patch
rename to patches/server/Add-EntityZapEvent.patch
diff --git a/patches/unapplied/server/Add-PlayerJumpEvent.patch b/patches/server/Add-PlayerJumpEvent.patch
similarity index 96%
rename from patches/unapplied/server/Add-PlayerJumpEvent.patch
rename to patches/server/Add-PlayerJumpEvent.patch
index 74dd174c76..0ecf44effa 100644
--- a/patches/unapplied/server/Add-PlayerJumpEvent.patch
+++ b/patches/server/Add-PlayerJumpEvent.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, Tic
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
                              boolean flag = d7 > 0.0D;
  
                              if (this.player.onGround() && !packet.isOnGround() && flag) {
diff --git a/patches/unapplied/server/Add-ProjectileCollideEvent.patch b/patches/server/Add-ProjectileCollideEvent.patch
similarity index 100%
rename from patches/unapplied/server/Add-ProjectileCollideEvent.patch
rename to patches/server/Add-ProjectileCollideEvent.patch
diff --git a/patches/unapplied/server/Add-UnknownCommandEvent.patch b/patches/server/Add-UnknownCommandEvent.patch
similarity index 100%
rename from patches/unapplied/server/Add-UnknownCommandEvent.patch
rename to patches/server/Add-UnknownCommandEvent.patch
diff --git a/patches/unapplied/server/Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/Add-configuration-option-to-prevent-player-names-fro.patch
similarity index 100%
rename from patches/unapplied/server/Add-configuration-option-to-prevent-player-names-fro.patch
rename to patches/server/Add-configuration-option-to-prevent-player-names-fro.patch
diff --git a/patches/unapplied/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/patches/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch
similarity index 96%
rename from patches/unapplied/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch
rename to patches/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch
index fb26dbf154..011ccefd37 100644
--- a/patches/unapplied/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch
+++ b/patches/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch
@@ -17,7 +17,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, Tic
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
          switch (packet.getAction()) {
              case PRESS_SHIFT_KEY:
                  this.player.setShiftKeyDown(true);
diff --git a/patches/unapplied/server/Add-server-name-parameter.patch b/patches/server/Add-server-name-parameter.patch
similarity index 100%
rename from patches/unapplied/server/Add-server-name-parameter.patch
rename to patches/server/Add-server-name-parameter.patch
diff --git a/patches/unapplied/server/Add-setting-for-proxy-online-mode-status.patch b/patches/server/Add-setting-for-proxy-online-mode-status.patch
similarity index 89%
rename from patches/unapplied/server/Add-setting-for-proxy-online-mode-status.patch
rename to patches/server/Add-setting-for-proxy-online-mode-status.patch
index 77b418d7b5..6ed4800218 100644
--- a/patches/unapplied/server/Add-setting-for-proxy-online-mode-status.patch
+++ b/patches/server/Add-setting-for-proxy-online-mode-status.patch
@@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 -        if (!org.apache.commons.lang3.StringUtils.isBlank(name)) // Paper - Don't lookup a profile with a blank name)
 +        if (!org.apache.commons.lang3.StringUtils.isBlank(name) // Paper - Don't lookup a profile with a blank name
 +                && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) // Paper - only run in online mode - 100 COL
-         repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback);
+         repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
          GameProfile gameprofile = (GameProfile) atomicreference.get();
  
 @@ -0,0 +0,0 @@ public class GameProfileCache {
@@ -37,9 +37,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          });
  
 -        if (server.usesAuthentication() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
-+        if (server.usesAuthentication()
-+                || (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now.  // Paper - Handle via setting
-             server.getProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback);
++        if (server.usesAuthentication() ||
++            (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now.  // Paper - Handle via setting
+             server.getProfileRepository().findProfilesByNames(astring, callback);
          } else {
              String[] astring1 = astring;
 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
diff --git a/patches/unapplied/server/Add-source-to-PlayerExpChangeEvent.patch b/patches/server/Add-source-to-PlayerExpChangeEvent.patch
similarity index 100%
rename from patches/unapplied/server/Add-source-to-PlayerExpChangeEvent.patch
rename to patches/server/Add-source-to-PlayerExpChangeEvent.patch
diff --git a/patches/unapplied/server/Allow-Reloading-of-Command-Aliases.patch b/patches/server/Allow-Reloading-of-Command-Aliases.patch
similarity index 100%
rename from patches/unapplied/server/Allow-Reloading-of-Command-Aliases.patch
rename to patches/server/Allow-Reloading-of-Command-Aliases.patch
diff --git a/patches/unapplied/server/Allow-specifying-a-custom-authentication-servers-dow.patch b/patches/server/Allow-specifying-a-custom-authentication-servers-dow.patch
similarity index 82%
rename from patches/unapplied/server/Allow-specifying-a-custom-authentication-servers-dow.patch
rename to patches/server/Allow-specifying-a-custom-authentication-servers-dow.patch
index ec75f8033f..41de4fbb8e 100644
--- a/patches/unapplied/server/Allow-specifying-a-custom-authentication-servers-dow.patch
+++ b/patches/server/Allow-specifying-a-custom-authentication-servers-dow.patch
@@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- 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,
-                         ServerLoginPacketListenerImpl.this.gameProfile = gameprofile;
-                         ServerLoginPacketListenerImpl.this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
+                         ServerLoginPacketListenerImpl.LOGGER.warn("Authentication servers are down but will let them in anyway!");
+                         ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(s1)); // Spigot
                      } else {
 -                        ServerLoginPacketListenerImpl.this.disconnect(Component.translatable("multiplayer.disconnect.authservers_down"));
 +                        ServerLoginPacketListenerImpl.this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.authenticationServersDown)); // Paper
diff --git a/patches/unapplied/server/Avoid-blocking-on-Network-Manager-creation.patch b/patches/server/Avoid-blocking-on-Network-Manager-creation.patch
similarity index 89%
rename from patches/unapplied/server/Avoid-blocking-on-Network-Manager-creation.patch
rename to patches/server/Avoid-blocking-on-Network-Manager-creation.patch
index df3ef3dffa..ba22f8524a 100644
--- a/patches/unapplied/server/Avoid-blocking-on-Network-Manager-creation.patch
+++ b/patches/server/Avoid-blocking-on-Network-Manager-creation.patch
@@ -30,10 +30,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
                      Connection object = j > 0 ? new RateKickingConnection(j) : new Connection(PacketFlow.SERVERBOUND); // CraftBukkit - decompile error
  
 -                    ServerConnectionListener.this.connections.add(object);
-+                    //ServerConnectionListener.this.connections.add(object);
++                    //ServerConnectionListener.this.connections.add(object); // Paper
 +                    pending.add(object); // Paper
-                     channelpipeline.addLast("packet_handler", (ChannelHandler) object);
-                     ((Connection) object).setListener(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object));
+                     ((Connection) object).configurePacketHandler(channelpipeline);
+                     ((Connection) object).setListenerForServerboundHandshake(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object));
                  }
 @@ -0,0 +0,0 @@ public class ServerConnectionListener {
  
diff --git a/patches/unapplied/server/Basic-PlayerProfile-API.patch b/patches/server/Basic-PlayerProfile-API.patch
similarity index 99%
rename from patches/unapplied/server/Basic-PlayerProfile-API.patch
rename to patches/server/Basic-PlayerProfile-API.patch
index 43226f8a69..9f4979f210 100644
--- a/patches/unapplied/server/Basic-PlayerProfile-API.patch
+++ b/patches/server/Basic-PlayerProfile-API.patch
@@ -576,8 +576,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  import com.google.common.util.concurrent.ThreadFactoryBuilder;
  import io.papermc.paper.math.BlockPosition;
  import io.papermc.paper.math.FinePosition;
-@@ -0,0 +0,0 @@ import net.minecraft.world.level.chunk.ChunkAccess;
- import net.minecraft.world.level.chunk.ChunkStatus;
+@@ -0,0 +0,0 @@ import net.minecraft.world.level.ClipContext;
+ import net.minecraft.world.level.Level;
  import net.minecraft.world.phys.Vec3;
  import org.apache.commons.lang.exception.ExceptionUtils;
 +import com.mojang.authlib.GameProfile;
@@ -738,7 +738,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          String name = ConfigSerializationUtil.getString(map, "name", true);
  
 @@ -0,0 +0,0 @@ public final class CraftPlayerProfile implements PlayerProfile {
-                 profile.properties.put(property.getName(), property);
+                 profile.properties.put(property.name(), property);
              }
          }
 -
diff --git a/patches/unapplied/server/Block-player-logins-during-server-shutdown.patch b/patches/server/Block-player-logins-during-server-shutdown.patch
similarity index 84%
rename from patches/unapplied/server/Block-player-logins-during-server-shutdown.patch
rename to patches/server/Block-player-logins-during-server-shutdown.patch
index d9e296a01c..29c66f204e 100644
--- a/patches/unapplied/server/Block-player-logins-during-server-shutdown.patch
+++ b/patches/server/Block-player-logins-during-server-shutdown.patch
@@ -18,6 +18,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +            return;
 +        }
 +        // Paper end
-         if (this.state == ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT) {
-             this.handleAcceptedLogin();
-         } else if (this.state == ServerLoginPacketListenerImpl.State.DELAY_ACCEPT) {
+         if (this.state == ServerLoginPacketListenerImpl.State.VERIFYING) {
+             this.verifyLoginAndFinishConnectionSetup((GameProfile) Objects.requireNonNull(this.authenticatedProfile));
+         }
diff --git a/patches/unapplied/server/Bound-Treasure-Maps-to-World-Border.patch b/patches/server/Bound-Treasure-Maps-to-World-Border.patch
similarity index 100%
rename from patches/unapplied/server/Bound-Treasure-Maps-to-World-Border.patch
rename to patches/server/Bound-Treasure-Maps-to-World-Border.patch
diff --git a/patches/unapplied/server/Cache-user-authenticator-threads.patch b/patches/server/Cache-user-authenticator-threads.patch
similarity index 90%
rename from patches/unapplied/server/Cache-user-authenticator-threads.patch
rename to patches/server/Cache-user-authenticator-threads.patch
index de12cca6ae..cebf07fab6 100644
--- a/patches/unapplied/server/Cache-user-authenticator-threads.patch
+++ b/patches/server/Cache-user-authenticator-threads.patch
@@ -8,15 +8,6 @@ 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,
- 
-     }
- 
-+    private static final java.util.concurrent.ExecutorService authenticatorPool = java.util.concurrent.Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("User Authenticator #%d").setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LOGGER)).build()); // Paper - Cache authenticator threads
-+
-     // Spigot start
-     public void initUUID()
-     {
 @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
                  this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.challenge));
              } else {
@@ -29,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
                      public void run() {
                          try {
 @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
-                             server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + ServerLoginPacketListenerImpl.this.gameProfile.getName(), ex);
+                             server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + ServerLoginPacketListenerImpl.this.requestedUsername, ex);
                          }
                      }
 -                }.start();
@@ -46,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +        // Paper start - Cache authenticator threads
 +        authenticatorPool.execute(new Runnable() {
              public void run() {
-                 GameProfile gameprofile = ServerLoginPacketListenerImpl.this.gameProfile;
+                 String s1 = (String) Objects.requireNonNull(ServerLoginPacketListenerImpl.this.requestedUsername, "Player name not initialized");
  
 @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
  
@@ -61,3 +52,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
      }
  
      // Spigot start
+@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
+         this.state = ServerLoginPacketListenerImpl.State.ACCEPTED;
+     }
+ 
++    private static final java.util.concurrent.ExecutorService authenticatorPool = java.util.concurrent.Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("User Authenticator #%d").setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LOGGER)).build()); // Paper - Cache authenticator threads
++
+     // Spigot start
+     protected GameProfile createOfflineProfile(String name) {
+         UUID uuid;
diff --git a/patches/unapplied/server/Cap-Entity-Collisions.patch b/patches/server/Cap-Entity-Collisions.patch
similarity index 73%
rename from patches/unapplied/server/Cap-Entity-Collisions.patch
rename to patches/server/Cap-Entity-Collisions.patch
index 0d2146a0b4..356e44b415 100644
--- a/patches/unapplied/server/Cap-Entity-Collisions.patch
+++ b/patches/server/Cap-Entity-Collisions.patch
@@ -28,15 +28,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
 +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
 @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
-                     }
                  }
  
--                for (j = 0; j < list.size(); ++j) {
-+            this.numCollisions = Math.max(0, this.numCollisions - this.level().paperConfig().collisions.maxEntityCollisions); // Paper
-+            for (j = 0; j < list.size() && this.numCollisions < this.level().paperConfig().collisions.maxEntityCollisions; ++j) { // Paper
-                     Entity entity = (Entity) list.get(j);
-+                entity.numCollisions++; // Paper
-+                this.numCollisions++; // Paper
+                 Iterator iterator1 = list.iterator();
++                this.numCollisions = Math.max(0, this.numCollisions - this.level().paperConfig().collisions.maxEntityCollisions); // Paper
  
-                     this.doPush(entity);
+-                while (iterator1.hasNext()) {
++                while (iterator1.hasNext() && this.numCollisions < this.level().paperConfig().collisions.maxEntityCollisions) { // Paper
+                     Entity entity1 = (Entity) iterator1.next();
+-
++                    entity1.numCollisions++; // Paper
++                    this.numCollisions++; // Paper
+                     this.doPush(entity1);
                  }
+             }
diff --git a/patches/unapplied/server/Configurable-Cartographer-Treasure-Maps.patch b/patches/server/Configurable-Cartographer-Treasure-Maps.patch
similarity index 100%
rename from patches/unapplied/server/Configurable-Cartographer-Treasure-Maps.patch
rename to patches/server/Configurable-Cartographer-Treasure-Maps.patch
diff --git a/patches/unapplied/server/Configurable-flying-kick-messages.patch b/patches/server/Configurable-flying-kick-messages.patch
similarity index 90%
rename from patches/unapplied/server/Configurable-flying-kick-messages.patch
rename to patches/server/Configurable-flying-kick-messages.patch
index a07b4ff931..7937b54f2b 100644
--- a/patches/unapplied/server/Configurable-flying-kick-messages.patch
+++ b/patches/server/Configurable-flying-kick-messages.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, Tic
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
          if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger() && !this.player.isDeadOrDying()) {
              if (++this.aboveGroundTickCount > 80) {
                  ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
                  return;
              }
          } else {
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
              if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) {
                  if (++this.aboveGroundVehicleTickCount > 80) {
                      ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
diff --git a/patches/unapplied/server/Configurable-packet-in-spam-threshold.patch b/patches/server/Configurable-packet-in-spam-threshold.patch
similarity index 94%
rename from patches/unapplied/server/Configurable-packet-in-spam-threshold.patch
rename to patches/server/Configurable-packet-in-spam-threshold.patch
index 4b042c096b..a6ff586248 100644
--- a/patches/unapplied/server/Configurable-packet-in-spam-threshold.patch
+++ b/patches/server/Configurable-packet-in-spam-threshold.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, Tic
+@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
      // Spigot start - limit place/interactions
      private int limitedPackets;
      private long lastLimitedPacket = -1;
diff --git a/patches/unapplied/server/Do-not-let-armorstands-drown.patch b/patches/server/Do-not-let-armorstands-drown.patch
similarity index 100%
rename from patches/unapplied/server/Do-not-let-armorstands-drown.patch
rename to patches/server/Do-not-let-armorstands-drown.patch
diff --git a/patches/unapplied/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch b/patches/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch
similarity index 79%
rename from patches/unapplied/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch
rename to patches/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch
index 751a5c73b3..b65f6da14f 100644
--- a/patches/unapplied/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch
+++ b/patches/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch
@@ -35,33 +35,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +    // Paper end - don't submit BLOCKING PROFILE LOOKUPS to the world gen thread
      private static final ExecutorService IO_POOL = makeIoExecutor();
      private static final DateTimeFormatter FILENAME_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH.mm.ss", Locale.ROOT);
-     public static TimeSource.NanoTimeSource timeSource = System::nanoTime;
+     public static final long NANOS_PER_MILLI = 1000000L;
 diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
 +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
 @@ -0,0 +0,0 @@ public class GameProfileCache {
              } else {
-                 this.requests.put(username, CompletableFuture.supplyAsync(() -> {
+                 CompletableFuture<Optional<GameProfile>> completablefuture1 = CompletableFuture.supplyAsync(() -> {
                      return this.get(username);
 -                }, Util.backgroundExecutor()).whenCompleteAsync((optional, throwable) -> {
 +                }, Util.PROFILE_EXECUTOR).whenCompleteAsync((optional, throwable) -> { // Paper - not a good idea to use BLOCKING OPERATIONS on the worldgen executor
                      this.requests.remove(username);
-                 }, this.executor).whenCompleteAsync((optional, throwable) -> {
-                     consumer.accept(optional);
+                 }, this.executor);
+ 
 diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
 +++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
 @@ -0,0 +0,0 @@ public class SkullBlockEntity extends BlockEntity {
-     public static void updateGameprofile(@Nullable GameProfile owner, Consumer<GameProfile> callback) {
-         if (owner != null && !StringUtil.isNullOrEmpty(owner.getName()) && (!owner.isComplete() || !owner.getProperties().containsKey("textures")) && profileCache != null && sessionService != null) {
-             profileCache.getAsync(owner.getName(), (profile) -> {
--                Util.backgroundExecutor().execute(() -> {
-+                Util.PROFILE_EXECUTOR.execute(() -> { // Paper - not a good idea to use BLOCKING OPERATIONS on the worldgen executor
-                     Util.ifElse(profile, (profilex) -> {
-                         Property property = Iterables.getFirst(profilex.getProperties().get("textures"), (Property)null);
-                         if (property == null) {
+             } else {
+                 return Optional.empty();
+             }
+-        }, Util.backgroundExecutor());
++        }, Util.PROFILE_EXECUTOR); // Paper - not a good idea to use BLOCKING OPERATIONS on the worldgen executor
+     }
+ 
+     private static boolean hasTextures(GameProfile profile) {
 diff --git a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
diff --git a/patches/unapplied/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/patches/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
similarity index 89%
rename from patches/unapplied/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
rename to patches/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
index 94026a2455..2ba0cdf6b3 100644
--- a/patches/unapplied/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
+++ b/patches/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
@@ -13,6 +13,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          };
  
 +        if (!org.apache.commons.lang3.StringUtils.isBlank(name)) // Paper - Don't lookup a profile with a blank name)
-         repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback);
+         repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
          GameProfile gameprofile = (GameProfile) atomicreference.get();
  
diff --git a/patches/unapplied/server/Enforce-Sync-Player-Saves.patch b/patches/server/Enforce-Sync-Player-Saves.patch
similarity index 100%
rename from patches/unapplied/server/Enforce-Sync-Player-Saves.patch
rename to patches/server/Enforce-Sync-Player-Saves.patch
diff --git a/patches/unapplied/server/Entity-fromMobSpawner.patch b/patches/server/Entity-fromMobSpawner.patch
similarity index 100%
rename from patches/unapplied/server/Entity-fromMobSpawner.patch
rename to patches/server/Entity-fromMobSpawner.patch
diff --git a/patches/unapplied/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
similarity index 100%
rename from patches/unapplied/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
rename to patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
diff --git a/patches/unapplied/server/Expose-client-protocol-version-and-virtual-host.patch b/patches/server/Expose-client-protocol-version-and-virtual-host.patch
similarity index 96%
rename from patches/unapplied/server/Expose-client-protocol-version-and-virtual-host.patch
rename to patches/server/Expose-client-protocol-version-and-virtual-host.patch
index fe848be9b2..b3e692ffd8 100644
--- a/patches/unapplied/server/Expose-client-protocol-version-and-virtual-host.patch
+++ b/patches/server/Expose-client-protocol-version-and-virtual-host.patch
@@ -64,9 +64,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/net/minecraft/network/Connection.java
 +++ b/src/main/java/net/minecraft/network/Connection.java
 @@ -0,0 +0,0 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
-         }
-     }
-     // Paper end - add pending task queue
+     @Nullable
+     BandwidthDebugMonitor bandwidthDebugMonitor;
+     public String hostname = ""; // CraftBukkit - add field
 +    // Paper start - NetworkClient implementation
 +    public int protocolVersion;
 +    public java.net.InetSocketAddress virtualHost;
@@ -79,7 +79,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
 +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
 @@ -0,0 +0,0 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
-                 throw new UnsupportedOperationException("Invalid intention " + packet.getIntention());
+                 throw new UnsupportedOperationException("Invalid intention " + packet.intention());
          }
  
 +        // Paper start - NetworkClient implementation
diff --git a/patches/unapplied/server/Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch b/patches/server/Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch
similarity index 100%
rename from patches/unapplied/server/Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch
rename to patches/server/Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch
diff --git a/patches/unapplied/server/Firework-API-s.patch b/patches/server/Firework-API-s.patch
similarity index 100%
rename from patches/unapplied/server/Firework-API-s.patch
rename to patches/server/Firework-API-s.patch
diff --git a/patches/unapplied/server/Fix-this-stupid-bullshit.patch b/patches/server/Fix-this-stupid-bullshit.patch
similarity index 97%
rename from patches/unapplied/server/Fix-this-stupid-bullshit.patch
rename to patches/server/Fix-this-stupid-bullshit.patch
index 041f8b9f4a..997faaa22d 100644
--- a/patches/unapplied/server/Fix-this-stupid-bullshit.patch
+++ b/patches/server/Fix-this-stupid-bullshit.patch
@@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
 @@ -0,0 +0,0 @@ public class Main {
                      Calendar deadline = Calendar.getInstance();
-                     deadline.add(Calendar.DAY_OF_YEAR, -21);
+                     deadline.add(Calendar.DAY_OF_YEAR, -3);
                      if (buildDate.before(deadline.getTime())) {
 -                        System.err.println("*** Error, this build is outdated ***");
 +                        // Paper start - This is some stupid bullshit
diff --git a/patches/unapplied/server/Handle-plugin-prefixes-using-Log4J-configuration.patch b/patches/server/Handle-plugin-prefixes-using-Log4J-configuration.patch
similarity index 100%
rename from patches/unapplied/server/Handle-plugin-prefixes-using-Log4J-configuration.patch
rename to patches/server/Handle-plugin-prefixes-using-Log4J-configuration.patch
diff --git a/patches/unapplied/server/Implement-ensureServerConversions-API.patch b/patches/server/Implement-ensureServerConversions-API.patch
similarity index 100%
rename from patches/unapplied/server/Implement-ensureServerConversions-API.patch
rename to patches/server/Implement-ensureServerConversions-API.patch
diff --git a/patches/unapplied/server/Implement-getI18NDisplayName.patch b/patches/server/Implement-getI18NDisplayName.patch
similarity index 100%
rename from patches/unapplied/server/Implement-getI18NDisplayName.patch
rename to patches/server/Implement-getI18NDisplayName.patch
diff --git a/patches/unapplied/server/Improve-Log4J-Configuration-Plugin-Loggers.patch b/patches/server/Improve-Log4J-Configuration-Plugin-Loggers.patch
similarity index 100%
rename from patches/unapplied/server/Improve-Log4J-Configuration-Plugin-Loggers.patch
rename to patches/server/Improve-Log4J-Configuration-Plugin-Loggers.patch
diff --git a/patches/unapplied/server/Improve-the-Saddle-API-for-Horses.patch b/patches/server/Improve-the-Saddle-API-for-Horses.patch
similarity index 100%
rename from patches/unapplied/server/Improve-the-Saddle-API-for-Horses.patch
rename to patches/server/Improve-the-Saddle-API-for-Horses.patch
diff --git a/patches/unapplied/server/Item-canEntityPickup.patch b/patches/server/Item-canEntityPickup.patch
similarity index 100%
rename from patches/unapplied/server/Item-canEntityPickup.patch
rename to patches/server/Item-canEntityPickup.patch
diff --git a/patches/unapplied/server/LivingEntity-setKiller.patch b/patches/server/LivingEntity-setKiller.patch
similarity index 100%
rename from patches/unapplied/server/LivingEntity-setKiller.patch
rename to patches/server/LivingEntity-setKiller.patch
diff --git a/patches/unapplied/server/Ocelot-despawns-should-honor-nametags-and-leash.patch b/patches/server/Ocelot-despawns-should-honor-nametags-and-leash.patch
similarity index 100%
rename from patches/unapplied/server/Ocelot-despawns-should-honor-nametags-and-leash.patch
rename to patches/server/Ocelot-despawns-should-honor-nametags-and-leash.patch
diff --git a/patches/unapplied/server/Only-send-global-sounds-to-same-world-if-limiting-ra.patch b/patches/server/Only-send-global-sounds-to-same-world-if-limiting-ra.patch
similarity index 100%
rename from patches/unapplied/server/Only-send-global-sounds-to-same-world-if-limiting-ra.patch
rename to patches/server/Only-send-global-sounds-to-same-world-if-limiting-ra.patch
diff --git a/patches/unapplied/server/Optimise-BlockState-s-hashCode-equals.patch b/patches/server/Optimise-BlockState-s-hashCode-equals.patch
similarity index 93%
rename from patches/unapplied/server/Optimise-BlockState-s-hashCode-equals.patch
rename to patches/server/Optimise-BlockState-s-hashCode-equals.patch
index 74b05a023e..462daf27b0 100644
--- a/patches/unapplied/server/Optimise-BlockState-s-hashCode-equals.patch
+++ b/patches/server/Optimise-BlockState-s-hashCode-equals.patch
@@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +    public boolean equals_unused(Object object) { // Paper
          if (this == object) {
              return true;
-         } else if (object instanceof BooleanProperty && super.equals(object)) {
+         } else {
 diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java b/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java
@@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +    public boolean equals_unused(Object object) { // Paper
          if (this == object) {
              return true;
-         } else if (object instanceof EnumProperty && super.equals(object)) {
+         } else {
 diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/IntegerProperty.java b/src/main/java/net/minecraft/world/level/block/state/properties/IntegerProperty.java
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/world/level/block/state/properties/IntegerProperty.java
@@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +    public boolean equals_unused(Object object) { // Paper
          if (this == object) {
              return true;
-         } else if (object instanceof IntegerProperty && super.equals(object)) {
+         } else {
 diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
diff --git a/patches/unapplied/server/Optimize-World.isLoaded-BlockPosition-Z.patch b/patches/server/Optimize-World.isLoaded-BlockPosition-Z.patch
similarity index 100%
rename from patches/unapplied/server/Optimize-World.isLoaded-BlockPosition-Z.patch
rename to patches/server/Optimize-World.isLoaded-BlockPosition-Z.patch
diff --git a/patches/unapplied/server/PlayerAttemptPickupItemEvent.patch b/patches/server/PlayerAttemptPickupItemEvent.patch
similarity index 100%
rename from patches/unapplied/server/PlayerAttemptPickupItemEvent.patch
rename to patches/server/PlayerAttemptPickupItemEvent.patch
diff --git a/patches/unapplied/server/PlayerPickupItemEvent-setFlyAtPlayer.patch b/patches/server/PlayerPickupItemEvent-setFlyAtPlayer.patch
similarity index 100%
rename from patches/unapplied/server/PlayerPickupItemEvent-setFlyAtPlayer.patch
rename to patches/server/PlayerPickupItemEvent-setFlyAtPlayer.patch
diff --git a/patches/unapplied/server/PlayerTeleportEndGatewayEvent.patch b/patches/server/PlayerTeleportEndGatewayEvent.patch
similarity index 100%
rename from patches/unapplied/server/PlayerTeleportEndGatewayEvent.patch
rename to patches/server/PlayerTeleportEndGatewayEvent.patch
diff --git a/patches/unapplied/server/Prevent-Pathfinding-out-of-World-Border.patch b/patches/server/Prevent-Pathfinding-out-of-World-Border.patch
similarity index 100%
rename from patches/unapplied/server/Prevent-Pathfinding-out-of-World-Border.patch
rename to patches/server/Prevent-Pathfinding-out-of-World-Border.patch
diff --git a/patches/unapplied/server/Profile-Lookup-Events.patch b/patches/server/Profile-Lookup-Events.patch
similarity index 100%
rename from patches/unapplied/server/Profile-Lookup-Events.patch
rename to patches/server/Profile-Lookup-Events.patch
diff --git a/patches/unapplied/server/ProfileWhitelistVerifyEvent.patch b/patches/server/ProfileWhitelistVerifyEvent.patch
similarity index 96%
rename from patches/unapplied/server/ProfileWhitelistVerifyEvent.patch
rename to patches/server/ProfileWhitelistVerifyEvent.patch
index ff1a09cd42..f91b1f67e6 100644
--- a/patches/unapplied/server/ProfileWhitelistVerifyEvent.patch
+++ b/patches/server/ProfileWhitelistVerifyEvent.patch
@@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 @@ -0,0 +0,0 @@ public abstract class PlayerList {
  
              // return chatmessage;
-             event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure
+             event.disallow(PlayerLoginEvent.Result.KICK_BANNED, io.papermc.paper.adventure.PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure
 -        } else if (!this.isWhiteListed(gameprofile)) {
 -            ichatmutablecomponent = Component.translatable("multiplayer.disconnect.not_whitelisted");
 -            event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.whitelistMessage)); // Spigot // Paper - Adventure
diff --git a/patches/unapplied/server/Properly-fix-item-duplication-bug.patch b/patches/server/Properly-fix-item-duplication-bug.patch
similarity index 74%
rename from patches/unapplied/server/Properly-fix-item-duplication-bug.patch
rename to patches/server/Properly-fix-item-duplication-bug.patch
index 8c43980ba2..5b433e4b16 100644
--- a/patches/unapplied/server/Properly-fix-item-duplication-bug.patch
+++ b/patches/server/Properly-fix-item-duplication-bug.patch
@@ -18,11 +18,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
      }
  
      @Override
-diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
 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, Tic
+--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+@@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
      }
  
      public final boolean isDisconnected() {
diff --git a/patches/unapplied/server/Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/Properly-handle-async-calls-to-restart-the-server.patch
similarity index 100%
rename from patches/unapplied/server/Properly-handle-async-calls-to-restart-the-server.patch
rename to patches/server/Properly-handle-async-calls-to-restart-the-server.patch
diff --git a/patches/unapplied/server/Provide-E-TE-Chunk-count-stat-methods.patch b/patches/server/Provide-E-TE-Chunk-count-stat-methods.patch
similarity index 100%
rename from patches/unapplied/server/Provide-E-TE-Chunk-count-stat-methods.patch
rename to patches/server/Provide-E-TE-Chunk-count-stat-methods.patch
diff --git a/patches/unapplied/server/Remove-CraftScheduler-Async-Task-Debugger.patch b/patches/server/Remove-CraftScheduler-Async-Task-Debugger.patch
similarity index 100%
rename from patches/unapplied/server/Remove-CraftScheduler-Async-Task-Debugger.patch
rename to patches/server/Remove-CraftScheduler-Async-Task-Debugger.patch
diff --git a/patches/unapplied/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch
similarity index 100%
rename from patches/unapplied/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch
rename to patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch
diff --git a/patches/unapplied/server/Shoulder-Entities-Release-API.patch b/patches/server/Shoulder-Entities-Release-API.patch
similarity index 100%
rename from patches/unapplied/server/Shoulder-Entities-Release-API.patch
rename to patches/server/Shoulder-Entities-Release-API.patch
diff --git a/patches/unapplied/server/String-based-Action-Bar-API.patch b/patches/server/String-based-Action-Bar-API.patch
similarity index 100%
rename from patches/unapplied/server/String-based-Action-Bar-API.patch
rename to patches/server/String-based-Action-Bar-API.patch
diff --git a/patches/unapplied/server/Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch
similarity index 99%
rename from patches/unapplied/server/Use-TerminalConsoleAppender-for-console-improvements.patch
rename to patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch
index 85cafa2b65..334a256ce0 100644
--- a/patches/unapplied/server/Use-TerminalConsoleAppender-for-console-improvements.patch
+++ b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch
@@ -290,8 +290,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +        */
 +        // Paper end
          Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
+         // CraftBukkit end
          this.paperConfigurations = services.paperConfigurations(); // Paper
-     }
 @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
                  org.spigotmc.WatchdogThread.doStop(); // Spigot
                  // CraftBukkit start - Restore terminal to original settings
@@ -398,8 +398,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  import javax.imageio.ImageIO;
 -import jline.console.ConsoleReader;
  import net.minecraft.advancements.Advancement;
+ import net.minecraft.advancements.AdvancementHolder;
  import net.minecraft.commands.CommandSourceStack;
- import net.minecraft.commands.Commands;
 @@ -0,0 +0,0 @@ public final class CraftServer implements Server {
          return this.logger;
      }
diff --git a/patches/unapplied/server/handle-ServerboundKeepAlivePacket-async.patch b/patches/server/handle-ServerboundKeepAlivePacket-async.patch
similarity index 68%
rename from patches/unapplied/server/handle-ServerboundKeepAlivePacket-async.patch
rename to patches/server/handle-ServerboundKeepAlivePacket-async.patch
index 84fd5bbdf3..a8958816a0 100644
--- a/patches/unapplied/server/handle-ServerboundKeepAlivePacket-async.patch
+++ b/patches/server/handle-ServerboundKeepAlivePacket-async.patch
@@ -14,11 +14,11 @@ off the main thread.
 also adding some additional logging in order to help work out what is causing
 random disconnections for clients.
 
-diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
 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, Tic
+--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+@@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
  
      @Override
      public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
@@ -27,14 +27,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
              int i = (int) (Util.getMillis() - this.keepAliveTime);
  
-             this.player.latency = (this.player.latency * 3 + i) / 4;
+             this.latency = (this.latency * 3 + i) / 4;
              this.keepAlivePending = false;
          } else if (!this.isSingleplayerOwner()) {
+-            this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE);
 +            // Paper start - This needs to be handled on the main thread for plugins
 +            server.submit(() -> {
-             this.disconnect(Component.translatable("disconnect.timeout"));
++                this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE);
 +            });
-+            // Paper end
++            // Paper endg
          }
  
      }
diff --git a/patches/unapplied/server/provide-a-configurable-option-to-disable-creeper-lin.patch b/patches/server/provide-a-configurable-option-to-disable-creeper-lin.patch
similarity index 100%
rename from patches/unapplied/server/provide-a-configurable-option-to-disable-creeper-lin.patch
rename to patches/server/provide-a-configurable-option-to-disable-creeper-lin.patch