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-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-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 100% 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 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 94% 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 6ed4800218..2d697bb5fd 100644 --- a/patches/unapplied/server/Add-setting-for-proxy-online-mode-status.patch +++ b/patches/server/Add-setting-for-proxy-online-mode-status.patch @@ -10,14 +10,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- 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 { - } - }; + } + }; - 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}, profilelookupcallback); - GameProfile gameprofile = (GameProfile) atomicreference.get(); + repository.findProfilesByNames(new String[]{name}, profilelookupcallback); + GameProfile gameprofile = (GameProfile) atomicreference.get(); @@ -0,0 +0,0 @@ public class GameProfileCache { } 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/Avoid-blocking-on-Network-Manager-creation.patch b/patches/server/Avoid-blocking-on-Network-Manager-creation.patch similarity index 100% rename from patches/unapplied/server/Avoid-blocking-on-Network-Manager-creation.patch rename to patches/server/Avoid-blocking-on-Network-Manager-creation.patch diff --git a/patches/unapplied/server/Basic-PlayerProfile-API.patch b/patches/server/Basic-PlayerProfile-API.patch similarity index 100% rename from patches/unapplied/server/Basic-PlayerProfile-API.patch rename to patches/server/Basic-PlayerProfile-API.patch 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 89% rename from patches/unapplied/server/Cache-user-authenticator-threads.patch rename to patches/server/Cache-user-authenticator-threads.patch index 3155b62c43..b04e8189e4 100644 --- a/patches/unapplied/server/Cache-user-authenticator-threads.patch +++ b/patches/server/Cache-user-authenticator-threads.patch @@ -8,6 +8,14 @@ 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 AtomicInteger UNIQUE_THREAD_ID = new AtomicInteger(0); + static final Logger LOGGER = LogUtils.getLogger(); ++ 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 + private static final int MAX_TICKS_BEFORE_LOGIN = 600; + private static final Component DISCONNECT_UNEXPECTED_QUERY = Component.translatable("multiplayer.disconnect.unexpected_query_response"); + private final byte[] challenge; @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.challenge)); } else { @@ -52,12 +60,3 @@ 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 98% rename from patches/unapplied/server/Cap-Entity-Collisions.patch rename to patches/server/Cap-Entity-Collisions.patch index 356e44b415..299249e727 100644 --- a/patches/unapplied/server/Cap-Entity-Collisions.patch +++ b/patches/server/Cap-Entity-Collisions.patch @@ -15,7 +15,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void inactiveTick() { } // Spigot end // Paper start 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 100% rename from patches/unapplied/server/Configurable-flying-kick-messages.patch rename to patches/server/Configurable-flying-kick-messages.patch diff --git a/patches/unapplied/server/Configurable-packet-in-spam-threshold.patch b/patches/server/Configurable-packet-in-spam-threshold.patch similarity index 100% rename from patches/unapplied/server/Configurable-packet-in-spam-threshold.patch rename to patches/server/Configurable-packet-in-spam-threshold.patch 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 95% 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 b65f6da14f..da1483ab17 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 @@ -14,9 +14,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java @@ -0,0 +0,0 @@ public class Util { - private static final String MAX_THREADS_SYSTEM_PROPERTY = "max.bg.threads"; - private static final AtomicInteger WORKER_COUNT = new AtomicInteger(1); private static final ExecutorService BACKGROUND_EXECUTOR = makeExecutor("Main"); + private static final ExecutorService IO_POOL = makeIoExecutor("IO-Worker-", false); + private static final ExecutorService DOWNLOAD_POOL = makeIoExecutor("Download-", true); + // Paper start - don't submit BLOCKING PROFILE LOOKUPS to the world gen thread + public static final ExecutorService PROFILE_EXECUTOR = Executors.newFixedThreadPool(2, new java.util.concurrent.ThreadFactory() { + @@ -33,8 +33,8 @@ 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); + private static final int LINEAR_LOOKUP_THRESHOLD = 8; 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 @@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + }, Util.PROFILE_EXECUTOR); // Paper - not a good idea to use BLOCKING OPERATIONS on the worldgen executor } - private static boolean hasTextures(GameProfile profile) { + @Override 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 80% 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 2ba0cdf6b3..a9ffa9551c 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 @@ -9,10 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- 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 { - } - }; + } + }; + if (!org.apache.commons.lang3.StringUtils.isBlank(name)) // Paper - Don't lookup a profile with a blank name) - repository.findProfilesByNames(new String[]{name}, profilelookupcallback); - GameProfile gameprofile = (GameProfile) atomicreference.get(); + 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/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/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 89% 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 index 81db71d856..18418821fc 100644 --- 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 @@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - if (nbt.contains("TileEntityData", 10)) { -+ if (nbt.contains("TileEntityData", 10) && !(this.level().paperConfig().entities.spawning.filterBadTileEntityNbtFromFallingBlocks && this.blockState.getBlock() instanceof net.minecraft.world.level.block.GameMasterBlock)) { - this.blockData = nbt.getCompound("TileEntityData"); ++ if (nbt.contains("TileEntityData", 10) && !(this.level().paperConfig().entities.spawning.filterBadTileEntityNbtFromFallingBlocks && this.blockState.getBlock() instanceof net.minecraft.world.level.block.GameMasterBlock)) { // Paper + this.blockData = nbt.getCompound("TileEntityData").copy(); } 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/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/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 100% rename from patches/unapplied/server/Optimise-BlockState-s-hashCode-equals.patch rename to patches/server/Optimise-BlockState-s-hashCode-equals.patch 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/Properly-fix-item-duplication-bug.patch b/patches/server/Properly-fix-item-duplication-bug.patch similarity index 100% rename from patches/unapplied/server/Properly-fix-item-duplication-bug.patch rename to patches/server/Properly-fix-item-duplication-bug.patch 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 99% 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 index e5108ef83b..4cc2883793 100644 --- 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 @@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart private boolean stopped; private int tickCount; - protected final Proxy proxy; + private int ticksUntilAutosave; @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop