diff --git a/patches/unapplied/server/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/patches/server/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch similarity index 100% rename from patches/unapplied/server/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch rename to patches/server/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch diff --git a/patches/unapplied/server/Add-Heightmap-API.patch b/patches/server/Add-Heightmap-API.patch similarity index 100% rename from patches/unapplied/server/Add-Heightmap-API.patch rename to patches/server/Add-Heightmap-API.patch diff --git a/patches/unapplied/server/Add-LivingEntity-getTargetEntity.patch b/patches/server/Add-LivingEntity-getTargetEntity.patch similarity index 100% rename from patches/unapplied/server/Add-LivingEntity-getTargetEntity.patch rename to patches/server/Add-LivingEntity-getTargetEntity.patch diff --git a/patches/unapplied/server/Add-PlayerConnectionCloseEvent.patch b/patches/server/Add-PlayerConnectionCloseEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerConnectionCloseEvent.patch rename to patches/server/Add-PlayerConnectionCloseEvent.patch diff --git a/patches/unapplied/server/Add-more-Witch-API.patch b/patches/server/Add-more-Witch-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-Witch-API.patch rename to patches/server/Add-more-Witch-API.patch diff --git a/patches/unapplied/server/Add-more-Zombie-API.patch b/patches/server/Add-more-Zombie-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-Zombie-API.patch rename to patches/server/Add-more-Zombie-API.patch diff --git a/patches/unapplied/server/Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch similarity index 91% rename from patches/unapplied/server/Add-option-to-prevent-players-from-moving-into-unloa.patch rename to patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch index 85eae89587..86287757a3 100644 --- a/patches/unapplied/server/Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -53,9 +53,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot())); @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - } else { - speed = this.player.getAbilities().walkingSpeed * 10f; - } + } else { + speed = this.player.getAbilities().walkingSpeed * 10f; + } + // Paper start - Prevent moving into unloaded chunks + if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && (this.player.getX() != toX || this.player.getZ() != toZ) && !worldserver.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position())))) { + this.internalTeleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot(), Collections.emptySet()); @@ -63,5 +63,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) { - float f2 = this.player.isFallFlying() ? 300.0F : 100.0F; + if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) { + float f2 = this.player.isFallFlying() ? 300.0F : 100.0F; diff --git a/patches/unapplied/server/Add-sun-related-API.patch b/patches/server/Add-sun-related-API.patch similarity index 100% rename from patches/unapplied/server/Add-sun-related-API.patch rename to patches/server/Add-sun-related-API.patch diff --git a/patches/unapplied/server/Allow-Saving-of-Oversized-Chunks.patch b/patches/server/Allow-Saving-of-Oversized-Chunks.patch similarity index 100% rename from patches/unapplied/server/Allow-Saving-of-Oversized-Chunks.patch rename to patches/server/Allow-Saving-of-Oversized-Chunks.patch diff --git a/patches/unapplied/server/Async-command-map-building.patch b/patches/server/Async-command-map-building.patch similarity index 100% rename from patches/unapplied/server/Async-command-map-building.patch rename to patches/server/Async-command-map-building.patch diff --git a/patches/unapplied/server/Block-Entity-remove-from-being-called-on-Players.patch b/patches/server/Block-Entity-remove-from-being-called-on-Players.patch similarity index 100% rename from patches/unapplied/server/Block-Entity-remove-from-being-called-on-Players.patch rename to patches/server/Block-Entity-remove-from-being-called-on-Players.patch diff --git a/patches/unapplied/server/BlockDestroyEvent.patch b/patches/server/BlockDestroyEvent.patch similarity index 100% rename from patches/unapplied/server/BlockDestroyEvent.patch rename to patches/server/BlockDestroyEvent.patch diff --git a/patches/unapplied/server/Book-Size-Limits.patch b/patches/server/Book-Size-Limits.patch similarity index 100% rename from patches/unapplied/server/Book-Size-Limits.patch rename to patches/server/Book-Size-Limits.patch diff --git a/patches/unapplied/server/Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/patches/server/Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch similarity index 100% rename from patches/unapplied/server/Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch rename to patches/server/Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch diff --git a/patches/unapplied/server/Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/Call-player-spectator-target-events-and-improve-impl.patch similarity index 100% rename from patches/unapplied/server/Call-player-spectator-target-events-and-improve-impl.patch rename to patches/server/Call-player-spectator-target-events-and-improve-impl.patch diff --git a/patches/unapplied/server/Catch-JsonParseException-in-Entity-and-TE-names.patch b/patches/server/Catch-JsonParseException-in-Entity-and-TE-names.patch similarity index 100% rename from patches/unapplied/server/Catch-JsonParseException-in-Entity-and-TE-names.patch rename to patches/server/Catch-JsonParseException-in-Entity-and-TE-names.patch diff --git a/patches/unapplied/server/Check-Drowned-for-Villager-Aggression-Config.patch b/patches/server/Check-Drowned-for-Villager-Aggression-Config.patch similarity index 100% rename from patches/unapplied/server/Check-Drowned-for-Villager-Aggression-Config.patch rename to patches/server/Check-Drowned-for-Villager-Aggression-Config.patch diff --git a/patches/unapplied/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch b/patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch similarity index 96% rename from patches/unapplied/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch rename to patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch index 4742ce1f2a..7dc9754b37 100644 --- a/patches/unapplied/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -26,13 +26,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - ServerChunkCache chunkproviderserver = worldserver.getChunkSource(); + //ChunkProviderServer chunkproviderserver = worldserver.getChunkProvider(); // Paper - move up - this.nextTickTime = Util.getMillis(); + this.nextTickTimeNanos = Util.getNanos(); - // CraftBukkit start - if (worldserver.getWorld().getKeepSpawnInMemory()) { - chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(blockposition), 11, Unit.INSTANCE); - - while (chunkproviderserver.getTickingGenerated() != 441) { -- // this.nextTickTime = SystemUtils.getMillis() + 10L; +- // this.nextTickTimeNanos = SystemUtils.getNanos() + MinecraftServer.PREPARE_LEVELS_DEFAULT_DELAY_NANOS; - this.executeModerately(); - } - } @@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + worldserver.addTicketsForSpawn(radiusBlocks, blockposition); + // Paper end - // this.nextTickTime = SystemUtils.getMillis() + 10L; + // this.nextTickTimeNanos = SystemUtils.getNanos() + MinecraftServer.PREPARE_LEVELS_DEFAULT_DELAY_NANOS; this.executeModerately(); // Iterator iterator = this.levels.values().iterator(); + } @@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (true) { ServerLevel worldserver1 = worldserver; @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, SharedSuggestionProvider { ++public class CommandSourceStack implements ExecutionCommandSource, SharedSuggestionProvider, com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource { // Paper public static final SimpleCommandExceptionType ERROR_NOT_PLAYER = new SimpleCommandExceptionType(Component.translatable("permissions.requires.player")); public static final SimpleCommandExceptionType ERROR_NOT_ENTITY = new SimpleCommandExceptionType(Component.translatable("permissions.requires.entity")); -@@ -0,0 +0,0 @@ public class CommandSourceStack implements SharedSuggestionProvider { +@@ -0,0 +0,0 @@ public class CommandSourceStack implements ExecutionCommandSource { -- ForkJoinWorkerThread forkJoinWorkerThread = new ForkJoinWorkerThread(forkJoinPool) { -+ executorService = new java.util.concurrent.ThreadPoolExecutor(i, i,0L, TimeUnit.MILLISECONDS, new java.util.concurrent.LinkedBlockingQueue(), target -> new io.papermc.paper.util.ServerWorkerThread(target, s, priorityModifier)); +- AtomicInteger atomicInteger = new AtomicInteger(1); +- executorService = new ForkJoinPool(i, (pool) -> { +- ForkJoinWorkerThread forkJoinWorkerThread = new ForkJoinWorkerThread(pool) { ++ executorService = new java.util.concurrent.ThreadPoolExecutor(i, i,0L, TimeUnit.MILLISECONDS, new java.util.concurrent.LinkedBlockingQueue<>(), target -> new io.papermc.paper.util.ServerWorkerThread(target, s, priorityModifier)); + } + /* @Override diff --git a/patches/unapplied/server/Improve-exact-choice-recipe-ingredients.patch b/patches/server/Improve-exact-choice-recipe-ingredients.patch similarity index 99% rename from patches/unapplied/server/Improve-exact-choice-recipe-ingredients.patch rename to patches/server/Improve-exact-choice-recipe-ingredients.patch index e1e9d9e85e..e46e02064e 100644 --- a/patches/unapplied/server/Improve-exact-choice-recipe-ingredients.patch +++ b/patches/server/Improve-exact-choice-recipe-ingredients.patch @@ -342,16 +342,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 -public class ShapedRecipe implements CraftingRecipe { +public class ShapedRecipe extends io.papermc.paper.inventory.recipe.RecipeBookExactChoiceRecipe implements CraftingRecipe { // Paper - improve exact recipe choices - final int width; - final int height; + final ShapedRecipePattern pattern; + final ItemStack result; @@ -0,0 +0,0 @@ public class ShapedRecipe implements CraftingRecipe { - this.recipeItems = ingredients; + this.pattern = raw; this.result = result; this.showNotification = showNotification; + this.checkExactIngredients(); // Paper - improve exact recipe choices } - public ShapedRecipe(String group, CraftingBookCategory category, int width, int height, NonNullList ingredients, ItemStack result) { + public ShapedRecipe(String group, CraftingBookCategory category, ShapedRecipePattern raw, ItemStack result) { diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java diff --git a/patches/unapplied/server/Limit-Client-Sign-length-more.patch b/patches/server/Limit-Client-Sign-length-more.patch similarity index 96% rename from patches/unapplied/server/Limit-Client-Sign-length-more.patch rename to patches/server/Limit-Client-Sign-length-more.patch index d16fc9a632..9c0f7b2508 100644 --- a/patches/unapplied/server/Limit-Client-Sign-length-more.patch +++ b/patches/server/Limit-Client-Sign-length-more.patch @@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- 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 extends ServerCommonPacketListenerImpl - private final MessageSignatureCache messageSignatureCache; + private final MessageSignatureCache messageSignatureCache = MessageSignatureCache.createDefault(); private final FutureChain chatMessageChain; private boolean waitingForSwitchToConfig; + private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper diff --git a/patches/unapplied/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch b/patches/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch similarity index 54% rename from patches/unapplied/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch rename to patches/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch index fe56c8876e..59d3d0a9cb 100644 --- a/patches/unapplied/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch +++ b/patches/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch @@ -15,21 +15,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java @@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity { - return this.cachedOwner; - } else if (this.ownerUUID != null && this.level() instanceof ServerLevel) { - this.cachedOwner = ((ServerLevel) this.level()).getEntity(this.ownerUUID); -+ // Paper start - check all worlds -+ if (this.cachedOwner == null) { -+ for (final ServerLevel level : this.level().getServer().getAllLevels()) { -+ if (level == this.level()) continue; -+ final Entity entity = level.getEntity(this.ownerUUID); -+ if (entity != null) { -+ this.cachedOwner = entity; -+ break; + ServerLevel worldserver = (ServerLevel) world; + + this.cachedOwner = worldserver.getEntity(this.ownerUUID); ++ // Paper start - check all worlds ++ if (this.cachedOwner == null) { ++ for (final ServerLevel level : this.level().getServer().getAllLevels()) { ++ if (level == this.level()) continue; ++ final Entity entity = level.getEntity(this.ownerUUID); ++ if (entity != null) { ++ this.cachedOwner = entity; ++ break; ++ } ++ } + } -+ } -+ } -+ // Paper end - return this.cachedOwner; - } else { - return null; ++ // Paper end + return this.cachedOwner; + } + } diff --git a/patches/unapplied/server/Make-the-default-permission-message-configurable.patch b/patches/server/Make-the-default-permission-message-configurable.patch similarity index 100% rename from patches/unapplied/server/Make-the-default-permission-message-configurable.patch rename to patches/server/Make-the-default-permission-message-configurable.patch diff --git a/patches/unapplied/server/Mob-Spawner-API-Enhancements.patch b/patches/server/Mob-Spawner-API-Enhancements.patch similarity index 100% rename from patches/unapplied/server/Mob-Spawner-API-Enhancements.patch rename to patches/server/Mob-Spawner-API-Enhancements.patch diff --git a/patches/unapplied/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch b/patches/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch similarity index 100% rename from patches/unapplied/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch rename to patches/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch diff --git a/patches/unapplied/server/Optimize-Captured-TileEntity-Lookup.patch b/patches/server/Optimize-Captured-TileEntity-Lookup.patch similarity index 100% rename from patches/unapplied/server/Optimize-Captured-TileEntity-Lookup.patch rename to patches/server/Optimize-Captured-TileEntity-Lookup.patch diff --git a/patches/unapplied/server/Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/patches/server/Optimize-Network-Manager-and-add-advanced-packet-sup.patch similarity index 100% rename from patches/unapplied/server/Optimize-Network-Manager-and-add-advanced-packet-sup.patch rename to patches/server/Optimize-Network-Manager-and-add-advanced-packet-sup.patch diff --git a/patches/unapplied/server/Optimize-World-Time-Updates.patch b/patches/server/Optimize-World-Time-Updates.patch similarity index 100% rename from patches/unapplied/server/Optimize-World-Time-Updates.patch rename to patches/server/Optimize-World-Time-Updates.patch diff --git a/patches/unapplied/server/PlayerDeathEvent-getItemsToKeep.patch b/patches/server/PlayerDeathEvent-getItemsToKeep.patch similarity index 100% rename from patches/unapplied/server/PlayerDeathEvent-getItemsToKeep.patch rename to patches/server/PlayerDeathEvent-getItemsToKeep.patch diff --git a/patches/unapplied/server/PreSpawnerSpawnEvent.patch b/patches/server/PreSpawnerSpawnEvent.patch similarity index 100% rename from patches/unapplied/server/PreSpawnerSpawnEvent.patch rename to patches/server/PreSpawnerSpawnEvent.patch diff --git a/patches/unapplied/server/Prevent-Enderman-from-loading-chunks.patch b/patches/server/Prevent-Enderman-from-loading-chunks.patch similarity index 100% rename from patches/unapplied/server/Prevent-Enderman-from-loading-chunks.patch rename to patches/server/Prevent-Enderman-from-loading-chunks.patch diff --git a/patches/unapplied/server/Prevent-Mob-AI-Rules-from-Loading-Chunks.patch b/patches/server/Prevent-Mob-AI-Rules-from-Loading-Chunks.patch similarity index 100% rename from patches/unapplied/server/Prevent-Mob-AI-Rules-from-Loading-Chunks.patch rename to patches/server/Prevent-Mob-AI-Rules-from-Loading-Chunks.patch diff --git a/patches/unapplied/server/Prevent-chunk-loading-from-Fluid-Flowing.patch b/patches/server/Prevent-chunk-loading-from-Fluid-Flowing.patch similarity index 100% rename from patches/unapplied/server/Prevent-chunk-loading-from-Fluid-Flowing.patch rename to patches/server/Prevent-chunk-loading-from-Fluid-Flowing.patch diff --git a/patches/unapplied/server/Prevent-mob-spawning-from-loading-generating-chunks.patch b/patches/server/Prevent-mob-spawning-from-loading-generating-chunks.patch similarity index 100% rename from patches/unapplied/server/Prevent-mob-spawning-from-loading-generating-chunks.patch rename to patches/server/Prevent-mob-spawning-from-loading-generating-chunks.patch diff --git a/patches/unapplied/server/Prevent-rayTrace-from-loading-chunks.patch b/patches/server/Prevent-rayTrace-from-loading-chunks.patch similarity index 100% rename from patches/unapplied/server/Prevent-rayTrace-from-loading-chunks.patch rename to patches/server/Prevent-rayTrace-from-loading-chunks.patch diff --git a/patches/unapplied/server/Reset-players-airTicks-on-respawn.patch b/patches/server/Reset-players-airTicks-on-respawn.patch similarity index 100% rename from patches/unapplied/server/Reset-players-airTicks-on-respawn.patch rename to patches/server/Reset-players-airTicks-on-respawn.patch diff --git a/patches/unapplied/server/Restore-custom-InventoryHolder-support.patch b/patches/server/Restore-custom-InventoryHolder-support.patch similarity index 100% rename from patches/unapplied/server/Restore-custom-InventoryHolder-support.patch rename to patches/server/Restore-custom-InventoryHolder-support.patch diff --git a/patches/unapplied/server/Server-Tick-Events.patch b/patches/server/Server-Tick-Events.patch similarity index 91% rename from patches/unapplied/server/Server-Tick-Events.patch rename to patches/server/Server-Tick-Events.patch index 7d6efaba5f..835f4a20c2 100644 --- a/patches/unapplied/server/Server-Tick-Events.patch +++ b/patches/server/Server-Tick-Events.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper ++this.tickCount; - this.tickChildren(shouldKeepTicking); + this.tickRateManager.tick(); @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop