diff --git a/patches/unapplied/server/0260-Prevent-various-interactions-from-causing-chunk-load.patch b/patches/server/0254-Prevent-various-interactions-from-causing-chunk-load.patch similarity index 79% rename from patches/unapplied/server/0260-Prevent-various-interactions-from-causing-chunk-load.patch rename to patches/server/0254-Prevent-various-interactions-from-causing-chunk-load.patch index 73f0e12592..16fa7f5101 100644 --- a/patches/unapplied/server/0260-Prevent-various-interactions-from-causing-chunk-load.patch +++ b/patches/server/0254-Prevent-various-interactions-from-causing-chunk-load.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Prevent various interactions from causing chunk loads Co-authored-by: Shane Freeder diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java -index e3d070d46729c023d594699619a4b3f8658edbce..5580a396a56c6e0f364a5368985ee99b9e2be0a8 100644 +index da5373d8eb4643414a0f2c699044fde93715c258..6634228ef002cbef67980272a26be4a75c954116 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java @@ -126,7 +126,9 @@ public class RemoveBlockGoal extends MoveToBlockGoal { @@ -40,10 +40,10 @@ index e3d070d46729c023d594699619a4b3f8658edbce..5580a396a56c6e0f364a5368985ee99b return ichunkaccess == null ? false : ichunkaccess.getBlockState(pos).is(this.blockToRemove) && ichunkaccess.getBlockState(pos.above()).isAir() && ichunkaccess.getBlockState(pos.above(2)).isAir(); } diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index 13ba764d51f941c2b0d1d2af88ffd0c1fc3982c0..9637c26a3c381869f0a4dfe9189c0095387009b4 100644 +index 4d659fc8355542e6b9cadc6e1e86002e136702d2..853d65025d5e049467c1f1e7322580880506c347 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -@@ -517,7 +517,8 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -500,7 +500,8 @@ public class EnderMan extends Monster implements NeutralMob { int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 2.0D); int k = Mth.floor(this.enderman.getZ() - 1.0D + randomsource.nextDouble() * 2.0D); BlockPos blockposition = new BlockPos(i, j, k); @@ -53,7 +53,7 @@ index 13ba764d51f941c2b0d1d2af88ffd0c1fc3982c0..9637c26a3c381869f0a4dfe9189c0095 BlockPos blockposition1 = blockposition.below(); BlockState iblockdata1 = world.getBlockState(blockposition1); BlockState iblockdata2 = this.enderman.getCarriedBlock(); -@@ -561,7 +562,8 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -544,7 +545,8 @@ public class EnderMan extends Monster implements NeutralMob { int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 3.0D); int k = Mth.floor(this.enderman.getZ() - 2.0D + randomsource.nextDouble() * 4.0D); BlockPos blockposition = new BlockPos(i, j, k); @@ -63,19 +63,19 @@ index 13ba764d51f941c2b0d1d2af88ffd0c1fc3982c0..9637c26a3c381869f0a4dfe9189c0095 Vec3 vec3d = new Vec3((double) this.enderman.getBlockX() + 0.5D, (double) j + 0.5D, (double) this.enderman.getBlockZ() + 0.5D); Vec3 vec3d1 = new Vec3((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D); BlockHitResult movingobjectpositionblock = world.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, this.enderman)); -diff --git a/src/main/java/net/minecraft/world/item/CompassItem.java b/src/main/java/net/minecraft/world/item/CompassItem.java -index b8c6ac4c254787e285f97ad15bf10ddfd9cb294f..0f3621483a6ddcaeeb25eac51dbfaad41933579a 100644 ---- a/src/main/java/net/minecraft/world/item/CompassItem.java -+++ b/src/main/java/net/minecraft/world/item/CompassItem.java -@@ -77,7 +77,7 @@ public class CompassItem extends Item implements Vanishable { - Optional> optional = getLodestoneDimension(compoundTag); - if (optional.isPresent() && optional.get() == world.dimension() && compoundTag.contains("LodestonePos")) { - BlockPos blockPos = NbtUtils.readBlockPos(compoundTag.getCompound("LodestonePos")); -- if (!world.isInWorldBounds(blockPos) || !((ServerLevel)world).getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos)) { -+ if (!world.isInWorldBounds(blockPos) || (world.hasChunkAt(blockPos) && !((ServerLevel)world).getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos))) { // Paper - Prevent compass from loading chunks - compoundTag.remove("LodestonePos"); - } - } +diff --git a/src/main/java/net/minecraft/world/item/component/LodestoneTracker.java b/src/main/java/net/minecraft/world/item/component/LodestoneTracker.java +index c02a2f9e1b4e727b1deeb73377e1f7193f5ee072..cdd1f6939ce33e62f6609f7eb3a5dff59bf12675 100644 +--- a/src/main/java/net/minecraft/world/item/component/LodestoneTracker.java ++++ b/src/main/java/net/minecraft/world/item/component/LodestoneTracker.java +@@ -29,7 +29,7 @@ public record LodestoneTracker(Optional target, boolean tracked) { + return this; + } else { + BlockPos blockPos = this.target.get().pos(); +- return world.isInWorldBounds(blockPos) && world.getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos) ++ return world.isInWorldBounds(blockPos) && (!world.hasChunkAt(blockPos) || world.getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos)) // Paper - Prevent compass from loading chunks + ? this + : new LodestoneTracker(Optional.empty(), true); + } diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java index d6d8bbc98fc71997cb52521d59ebb59d727d3c22..c3760e0c8ac0b3ea200f4e1c237e250137a78caf 100644 --- a/src/main/java/net/minecraft/world/level/BlockGetter.java diff --git a/patches/unapplied/server/0261-Prevent-mob-spawning-from-loading-generating-chunks.patch b/patches/server/0255-Prevent-mob-spawning-from-loading-generating-chunks.patch similarity index 90% rename from patches/unapplied/server/0261-Prevent-mob-spawning-from-loading-generating-chunks.patch rename to patches/server/0255-Prevent-mob-spawning-from-loading-generating-chunks.patch index 406112a4c1..1ca48ef5a8 100644 --- a/patches/unapplied/server/0261-Prevent-mob-spawning-from-loading-generating-chunks.patch +++ b/patches/server/0255-Prevent-mob-spawning-from-loading-generating-chunks.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Prevent mob spawning from loading/generating chunks also prevents if out of world border bounds diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 352d230b365c512a4b9831265d3a57825f80fbfd..d5ada3301429e7fec0d157d7a33d4937e0f82fbb 100644 +index bce78beaadbfd0e400457bd14bcf6538be702879..41eef8bfd1572aecaf086bfbec300abeae2df794 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -@@ -170,9 +170,9 @@ public final class NaturalSpawner { +@@ -165,9 +165,9 @@ public final class NaturalSpawner { StructureManager structuremanager = world.structureManager(); ChunkGenerator chunkgenerator = world.getChunkSource().getGenerator(); int i = pos.getY(); @@ -21,7 +21,7 @@ index 352d230b365c512a4b9831265d3a57825f80fbfd..d5ada3301429e7fec0d157d7a33d4937 BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(); int j = 0; int k = 0; -@@ -201,7 +201,7 @@ public final class NaturalSpawner { +@@ -196,7 +196,7 @@ public final class NaturalSpawner { if (entityhuman != null) { double d2 = entityhuman.distanceToSqr(d0, (double) i, d1); diff --git a/patches/unapplied/server/0262-Implement-furnace-cook-speed-multiplier-API.patch b/patches/server/0256-Implement-furnace-cook-speed-multiplier-API.patch similarity index 86% rename from patches/unapplied/server/0262-Implement-furnace-cook-speed-multiplier-API.patch rename to patches/server/0256-Implement-furnace-cook-speed-multiplier-API.patch index b3fe37e706..1b102b8639 100644 --- a/patches/unapplied/server/0262-Implement-furnace-cook-speed-multiplier-API.patch +++ b/patches/server/0256-Implement-furnace-cook-speed-multiplier-API.patch @@ -9,16 +9,18 @@ to the nearest Integer when updating its current cook time. Co-authored-by: Eric Su diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 7a13042631bea761952490cfd14dc20147405161..9801b777bc6ab7de91d82b29a142459292ee8605 100644 +index 70e068c3d0f72f31df749add2c57450f793524ae..4cd7232f538649d99892f3b31f2741b1d7e792e8 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -78,11 +78,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -79,6 +79,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit protected NonNullList items; public int litTime; int litDuration; + public double cookSpeedMultiplier = 1.0; // Paper - cook speed multiplier API public int cookingProgress; public int cookingTotalTime; + @Nullable +@@ -86,6 +87,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit protected final ContainerData dataAccess; public final Object2IntOpenHashMap recipesUsed; private final RecipeManager.CachedCheck quickCheck; @@ -26,15 +28,15 @@ index 7a13042631bea761952490cfd14dc20147405161..9801b777bc6ab7de91d82b29a1424592 protected AbstractFurnaceBlockEntity(BlockEntityType blockEntityType, BlockPos pos, BlockState state, RecipeType recipeType) { super(blockEntityType, pos, state); -@@ -129,6 +131,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -132,6 +134,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit }; this.recipesUsed = new Object2IntOpenHashMap(); this.quickCheck = RecipeManager.createCheck((RecipeType) recipeType); // CraftBukkit - decompile error // Eclipse fail + this.recipeType = recipeType; // Paper - cook speed multiplier API } - public static Map getFuel() { -@@ -281,6 +284,11 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit + public static void invalidateCache() { +@@ -295,6 +298,11 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit this.recipesUsed.put(new ResourceLocation(s), nbttagcompound1.getInt(s)); } @@ -46,15 +48,15 @@ index 7a13042631bea761952490cfd14dc20147405161..9801b777bc6ab7de91d82b29a1424592 } @Override -@@ -289,6 +297,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -303,6 +311,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit nbt.putShort("BurnTime", (short) this.litTime); nbt.putShort("CookTime", (short) this.cookingProgress); nbt.putShort("CookTimeTotal", (short) this.cookingTotalTime); + nbt.putDouble("Paper.CookSpeedMultiplier", this.cookSpeedMultiplier); // Paper - cook speed multiplier API - ContainerHelper.saveAllItems(nbt, this.items); + ContainerHelper.saveAllItems(nbt, this.items, registryLookup); CompoundTag nbttagcompound1 = new CompoundTag(); -@@ -360,7 +369,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -374,7 +383,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit CraftItemStack source = CraftItemStack.asCraftMirror(blockEntity.items.get(0)); CookingRecipe recipe = (CookingRecipe) recipeholder.toBukkitRecipe(); @@ -63,7 +65,7 @@ index 7a13042631bea761952490cfd14dc20147405161..9801b777bc6ab7de91d82b29a1424592 world.getCraftServer().getPluginManager().callEvent(event); blockEntity.cookingTotalTime = event.getTotalCookTime(); -@@ -368,9 +377,9 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -382,9 +391,9 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit // CraftBukkit end ++blockEntity.cookingProgress; @@ -75,7 +77,7 @@ index 7a13042631bea761952490cfd14dc20147405161..9801b777bc6ab7de91d82b29a1424592 if (AbstractFurnaceBlockEntity.burn(blockEntity.level, blockEntity.worldPosition, world.registryAccess(), recipeholder, blockEntity.items, i)) { // CraftBukkit blockEntity.setRecipeUsed(recipeholder); } -@@ -470,11 +479,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -484,11 +493,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit } } @@ -93,9 +95,9 @@ index 7a13042631bea761952490cfd14dc20147405161..9801b777bc6ab7de91d82b29a1424592 } public static boolean isFuel(ItemStack stack) { -@@ -544,7 +554,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit - } - +@@ -533,7 +543,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit + this.items.set(slot, stack); + stack.limitSize(this.getMaxStackSize(stack)); if (slot == 0 && !flag) { - this.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(this.level, this); + this.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(this.level, this.recipeType, this, this.cookSpeedMultiplier); // Paper - cook speed multiplier API @@ -103,13 +105,13 @@ index 7a13042631bea761952490cfd14dc20147405161..9801b777bc6ab7de91d82b29a1424592 this.setChanged(); } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java -index 2f25a502c5c7223101f2d8c125977e2c614cd899..f98cf44e929d326037e1089dafe4f82c6f6d8647 100644 +index 46a1c96efc5ffb5c8d6c20af758bdca5bb4a5049..ddbbf977c8f536a156ff6b2462353f7be5ab5742 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java -@@ -85,4 +85,20 @@ public abstract class CraftFurnace extends +@@ -89,4 +89,20 @@ public abstract class CraftFurnace extends @Override - public abstract CraftFurnace copy(); + public abstract CraftFurnace copy(Location location); + + // Paper start - cook speed multiplier API + @Override diff --git a/patches/unapplied/server/0263-Honor-EntityAgeable.ageLock.patch b/patches/server/0257-Honor-EntityAgeable.ageLock.patch similarity index 61% rename from patches/unapplied/server/0263-Honor-EntityAgeable.ageLock.patch rename to patches/server/0257-Honor-EntityAgeable.ageLock.patch index 54501c6962..e1922af42f 100644 --- a/patches/unapplied/server/0263-Honor-EntityAgeable.ageLock.patch +++ b/patches/server/0257-Honor-EntityAgeable.ageLock.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Honor EntityAgeable.ageLock diff --git a/src/main/java/net/minecraft/world/entity/AgeableMob.java b/src/main/java/net/minecraft/world/entity/AgeableMob.java -index be5e603d505566feac61cc7e591d35ce483a92df..8dcdc664470fcac00c203b9499ea0a45df7d86ef 100644 +index f07cf6d91e0cbad80c3c630c0d505820e701ce81..3dc3609d13a7b823d15384d1c385b68eeb933d26 100644 --- a/src/main/java/net/minecraft/world/entity/AgeableMob.java +++ b/src/main/java/net/minecraft/world/entity/AgeableMob.java @@ -85,6 +85,7 @@ public abstract class AgeableMob extends PathfinderMob { @@ -17,22 +17,22 @@ index be5e603d505566feac61cc7e591d35ce483a92df..8dcdc664470fcac00c203b9499ea0a45 int k = j; diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -index 70400c9d8835046523c55e3777a2f02da6168dcb..b0c57922fa6160772ba1aaf61c0e97c03a0e6e8c 100644 +index be91618d84be4a77b2f8a13e9b4024b5892c25e0..344b18127d3e8c7408a162cc85287382bdfdda9a 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -@@ -303,6 +303,7 @@ public class BeehiveBlockEntity extends BlockEntity { - } - - private static void setBeeReleaseData(int ticks, Bee bee) { -+ if (!bee.ageLocked) { // Paper - Honor ageLock - int j = bee.getAge(); - - if (j < 0) { -@@ -310,6 +311,7 @@ public class BeehiveBlockEntity extends BlockEntity { - } else if (j > 0) { - bee.setAge(Math.max(0, j - ticks)); +@@ -446,6 +446,7 @@ public class BeehiveBlockEntity extends BlockEntity { } -+ } // Paper - Honor ageLock - bee.setInLoveTime(Math.max(0, bee.getInLoveTime() - ticks)); + private static void setBeeReleaseData(int ticksInHive, Bee beeEntity) { ++ if (!beeEntity.ageLocked) { // Paper - Honor ageLock + int j = beeEntity.getAge(); + + if (j < 0) { +@@ -455,6 +456,7 @@ public class BeehiveBlockEntity extends BlockEntity { + } + + beeEntity.setInLoveTime(Math.max(0, beeEntity.getInLoveTime() - ticksInHive)); ++ } // Paper - Honor ageLock + } } + diff --git a/patches/server/0258-Configurable-connection-throttle-kick-message.patch b/patches/server/0258-Configurable-connection-throttle-kick-message.patch new file mode 100644 index 0000000000..45bfe1972e --- /dev/null +++ b/patches/server/0258-Configurable-connection-throttle-kick-message.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Tue, 2 Oct 2018 09:57:50 +0100 +Subject: [PATCH] Configurable connection throttle kick message + + +diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +index 644214cc3a3c8e560b6ce470fe5997e3c10a2e3d..bc15794e0a3909ab9ceeded35158bea4c23fb45a 100644 +--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +@@ -82,7 +82,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL + synchronized (ServerHandshakePacketListenerImpl.throttleTracker) { + if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) { + ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime); +- MutableComponent chatmessage = Component.literal("Connection throttled! Please wait before reconnecting."); ++ Component chatmessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.connectionThrottle); // Paper - Configurable connection throttle kick message + this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage)); + this.connection.disconnect(chatmessage); + return; diff --git a/patches/unapplied/server/0265-Prevent-chunk-loading-from-Fluid-Flowing.patch b/patches/server/0259-Prevent-chunk-loading-from-Fluid-Flowing.patch similarity index 97% rename from patches/unapplied/server/0265-Prevent-chunk-loading-from-Fluid-Flowing.patch rename to patches/server/0259-Prevent-chunk-loading-from-Fluid-Flowing.patch index a809dac397..50c82e5d54 100644 --- a/patches/unapplied/server/0265-Prevent-chunk-loading-from-Fluid-Flowing.patch +++ b/patches/server/0259-Prevent-chunk-loading-from-Fluid-Flowing.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent chunk loading from Fluid Flowing diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java -index 818c83934a97c4b2ad4db69f4b0fcf0a500ea918..0aeb9faa1ce22359361741a591aa3d465d955970 100644 +index b67bc6d6a02fdac377f32a766fd8cc2c5fc43488..3a2ae2bca410708736da64560e74b8010444f2dc 100644 --- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java +++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java @@ -176,7 +176,8 @@ public abstract class FlowingFluid extends Fluid { diff --git a/patches/unapplied/server/0267-PreSpawnerSpawnEvent.patch b/patches/server/0260-PreSpawnerSpawnEvent.patch similarity index 91% rename from patches/unapplied/server/0267-PreSpawnerSpawnEvent.patch rename to patches/server/0260-PreSpawnerSpawnEvent.patch index 669bde79e7..3512bab510 100644 --- a/patches/unapplied/server/0267-PreSpawnerSpawnEvent.patch +++ b/patches/server/0260-PreSpawnerSpawnEvent.patch @@ -9,10 +9,10 @@ SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for spawners. diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index 0166c5ff685490cbf67a9d26f48cb1a0be754488..cae8c508972d771ad96228ace8a7e6cbc34d5489 100644 +index d13abdcc7a54bdecf853c883911ef535733610b4..ee897b8c9462dbb3d7be9a2994753155065ce205 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java -@@ -131,10 +131,10 @@ public abstract class BaseSpawner { +@@ -133,10 +133,10 @@ public abstract class BaseSpawner { continue; } // Paper start - PreCreatureSpawnEvent diff --git a/patches/unapplied/server/0268-Add-LivingEntity-getTargetEntity.patch b/patches/server/0261-Add-LivingEntity-getTargetEntity.patch similarity index 93% rename from patches/unapplied/server/0268-Add-LivingEntity-getTargetEntity.patch rename to patches/server/0261-Add-LivingEntity-getTargetEntity.patch index 796d844555..44504af9dc 100644 --- a/patches/unapplied/server/0268-Add-LivingEntity-getTargetEntity.patch +++ b/patches/server/0261-Add-LivingEntity-getTargetEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 4b3d1c8452bd759db6fc8d3d9fcf98e2a8d25084..1a328de32b69b69814e11a5b6bc55bfccf408d6b 100644 +index a770d2bda45cee739a5371119018e6f6e4cbb2cb..9f97c1c18d7f7e084897f584be77b128c5cbfa13 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -115,6 +115,7 @@ import net.minecraft.world.level.storage.loot.LootTable; +@@ -121,6 +121,7 @@ import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.AABB; @@ -16,7 +16,7 @@ index 4b3d1c8452bd759db6fc8d3d9fcf98e2a8d25084..1a328de32b69b69814e11a5b6bc55bfc import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; import net.minecraft.world.scores.PlayerTeam; -@@ -3911,6 +3912,38 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3996,6 +3997,38 @@ public abstract class LivingEntity extends Entity implements Attackable { return this.level().clip(raytrace); } @@ -56,7 +56,7 @@ index 4b3d1c8452bd759db6fc8d3d9fcf98e2a8d25084..1a328de32b69b69814e11a5b6bc55bfc public int getShieldBlockingDelay() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 8139ea88988e2e3551258b6686873753353ab9f8..5def5bccd8fce86ce015567e65fefae329819c18 100644 +index fa2cb4820698d4f0f317d7abd14216bdd54143a7..b2172a8c70ab77ba7c98b6b2b27595765d7eba11 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -1,5 +1,6 @@ @@ -66,7 +66,7 @@ index 8139ea88988e2e3551258b6686873753353ab9f8..5def5bccd8fce86ce015567e65fefae3 import com.google.common.base.Preconditions; import com.google.common.collect.Sets; import java.util.ArrayList; -@@ -226,6 +227,39 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -225,6 +226,39 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } return null; } diff --git a/patches/unapplied/server/0269-Add-sun-related-API.patch b/patches/server/0262-Add-sun-related-API.patch similarity index 84% rename from patches/unapplied/server/0269-Add-sun-related-API.patch rename to patches/server/0262-Add-sun-related-API.patch index c0c24f104f..c9746a7ad0 100644 --- a/patches/unapplied/server/0269-Add-sun-related-API.patch +++ b/patches/server/0262-Add-sun-related-API.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Add sun related API public net.minecraft.world.entity.Mob isSunBurnTick()Z diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index fd04c5c7e08b54de65ffaf58385dcc05ef22bba0..18db1aa374495a214807c5eb3ccc0213fc7c6a47 100644 +index 4a7c418a497b98d5038794b6bbc38f5e0b7fedd7..5d5eb6cef3b9646fab6c8da2a67d269312e6958c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -731,6 +731,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -25,10 +25,10 @@ index fd04c5c7e08b54de65ffaf58385dcc05ef22bba0..18db1aa374495a214807c5eb3ccc0213 public long getGameTime() { return this.world.levelData.getGameTime(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 018884ced888fcd03d2fb17b3620f8e6125e67da..0ad9885f939bcb50026d50ed78b970a44772ceb8 100644 +index d597eea5d5c2f223e87bff06f292619657596f1f..2a8596e4f9d7be966c18e867c2c7b5bfbea9742c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -@@ -93,4 +93,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { +@@ -90,4 +90,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { public long getSeed() { return this.getHandle().lootTableSeed; } diff --git a/patches/unapplied/server/0270-Catch-JsonParseException-in-entity-and-block-entity-.patch b/patches/server/0263-Catch-JsonParseException-in-entity-and-block-entity-.patch similarity index 54% rename from patches/unapplied/server/0270-Catch-JsonParseException-in-entity-and-block-entity-.patch rename to patches/server/0263-Catch-JsonParseException-in-entity-and-block-entity-.patch index 99c5fe4d1e..bff4fb181b 100644 --- a/patches/unapplied/server/0270-Catch-JsonParseException-in-entity-and-block-entity-.patch +++ b/patches/server/0263-Catch-JsonParseException-in-entity-and-block-entity-.patch @@ -13,7 +13,7 @@ Shulkers) may need to be changed in order for it to re-save properly No more crashing though. diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java -index c57e8b6458800fe9bb27050eecc42bd3e5cf5a15..83c7b47e189a934345f6548df9b101cc8c501910 100644 +index c57e8b6458800fe9bb27050eecc42bd3e5cf5a15..cdb514137797f4265dea5edb094caada5cee46a3 100644 --- a/src/main/java/io/papermc/paper/util/MCUtil.java +++ b/src/main/java/io/papermc/paper/util/MCUtil.java @@ -558,4 +558,19 @@ public final class MCUtil { @@ -22,13 +22,13 @@ index c57e8b6458800fe9bb27050eecc42bd3e5cf5a15..83c7b47e189a934345f6548df9b101cc } + + @Nullable -+ public static net.minecraft.network.chat.Component getBaseComponentFromNbt(String key, net.minecraft.nbt.CompoundTag compound) { ++ public static net.minecraft.network.chat.Component getBaseComponentFromNbt(final String key, final net.minecraft.nbt.CompoundTag compound, final net.minecraft.core.HolderLookup.Provider lookupProvider) { + if (!compound.contains(key)) { + return null; + } -+ String string = compound.getString(key); ++ final String string = compound.getString(key); + try { -+ return net.minecraft.network.chat.Component.Serializer.fromJson(string); ++ return net.minecraft.network.chat.Component.Serializer.fromJson(string, lookupProvider); + } catch (com.google.gson.JsonParseException e) { + org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage()); + } @@ -37,67 +37,80 @@ index c57e8b6458800fe9bb27050eecc42bd3e5cf5a15..83c7b47e189a934345f6548df9b101cc + } } diff --git a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java -index 129f0e6108366dbba1bafb04e01e5e5e6489f577..ac0aeb53176069d0835b6b08c8d871edae846763 100644 +index 626e4fe03dea008907823b49f0dd936bbf7e4e04..2d0eac7a8aa94ed6c4ec024bc6024440cbeac702 100644 --- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java +++ b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java -@@ -72,7 +72,7 @@ public abstract class BaseCommandBlock implements CommandSource { +@@ -75,7 +75,7 @@ public abstract class BaseCommandBlock implements CommandSource { this.command = nbt.getString("Command"); this.successCount = nbt.getInt("SuccessCount"); if (nbt.contains("CustomName", 8)) { -- this.setName(Component.Serializer.fromJson(nbt.getString("CustomName"))); -+ this.setName(io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt)); // Paper - Catch ParseException +- this.setCustomName(Component.Serializer.fromJson(nbt.getString("CustomName"), registries)); ++ this.setCustomName(io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registries)); // Paper - Catch ParseException + } else { + this.setCustomName((Component) null); } - - if (nbt.contains("TrackOutput", 1)) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java -index c6194fa1611412ac119fed493d5eab5a160e593d..d89037a83ae1b6d2afa6a589c1b8098cbedf3d2d 100644 +index df4cd333ecd5c90e910df0c7c5ab5aa44c182903..2656e06ab2269141a13011eaa906f601887ca3e2 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java -@@ -98,7 +98,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { - public void load(CompoundTag nbt) { - super.load(nbt); +@@ -77,7 +77,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { + protected void loadAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) { + super.loadAdditional(nbt, registryLookup); if (nbt.contains("CustomName", 8)) { -- this.name = Component.Serializer.fromJson(nbt.getString("CustomName")); -+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException +- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup); ++ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException } - this.itemPatterns = nbt.getList("Patterns", 10); + if (nbt.contains("patterns")) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java -index 25764076fec05b1362aa9b9b608e03bd39817d90..fce3a45d09a93ca68a3d49f2e666afa4c860d042 100644 +index ee3b370b6b36914146db33a3211b6bbd2f8f16b7..ff3f26c31bd11b48f48e354ea6b33aa55dcbff5d 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java -@@ -31,7 +31,7 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co - super.load(nbt); +@@ -39,7 +39,7 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co + super.loadAdditional(nbt, registryLookup); this.lockKey = LockCode.fromTag(nbt); if (nbt.contains("CustomName", 8)) { -- this.name = Component.Serializer.fromJson(nbt.getString("CustomName")); -+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException +- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup); ++ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException } } diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index 25ec3ab534872500a2eb51cd44062e2754c404bb..a1097950766ad31393340b423ea3f98a1f555368 100644 +index d3ef3d9a67bc54a4c82a39718f01201201dfc44c..18450017bc3df2f0b1a5715e6021e8e5defa24a1 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -@@ -389,7 +389,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -391,7 +391,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name this.secondaryPower = BeaconBlockEntity.loadEffect(nbt, "secondary_effect"); this.levels = nbt.getInt("Levels"); // CraftBukkit - SPIGOT-5053, use where available if (nbt.contains("CustomName", 8)) { -- this.name = Component.Serializer.fromJson(nbt.getString("CustomName")); -+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException +- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup); ++ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException } this.lockKey = LockCode.fromTag(nbt); -diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java -index 00de0cc29775a219a763431fd4d54b2fa2585477..4d1a895f3749bdcb132de199e81a9d93330c0ee6 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java -@@ -41,7 +41,7 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable - public void load(CompoundTag nbt) { - super.load(nbt); +diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java +index 767994f493fb0a0e4bf097cd7cc178c10e79e937..c3503eaec5c5ece6e27a52fb703d06ec7c767383 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java +@@ -45,7 +45,7 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable + protected void loadAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) { + super.loadAdditional(nbt, registryLookup); if (nbt.contains("CustomName", 8)) { -- this.name = Component.Serializer.fromJson(nbt.getString("CustomName")); -+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException +- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup); ++ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException } } +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 ebba6bc5b337d19e32be5a78294501ed8300f2bd..adc87c2da5a4a4a89eb9708850376eaed49cf20a 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 +@@ -145,7 +145,7 @@ public class SkullBlockEntity extends BlockEntity { + } + + if (nbt.contains("custom_name", 8)) { +- this.customName = Component.Serializer.fromJson(nbt.getString("custom_name"), registryLookup); ++ this.customName = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("custom_name", nbt, registryLookup); // Paper - Catch ParseException + } else { + this.customName = null; + } diff --git a/patches/unapplied/server/0271-Turtle-API.patch b/patches/server/0264-Turtle-API.patch similarity index 93% rename from patches/unapplied/server/0271-Turtle-API.patch rename to patches/server/0264-Turtle-API.patch index c72425f93a..4069d4db59 100644 --- a/patches/unapplied/server/0271-Turtle-API.patch +++ b/patches/server/0264-Turtle-API.patch @@ -12,10 +12,10 @@ public net.minecraft.world.entity.animal.Turtle isTravelling()Z public net.minecraft.world.entity.animal.Turtle setTravelling(Z)V diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -index 11322066522a3268063bad7267ef4dd4f06d983e..cfc0cee09dfd522409bb5853fc96528bd0137475 100644 +index e6bc782683ea5d69840ca7b89b20cfdc1adac5fd..b550befd7bd05951be160f81600200b0b31bae5b 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -@@ -489,14 +489,17 @@ public class Turtle extends Animal { +@@ -487,14 +487,17 @@ public class Turtle extends Animal { if (!this.turtle.isInWater() && this.isReachedTarget()) { if (this.turtle.layEggCounter < 1) { @@ -35,8 +35,8 @@ index 11322066522a3268063bad7267ef4dd4f06d983e..cfc0cee09dfd522409bb5853fc96528b + BlockState iblockdata = (BlockState) Blocks.TURTLE_EGG.defaultBlockState().setValue(TurtleEggBlock.EGGS, layEggEvent.getEggCount()); // Paper world.setBlock(blockposition1, iblockdata, 3); - world.gameEvent(GameEvent.BLOCK_PLACE, blockposition1, GameEvent.Context.of(this.turtle, iblockdata)); -@@ -566,7 +569,7 @@ public class Turtle extends Animal { + world.gameEvent((Holder) GameEvent.BLOCK_PLACE, blockposition1, GameEvent.Context.of(this.turtle, iblockdata)); +@@ -564,7 +567,7 @@ public class Turtle extends Animal { @Override public boolean canUse() { diff --git a/patches/unapplied/server/0272-Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/0265-Call-player-spectator-target-events-and-improve-impl.patch similarity index 93% rename from patches/unapplied/server/0272-Call-player-spectator-target-events-and-improve-impl.patch rename to patches/server/0265-Call-player-spectator-target-events-and-improve-impl.patch index 192951a6e9..6c50ec8023 100644 --- a/patches/unapplied/server/0272-Call-player-spectator-target-events-and-improve-impl.patch +++ b/patches/server/0265-Call-player-spectator-target-events-and-improve-impl.patch @@ -19,10 +19,10 @@ spectate the target entity. Co-authored-by: Spottedleaf diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 054057482d191d8e77bf4d179d51e32b5d9ca16e..19c3eb566552f7994ae5e60dc869c94e08590fbb 100644 +index c97410f580f31389987ef944fc410e44459a4693..b331af6de6a23dedf6cd21b97cb81048db215f10 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2041,6 +2041,21 @@ public class ServerPlayer extends Player { +@@ -2123,6 +2123,21 @@ public class ServerPlayer extends Player { this.camera = (Entity) (entity == null ? this : entity); if (entity1 != this.camera) { diff --git a/patches/unapplied/server/0273-Add-more-Witch-API.patch b/patches/server/0266-Add-more-Witch-API.patch similarity index 87% rename from patches/unapplied/server/0273-Add-more-Witch-API.patch rename to patches/server/0266-Add-more-Witch-API.patch index 2bfa611724..a4d09e1bb4 100644 --- a/patches/unapplied/server/0273-Add-more-Witch-API.patch +++ b/patches/server/0266-Add-more-Witch-API.patch @@ -7,15 +7,15 @@ Subject: [PATCH] Add more Witch API public net.minecraft.world.entity.monster.Witch usingTime diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java -index 25a1edf64602a13c07779e58b167a8471019588e..f9ffc5f4cbfdcf5c7351a883d2e5c26492175283 100644 +index d286239d02b81624124c4e32ff4413bbac902d54..5803c1d36b769f0186baa0665976749765b4cb61 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Witch.java +++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java -@@ -160,21 +160,7 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -150,21 +150,7 @@ public class Witch extends Raider implements RangedAttackMob { } - if (potionregistry != null) { + if (holder != null) { - // Paper start -- ItemStack potion = PotionUtils.setPotion(new ItemStack(Items.POTION), potionregistry); +- ItemStack potion = PotionContents.createItemStack(Items.POTION, holder); - potion = org.bukkit.craftbukkit.event.CraftEventFactory.handleWitchReadyPotionEvent(this, potion); - this.setItemSlot(EquipmentSlot.MAINHAND, potion); - // Paper end @@ -27,13 +27,13 @@ index 25a1edf64602a13c07779e58b167a8471019588e..f9ffc5f4cbfdcf5c7351a883d2e5c264 - - AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); - -- attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.getId()); +- attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.id()); - attributemodifiable.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING); -+ this.setDrinkingPotion(PotionUtils.setPotion(new ItemStack(Items.POTION), potionregistry)); // Paper - logic moved into setDrinkingPotion, copy exact impl into the method and then comment out ++ this.setDrinkingPotion(PotionContents.createItemStack(Items.POTION, holder)); // Paper - logic moved into setDrinkingPotion, copy exact impl into the method and then comment out } } -@@ -186,6 +172,23 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -176,6 +162,23 @@ public class Witch extends Raider implements RangedAttackMob { super.aiStep(); } @@ -49,7 +49,7 @@ index 25a1edf64602a13c07779e58b167a8471019588e..f9ffc5f4cbfdcf5c7351a883d2e5c264 + + AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); + -+ attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.getId()); ++ attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.id()); + attributemodifiable.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING); + } + // Paper end diff --git a/patches/unapplied/server/0274-Check-Drowned-for-Villager-Aggression-Config.patch b/patches/server/0267-Check-Drowned-for-Villager-Aggression-Config.patch similarity index 90% rename from patches/unapplied/server/0274-Check-Drowned-for-Villager-Aggression-Config.patch rename to patches/server/0267-Check-Drowned-for-Villager-Aggression-Config.patch index 4f39e06ff4..efafeb919c 100644 --- a/patches/unapplied/server/0274-Check-Drowned-for-Villager-Aggression-Config.patch +++ b/patches/server/0267-Check-Drowned-for-Villager-Aggression-Config.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Check Drowned for Villager Aggression Config diff --git a/src/main/java/net/minecraft/world/entity/monster/Drowned.java b/src/main/java/net/minecraft/world/entity/monster/Drowned.java -index ee2abc0c39a76a74c151ecc8660d2037f3db0636..01897af1e6253b987734a24c052daf2ce1314092 100644 +index d4b3ce2bb2021625c90a3f51c6f9da6056b2e2ff..cff1b5e0e3fd32d82157d5f13d83d4abdfad7378 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java +++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java -@@ -78,7 +78,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -81,7 +81,7 @@ public class Drowned extends Zombie implements RangedAttackMob { this.goalSelector.addGoal(7, new RandomStrollGoal(this, 1.0D)); this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Drowned.class})).setAlertOthers(ZombifiedPiglin.class)); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::okTarget)); diff --git a/patches/unapplied/server/0275-Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/0268-Add-option-to-prevent-players-from-moving-into-unloa.patch similarity index 90% rename from patches/unapplied/server/0275-Add-option-to-prevent-players-from-moving-into-unloa.patch rename to patches/server/0268-Add-option-to-prevent-players-from-moving-into-unloa.patch index 7df1cf3de5..a02a4a035f 100644 --- a/patches/unapplied/server/0275-Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/patches/server/0268-Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7663110df928ec88fc97e3b7d65671001db2d1bc..1de240ecfbe815c12fc35aee1198f8c7a44f3527 100644 +index f49f412781a8f341eda02de323f7298d5f0b25ee..8a7b286bb2d2151d8f2182d1a8e0d891ff6d677a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -474,9 +474,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -500,9 +500,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d0 = entity.getX(); double d1 = entity.getY(); double d2 = entity.getZ(); @@ -22,7 +22,7 @@ index 7663110df928ec88fc97e3b7d65671001db2d1bc..1de240ecfbe815c12fc35aee1198f8c7 float f = Mth.wrapDegrees(packet.getYRot()); float f1 = Mth.wrapDegrees(packet.getXRot()); double d6 = d3 - this.vehicleFirstGoodX; -@@ -510,6 +510,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -536,6 +536,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } speed *= 2f; // TODO: Get the speed of the vehicle instead of the player @@ -39,7 +39,7 @@ index 7663110df928ec88fc97e3b7d65671001db2d1bc..1de240ecfbe815c12fc35aee1198f8c7 if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // CraftBukkit end ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8}); -@@ -1178,9 +1188,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1168,9 +1178,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } else { this.awaitingTeleportTime = this.tickCount; @@ -52,7 +52,7 @@ index 7663110df928ec88fc97e3b7d65671001db2d1bc..1de240ecfbe815c12fc35aee1198f8c7 float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot())); float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot())); -@@ -1236,6 +1246,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1228,6 +1238,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } else { speed = this.player.getAbilities().walkingSpeed * 10f; } @@ -63,5 +63,5 @@ index 7663110df928ec88fc97e3b7d65671001db2d1bc..1de240ecfbe815c12fc35aee1198f8c7 + } + // Paper end - Prevent moving into unloaded chunks - 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) || !flag)) { + float f2 = flag ? 300.0F : 100.0F; diff --git a/patches/unapplied/server/0276-Reset-players-airTicks-on-respawn.patch b/patches/server/0269-Reset-players-airTicks-on-respawn.patch similarity index 83% rename from patches/unapplied/server/0276-Reset-players-airTicks-on-respawn.patch rename to patches/server/0269-Reset-players-airTicks-on-respawn.patch index 86f7de966c..792f05094a 100644 --- a/patches/unapplied/server/0276-Reset-players-airTicks-on-respawn.patch +++ b/patches/server/0269-Reset-players-airTicks-on-respawn.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Reset players airTicks on respawn diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 19c3eb566552f7994ae5e60dc869c94e08590fbb..08c936288b5ac8738d7cff9fe95b1256ae32cd28 100644 +index b331af6de6a23dedf6cd21b97cb81048db215f10..3b71ea8263b2049c54432a64c7f01aed3848d1c7 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2516,6 +2516,7 @@ public class ServerPlayer extends Player { +@@ -2614,6 +2614,7 @@ public class ServerPlayer extends Player { this.setHealth(this.getMaxHealth()); this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset diff --git a/patches/unapplied/server/0277-Don-t-sleep-after-profile-lookups-if-not-needed.patch b/patches/server/0270-Don-t-sleep-after-profile-lookups-if-not-needed.patch similarity index 100% rename from patches/unapplied/server/0277-Don-t-sleep-after-profile-lookups-if-not-needed.patch rename to patches/server/0270-Don-t-sleep-after-profile-lookups-if-not-needed.patch diff --git a/patches/unapplied/server/0278-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/0271-Improve-Server-Thread-Pool-and-Thread-Priorities.patch similarity index 93% rename from patches/unapplied/server/0278-Improve-Server-Thread-Pool-and-Thread-Priorities.patch rename to patches/server/0271-Improve-Server-Thread-Pool-and-Thread-Priorities.patch index 2b7f60d9b0..9c540aa936 100644 --- a/patches/unapplied/server/0278-Improve-Server-Thread-Pool-and-Thread-Priorities.patch +++ b/patches/server/0271-Improve-Server-Thread-Pool-and-Thread-Priorities.patch @@ -38,10 +38,10 @@ index 0000000000000000000000000000000000000000..b60f59cf5cc8eb84a6055b7861857dec + } +} diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java -index 3db6962b9f6f5da09694d57b7323c39f314b1327..722734ce612fb790ddc80488a795a85ebcd4a842 100644 +index cf54e2c8e8aadb9e7343382a5ba59c657234c9b9..c7a21a11efba5c212958d56095217621828c1062 100644 --- a/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java -@@ -88,7 +88,7 @@ public class Util { +@@ -90,7 +90,7 @@ public class Util { private static final int DEFAULT_MAX_THREADS = 255; private static final int DEFAULT_SAFE_FILE_OPERATION_RETRIES = 10; private static final String MAX_THREADS_SYSTEM_PROPERTY = "max.bg.threads"; @@ -50,7 +50,7 @@ index 3db6962b9f6f5da09694d57b7323c39f314b1327..722734ce612fb790ddc80488a795a85e 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 -@@ -154,15 +154,27 @@ public class Util { +@@ -160,15 +160,27 @@ public class Util { return FILENAME_DATE_TIME_FORMATTER.format(ZonedDateTime.now()); } @@ -83,7 +83,7 @@ index 3db6962b9f6f5da09694d57b7323c39f314b1327..722734ce612fb790ddc80488a795a85e @Override protected void onTermination(Throwable throwable) { if (throwable != null) { -@@ -178,6 +190,7 @@ public class Util { +@@ -184,6 +196,7 @@ public class Util { return forkJoinWorkerThread; }, Util::onThreadException, true); } @@ -92,10 +92,10 @@ index 3db6962b9f6f5da09694d57b7323c39f314b1327..722734ce612fb790ddc80488a795a85e return executorService; } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8196ecb2a7280a4f60a5fea18c484d6419953b48..dd2cbb4d3bda6776e94279513b8d58d20661a8aa 100644 +index 23a5358a5fe4784e75b327741e6fcb174c04d287..0a460ae7f57d1a58385e23fb9f95a7c475aec1da 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -312,6 +312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { MinecraftServer.LOGGER.error("Uncaught exception in server thread", throwable); }); diff --git a/patches/unapplied/server/0279-Optimize-World-Time-Updates.patch b/patches/server/0272-Optimize-World-Time-Updates.patch similarity index 94% rename from patches/unapplied/server/0279-Optimize-World-Time-Updates.patch rename to patches/server/0272-Optimize-World-Time-Updates.patch index 7a2a7fb019..17f4fbf9d0 100644 --- a/patches/unapplied/server/0279-Optimize-World-Time-Updates.patch +++ b/patches/server/0272-Optimize-World-Time-Updates.patch @@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet object for every player unless they have per-player time enabled. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index dd2cbb4d3bda6776e94279513b8d58d20661a8aa..01acf93115db41212adf703d44481f50c746a8fa 100644 +index 0a460ae7f57d1a58385e23fb9f95a7c475aec1da..34e5adcbeb105e6da8ab660d7f322969305d44ec 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1478,12 +1478,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop items; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java -index 3aecc929c0a9ea6a770326304dacd51fc08ac894..8d3f71689087d687e6400e2ea9750a6fb3535bf1 100644 +index 02f9a9e5240222548bec643b817734f702ba8e98..4a4996f8653edaf3182887821a8762caceab58ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java @@ -28,7 +28,7 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat @@ -275,7 +275,7 @@ index 3aecc929c0a9ea6a770326304dacd51fc08ac894..8d3f71689087d687e6400e2ea9750a6f // Paper end @@ -50,10 +50,18 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat - ((RandomizableContainerBlockEntity) te).setCustomName(CraftChatMessage.fromStringOrNull(title)); + ((RandomizableContainerBlockEntity) te).name = CraftChatMessage.fromStringOrNull(title); } - return this.getInventory(te); @@ -306,7 +306,7 @@ index 3aecc929c0a9ea6a770326304dacd51fc08ac894..8d3f71689087d687e6400e2ea9750a6f @@ -78,11 +86,19 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) { Container tileEntity = this.getTileEntity(); - ((AbstractFurnaceBlockEntity) tileEntity).setCustomName(CraftChatMessage.fromStringOrNull(title)); + ((AbstractFurnaceBlockEntity) tileEntity).name = CraftChatMessage.fromStringOrNull(title); - return this.getInventory(tileEntity); + return this.getInventory(owner, type, tileEntity); // Paper } @@ -335,7 +335,7 @@ index 3aecc929c0a9ea6a770326304dacd51fc08ac894..8d3f71689087d687e6400e2ea9750a6f @@ -113,11 +129,19 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat if (tileEntity instanceof BrewingStandBlockEntity) { - ((BrewingStandBlockEntity) tileEntity).setCustomName(CraftChatMessage.fromStringOrNull(title)); + ((BrewingStandBlockEntity) tileEntity).name = CraftChatMessage.fromStringOrNull(title); } - return this.getInventory(tileEntity); + return this.getInventory(holder, type, tileEntity); // Paper diff --git a/patches/unapplied/server/0281-Fix-SpongeAbsortEvent-handling.patch b/patches/server/0274-Fix-SpongeAbsortEvent-handling.patch similarity index 93% rename from patches/unapplied/server/0281-Fix-SpongeAbsortEvent-handling.patch rename to patches/server/0274-Fix-SpongeAbsortEvent-handling.patch index 24104896d1..be21ac2045 100644 --- a/patches/unapplied/server/0281-Fix-SpongeAbsortEvent-handling.patch +++ b/patches/server/0274-Fix-SpongeAbsortEvent-handling.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix SpongeAbsortEvent handling Only process drops when the block is actually going to be removed diff --git a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java -index 1238317d3e6d968525a10c5480a7d44d56abb071..8f3cca228f8ec1ea9379fa43af4baa7b18012dd2 100644 +index 2e54730deee3149517a535f15ef6c0628ba659c2..902825ec9ea05f4418b45f56a008d73f217bd178 100644 --- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java @@ -134,7 +134,11 @@ public class SpongeBlock extends Block { diff --git a/patches/unapplied/server/0282-Don-t-allow-digging-into-unloaded-chunks.patch b/patches/server/0275-Don-t-allow-digging-into-unloaded-chunks.patch similarity index 88% rename from patches/unapplied/server/0282-Don-t-allow-digging-into-unloaded-chunks.patch rename to patches/server/0275-Don-t-allow-digging-into-unloaded-chunks.patch index ad8a5f726f..cbf1ee2ae5 100644 --- a/patches/unapplied/server/0282-Don-t-allow-digging-into-unloaded-chunks.patch +++ b/patches/server/0275-Don-t-allow-digging-into-unloaded-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't allow digging into unloaded chunks diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index a8d33286832786031ac57e6ce27d5181e1a3d9b1..e8b12b27e5ec74afb940f575e5ce78e5905d55f4 100644 +index 5f2dec1917f1c1c3bb69446832321f3fc21dc129..cd6f34ee326228036f8c025e4e6d04e0c15ba06f 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -119,8 +119,8 @@ public class ServerPlayerGameMode { +@@ -122,8 +122,8 @@ public class ServerPlayerGameMode { BlockState iblockdata; if (this.hasDelayedDestroy) { @@ -19,7 +19,7 @@ index a8d33286832786031ac57e6ce27d5181e1a3d9b1..e8b12b27e5ec74afb940f575e5ce78e5 this.hasDelayedDestroy = false; } else { float f = this.incrementDestroyProgress(iblockdata, this.delayedDestroyPos, this.delayedTickStart); -@@ -131,7 +131,13 @@ public class ServerPlayerGameMode { +@@ -134,7 +134,13 @@ public class ServerPlayerGameMode { } } } else if (this.isDestroyingBlock) { @@ -34,15 +34,15 @@ index a8d33286832786031ac57e6ce27d5181e1a3d9b1..e8b12b27e5ec74afb940f575e5ce78e5 if (iblockdata.isAir()) { this.level.destroyBlockProgress(this.player.getId(), this.destroyPos, -1); this.lastSentState = -1; -@@ -160,6 +166,7 @@ public class ServerPlayerGameMode { +@@ -163,6 +169,7 @@ public class ServerPlayerGameMode { public void handleBlockBreakAction(BlockPos pos, ServerboundPlayerActionPacket.Action action, Direction direction, int worldHeight, int sequence) { - if (this.player.getEyePosition().distanceToSqr(Vec3.atCenterOf(pos)) > ServerGamePacketListenerImpl.MAX_INTERACTION_DISTANCE) { + if (!this.player.canInteractWithBlock(pos, 1.0D)) { + if (true) return; // Paper - Don't allow digging into unloaded chunks; Don't notify if unreasonably far away this.debugLogging(pos, false, sequence, "too far"); } else if (pos.getY() >= worldHeight) { this.player.connection.send(new ClientboundBlockUpdatePacket(pos, this.level.getBlockState(pos))); -@@ -299,10 +306,12 @@ public class ServerPlayerGameMode { +@@ -302,10 +309,12 @@ public class ServerPlayerGameMode { this.debugLogging(pos, true, sequence, "stopped destroying"); } else if (action == ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK) { this.isDestroyingBlock = false; @@ -59,10 +59,10 @@ index a8d33286832786031ac57e6ce27d5181e1a3d9b1..e8b12b27e5ec74afb940f575e5ce78e5 this.level.destroyBlockProgress(this.player.getId(), pos, -1); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1de240ecfbe815c12fc35aee1198f8c7a44f3527..f7529016db5d6f933d8f44de07bbdb9e67040cb1 100644 +index 8a7b286bb2d2151d8f2182d1a8e0d891ff6d677a..5443a2713c957b23deb903baf7039b0220699095 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1590,6 +1590,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1589,6 +1589,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl case START_DESTROY_BLOCK: case ABORT_DESTROY_BLOCK: case STOP_DESTROY_BLOCK: diff --git a/patches/unapplied/server/0283-Make-the-default-permission-message-configurable.patch b/patches/server/0276-Make-the-default-permission-message-configurable.patch similarity index 92% rename from patches/unapplied/server/0283-Make-the-default-permission-message-configurable.patch rename to patches/server/0276-Make-the-default-permission-message-configurable.patch index 0f8d646305..c63fd9755d 100644 --- a/patches/unapplied/server/0283-Make-the-default-permission-message-configurable.patch +++ b/patches/server/0276-Make-the-default-permission-message-configurable.patch @@ -18,10 +18,10 @@ index 6d06b772ffb9d47d6a717462a4b2b494544e80ae..69ffd6ea2ce7c6d4f211c6081fcea79a } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index abdff07588cb06f8ec4f3f2172f7dce92fa8a979..43c69ec522a2c91d47b5cea05aaf86f979c5fcb2 100644 +index af9140513970fc5c3797a170eab02de40048543c..8254a5d2a72bf12b2f2600a99eb3058c6e76042a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2815,6 +2815,16 @@ public final class CraftServer implements Server { +@@ -2834,6 +2834,16 @@ public final class CraftServer implements Server { return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions; } diff --git a/patches/unapplied/server/0285-force-entity-dismount-during-teleportation.patch b/patches/server/0277-force-entity-dismount-during-teleportation.patch similarity index 86% rename from patches/unapplied/server/0285-force-entity-dismount-during-teleportation.patch rename to patches/server/0277-force-entity-dismount-during-teleportation.patch index 0fb457cc12..273b4e4634 100644 --- a/patches/unapplied/server/0285-force-entity-dismount-during-teleportation.patch +++ b/patches/server/0277-force-entity-dismount-during-teleportation.patch @@ -20,10 +20,10 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index c46ad2013439f043145fb7fc67bbcd80728e3c16..f746829f1e94ee58821e56ec4192269add00395b 100644 +index d39aec1b3233e91aa5b953396d876e7466a9a5bc..28708e1e8ade8fbfec24120478d250ddf1351bf4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2570,11 +2570,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2601,11 +2601,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public void removeVehicle() { @@ -41,7 +41,7 @@ index c46ad2013439f043145fb7fc67bbcd80728e3c16..f746829f1e94ee58821e56ec4192269a } } -@@ -2605,7 +2610,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2636,7 +2641,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } @@ -53,7 +53,7 @@ index c46ad2013439f043145fb7fc67bbcd80728e3c16..f746829f1e94ee58821e56ec4192269a if (entity.getVehicle() == this) { throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); } else { -@@ -2615,7 +2623,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2646,7 +2654,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { VehicleExitEvent event = new VehicleExitEvent( (Vehicle) this.getBukkitEntity(), @@ -62,7 +62,7 @@ index c46ad2013439f043145fb7fc67bbcd80728e3c16..f746829f1e94ee58821e56ec4192269a ); // Suppress during worldgen if (this.valid) { -@@ -2628,7 +2636,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2659,7 +2667,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } @@ -72,10 +72,10 @@ index c46ad2013439f043145fb7fc67bbcd80728e3c16..f746829f1e94ee58821e56ec4192269a if (this.valid) { Bukkit.getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 1a328de32b69b69814e11a5b6bc55bfccf408d6b..4be7b136dd2b35b0637a1455985ab99bbd3af0a5 100644 +index 9f97c1c18d7f7e084897f584be77b128c5cbfa13..709bcc209299fcc5a593c1b4c93a179af2b5eff1 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3492,9 +3492,15 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3579,9 +3579,15 @@ public abstract class LivingEntity extends Entity implements Attackable { @Override public void stopRiding() { @@ -93,10 +93,10 @@ index 1a328de32b69b69814e11a5b6bc55bfccf408d6b..4be7b136dd2b35b0637a1455985ab99b this.dismountVehicle(entity); } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 83c7ba56900ce40f71d98062bf15110a76597dce..3c3c953f05c18279d3245fe6bc8afef83cd62cd1 100644 +index 9cc9c6f7e211d9cf42a050f3a265d0bceaf7fd40..42911a87a9028a7ba8c3f63f498e4f15bcd07f24 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1141,7 +1141,13 @@ public abstract class Player extends LivingEntity { +@@ -1150,7 +1150,13 @@ public abstract class Player extends LivingEntity { @Override public void removeVehicle() { diff --git a/patches/unapplied/server/0286-Add-more-Zombie-API.patch b/patches/server/0278-Add-more-Zombie-API.patch similarity index 91% rename from patches/unapplied/server/0286-Add-more-Zombie-API.patch rename to patches/server/0278-Add-more-Zombie-API.patch index 99141e5971..baf2d41a0f 100644 --- a/patches/unapplied/server/0286-Add-more-Zombie-API.patch +++ b/patches/server/0278-Add-more-Zombie-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add more Zombie API public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index 15ccde8ee8bac1f70c6047464595aff6db073646..2c8529540bf3644896f3c05d5f544bd848647807 100644 +index 1226abd6ce7bb13942a0583c721835aeb769bbb6..7c206dc6f8db4b21d6d068eccc768203d041f51b 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -96,6 +96,7 @@ public class Zombie extends Monster { +@@ -93,6 +93,7 @@ public class Zombie extends Monster { private int inWaterTime; public int conversionTime; private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field @@ -18,7 +18,7 @@ index 15ccde8ee8bac1f70c6047464595aff6db073646..2c8529540bf3644896f3c05d5f544bd8 public Zombie(EntityType type, Level world) { super(type, world); -@@ -264,6 +265,12 @@ public class Zombie extends Monster { +@@ -261,6 +262,12 @@ public class Zombie extends Monster { super.aiStep(); } @@ -31,7 +31,7 @@ index 15ccde8ee8bac1f70c6047464595aff6db073646..2c8529540bf3644896f3c05d5f544bd8 public void startUnderWaterConversion(int ticksUntilWaterConversion) { this.lastTick = MinecraftServer.currentTick; // CraftBukkit this.conversionTime = ticksUntilWaterConversion; -@@ -293,9 +300,15 @@ public class Zombie extends Monster { +@@ -290,9 +297,15 @@ public class Zombie extends Monster { } public boolean isSunSensitive() { @@ -48,7 +48,7 @@ index 15ccde8ee8bac1f70c6047464595aff6db073646..2c8529540bf3644896f3c05d5f544bd8 @Override public boolean hurt(DamageSource source, float amount) { if (!super.hurt(source, amount)) { -@@ -415,6 +428,7 @@ public class Zombie extends Monster { +@@ -406,6 +419,7 @@ public class Zombie extends Monster { nbt.putBoolean("CanBreakDoors", this.canBreakDoors()); nbt.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1); nbt.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1); @@ -56,7 +56,7 @@ index 15ccde8ee8bac1f70c6047464595aff6db073646..2c8529540bf3644896f3c05d5f544bd8 } @Override -@@ -426,6 +440,11 @@ public class Zombie extends Monster { +@@ -417,6 +431,11 @@ public class Zombie extends Monster { if (nbt.contains("DrownedConversionTime", 99) && nbt.getInt("DrownedConversionTime") > -1) { this.startUnderWaterConversion(nbt.getInt("DrownedConversionTime")); } diff --git a/patches/unapplied/server/0287-Book-Size-Limits.patch b/patches/server/0279-Book-Size-Limits.patch similarity index 94% rename from patches/unapplied/server/0287-Book-Size-Limits.patch rename to patches/server/0279-Book-Size-Limits.patch index d29b1a238b..1fc906f4f5 100644 --- a/patches/unapplied/server/0287-Book-Size-Limits.patch +++ b/patches/server/0279-Book-Size-Limits.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Book Size Limits Puts some limits on the size of books. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f7529016db5d6f933d8f44de07bbdb9e67040cb1..b42b429e318b9ee784847a1824157573df99f683 100644 +index 5443a2713c957b23deb903baf7039b0220699095..a82a6e0381da86e5173a815e1a0160beb8927a1c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1024,6 +1024,45 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1046,6 +1046,45 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleEditBook(ServerboundEditBookPacket packet) { diff --git a/patches/unapplied/server/0288-Add-PlayerConnectionCloseEvent.patch b/patches/server/0280-Add-PlayerConnectionCloseEvent.patch similarity index 92% rename from patches/unapplied/server/0288-Add-PlayerConnectionCloseEvent.patch rename to patches/server/0280-Add-PlayerConnectionCloseEvent.patch index 4b002cb923..186f1c35db 100644 --- a/patches/unapplied/server/0288-Add-PlayerConnectionCloseEvent.patch +++ b/patches/server/0280-Add-PlayerConnectionCloseEvent.patch @@ -38,10 +38,10 @@ public net.minecraft.server.network.ServerLoginPacketListenerImpl$State public net.minecraft.server.network.ServerLoginPacketListenerImpl state diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 157f055df00faf3a7870df8109e84fdb12f55964..7648b889bc488197f32545e8c3671a54102c01ec 100644 +index 42c0723e2fe43e1f268119a16067e8bdfb971208..9885dec92cd26dec61c303dda687b0f910d49749 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -644,6 +644,26 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -680,6 +680,26 @@ public class Connection extends SimpleChannelInboundHandler> { packetlistener1.onDisconnect(ichatbasecomponent); } this.pendingActions.clear(); // Free up packet queue. @@ -69,15 +69,15 @@ index 157f055df00faf3a7870df8109e84fdb12f55964..7648b889bc488197f32545e8c3671a54 } } diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index e745061f3e6a4541f44ba119106915cdb7023fc6..f4ed58b03876c35f8964a8a1b8ce89961b9ee6d3 100644 +index 96a7d52f982d2dcc5fa391007e5861ca62ec0841..88dfd9d66fbd1583407814978a1fd68edd386519 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -60,7 +60,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -79,7 +79,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @Nullable String requestedUsername; @Nullable - private GameProfile authenticatedProfile; + public GameProfile authenticatedProfile; // Paper - public private final String serverId; + private final boolean transferred; private ServerPlayer player; // CraftBukkit - diff --git a/patches/unapplied/server/0289-Replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0281-Replace-OfflinePlayer-getLastPlayed.patch similarity index 88% rename from patches/unapplied/server/0289-Replace-OfflinePlayer-getLastPlayed.patch rename to patches/server/0281-Replace-OfflinePlayer-getLastPlayed.patch index 4d9db7b485..a741b07141 100644 --- a/patches/unapplied/server/0289-Replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/server/0281-Replace-OfflinePlayer-getLastPlayed.patch @@ -16,10 +16,10 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 08c936288b5ac8738d7cff9fe95b1256ae32cd28..a8de1f58fffe2541478083defc18be949d0c75f1 100644 +index 3b71ea8263b2049c54432a64c7f01aed3848d1c7..05379ea4581db4277e6cc625ed0f3228bd0130fd 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -248,6 +248,7 @@ public class ServerPlayer extends Player { +@@ -263,6 +263,7 @@ public class ServerPlayer extends Player { private int containerCounter; public boolean wonGame; private int containerUpdateDelay; // Paper - Configurable container update tick rate @@ -28,19 +28,19 @@ index 08c936288b5ac8738d7cff9fe95b1256ae32cd28..a8de1f58fffe2541478083defc18be94 public boolean queueHealthUpdatePacket; public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 7d81334b8bbfc04f1188de777b0cacd6f80131d3..2a0d3319899f0b3f38135e25306b87b1974b3d83 100644 +index 4dea09aa0f5f45d449ba12d8a9db3e0a3b708757..7112c6c77c5527f530223d5ffdf81c837a609b7c 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -180,6 +180,7 @@ public abstract class PlayerList { +@@ -182,6 +182,7 @@ public abstract class PlayerList { public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData) { player.isRealPlayer = true; // Paper + player.loginTime = System.currentTimeMillis(); // Paper - Replace OfflinePlayer#getLastPlayed GameProfile gameprofile = player.getGameProfile(); GameProfileCache usercache = this.server.getProfileCache(); - String s; + // Optional optional; // CraftBukkit - decompile error diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 34925d6448e0ef1d5bb4b24359f732b67aaa4230..0c1b5f625a351905e082b2c2a63bfd737101527e 100644 +index 461656e1cb095243bfe7a9ee2906e5b00574ae78..411b280ac3e27e72091db813c0c9b69b62df6097 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -262,6 +262,61 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa @@ -106,10 +106,10 @@ index 34925d6448e0ef1d5bb4b24359f732b67aaa4230..0c1b5f625a351905e082b2c2a63bfd73 public Location getLastDeathLocation() { if (this.getData().contains("LastDeathLocation", 10)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 29ede2405a645499e804a2f914a2563ef443f919..0e251c385db7969398eca95e3353de4a3de6d189 100644 +index 32bd55d8853cd1be12e910fc6626b96a6f3ea558..3ef95c7fb6bac4d79ecefd1f8591824258f84342 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -197,6 +197,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -207,6 +207,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener(); public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; // Paper - more resource pack API private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit @@ -117,7 +117,7 @@ index 29ede2405a645499e804a2f914a2563ef443f919..0e251c385db7969398eca95e3353de4a public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -1958,6 +1959,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2034,6 +2035,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.firstPlayed = firstPlayed; } @@ -136,7 +136,7 @@ index 29ede2405a645499e804a2f914a2563ef443f919..0e251c385db7969398eca95e3353de4a public void readExtraData(CompoundTag nbttagcompound) { this.hasPlayedBefore = true; if (nbttagcompound.contains("bukkit")) { -@@ -1980,6 +1993,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2056,6 +2069,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setExtraData(CompoundTag nbttagcompound) { @@ -145,7 +145,7 @@ index 29ede2405a645499e804a2f914a2563ef443f919..0e251c385db7969398eca95e3353de4a if (!nbttagcompound.contains("bukkit")) { nbttagcompound.put("bukkit", new CompoundTag()); } -@@ -1994,6 +2009,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2070,6 +2085,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { data.putLong("firstPlayed", this.getFirstPlayed()); data.putLong("lastPlayed", System.currentTimeMillis()); data.putString("lastKnownName", handle.getScoreboardName()); diff --git a/patches/unapplied/server/0290-Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/patches/server/0282-Workaround-for-vehicle-tracking-issue-on-disconnect.patch similarity index 86% rename from patches/unapplied/server/0290-Workaround-for-vehicle-tracking-issue-on-disconnect.patch rename to patches/server/0282-Workaround-for-vehicle-tracking-issue-on-disconnect.patch index 39521fc7b3..0b04379c7c 100644 --- a/patches/unapplied/server/0290-Workaround-for-vehicle-tracking-issue-on-disconnect.patch +++ b/patches/server/0282-Workaround-for-vehicle-tracking-issue-on-disconnect.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index a8de1f58fffe2541478083defc18be949d0c75f1..7433116ee68b92c86d1588296d521e5df49e5ac2 100644 +index 05379ea4581db4277e6cc625ed0f3228bd0130fd..e5d8384830c83694a3560fc743dc38e645cf9cfd 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1705,6 +1705,13 @@ public class ServerPlayer extends Player { +@@ -1789,6 +1789,13 @@ public class ServerPlayer extends Player { public void disconnect() { this.disconnected = true; this.ejectPassengers(); diff --git a/patches/unapplied/server/0291-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch b/patches/server/0283-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch similarity index 87% rename from patches/unapplied/server/0291-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch rename to patches/server/0283-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch index f7d93a4081..61009910db 100644 --- a/patches/unapplied/server/0291-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch +++ b/patches/server/0283-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch @@ -8,10 +8,10 @@ We just add a check to ensure that the CraftPlayer's handle is a ServerPlayer diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0e251c385db7969398eca95e3353de4a3de6d189..314e01920fe0302441d2cc08a0098ff8fee263e5 100644 +index 3ef95c7fb6bac4d79ecefd1f8591824258f84342..356d814e09c4804dc32e320c01c26f4a059693da 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -211,8 +211,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -221,8 +221,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void remove() { diff --git a/patches/unapplied/server/0292-BlockDestroyEvent.patch b/patches/server/0284-BlockDestroyEvent.patch similarity index 92% rename from patches/unapplied/server/0292-BlockDestroyEvent.patch rename to patches/server/0284-BlockDestroyEvent.patch index 9d61b5189f..01c3230ad6 100644 --- a/patches/unapplied/server/0292-BlockDestroyEvent.patch +++ b/patches/server/0284-BlockDestroyEvent.patch @@ -11,10 +11,10 @@ floating in the air. This can replace many uses of BlockPhysicsEvent diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 2eb80978ffc26c6250f3a96b73ee20bfea4ecd45..12809bc84aa07e724bebbc631199f352b7d7bbcb 100644 +index d050d72eb87a2d1b4723ab831dfef5e25c6a65b2..65b556d6ecae489c1c40b60d0eb432f4e1542e04 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -26,6 +26,7 @@ import net.minecraft.nbt.CompoundTag; +@@ -25,6 +25,7 @@ import net.minecraft.core.registries.Registries; import net.minecraft.network.protocol.Packet; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; @@ -22,7 +22,7 @@ index 2eb80978ffc26c6250f3a96b73ee20bfea4ecd45..12809bc84aa07e724bebbc631199f352 import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.FullChunkStatus; import net.minecraft.server.level.ServerLevel; -@@ -582,9 +583,26 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -576,9 +577,26 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return false; } else { FluidState fluid = this.getFluidState(pos); diff --git a/patches/unapplied/server/0293-Async-command-map-building.patch b/patches/server/0285-Async-command-map-building.patch similarity index 90% rename from patches/unapplied/server/0293-Async-command-map-building.patch rename to patches/server/0285-Async-command-map-building.patch index 65ec9bb537..10b3d48f56 100644 --- a/patches/unapplied/server/0293-Async-command-map-building.patch +++ b/patches/server/0285-Async-command-map-building.patch @@ -9,10 +9,10 @@ commands if the server is restarting. Using the default async pool caused issues due to the shutdown logic generally being much later. diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 15a5059994371da4850adcf726034a715b80efba..af7cb518a32a4d550eae833fdd5bb17fd4058717 100644 +index 03966f447354fb16a01442ff6c6257fa19461bcd..6383cdfe3e2b61314fee7f7236dc7df1c1e8bfb6 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -457,6 +457,24 @@ public class Commands { +@@ -460,6 +460,24 @@ public class Commands { if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot // CraftBukkit start // Register Vanilla commands into builtRoot as before @@ -37,7 +37,7 @@ index 15a5059994371da4850adcf726034a715b80efba..af7cb518a32a4d550eae833fdd5bb17f Map, CommandNode> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues RootCommandNode vanillaRoot = new RootCommandNode(); -@@ -474,7 +492,14 @@ public class Commands { +@@ -477,7 +495,14 @@ public class Commands { for (CommandNode node : rootcommandnode.getChildren()) { bukkit.add(node.getName()); } @@ -53,10 +53,10 @@ index 15a5059994371da4850adcf726034a715b80efba..af7cb518a32a4d550eae833fdd5bb17f event.getPlayer().getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 01acf93115db41212adf703d44481f50c746a8fa..3d59c9f256f00c213af33c35cd6471a78b97c290 100644 +index 34e5adcbeb105e6da8ab660d7f322969305d44ec..270ec206c0dd3183db8f81241d7b87087681c80c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -916,6 +916,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { runSync(player, bukkit, rootcommandnode); }); -@@ -500,6 +501,7 @@ public class Commands { +@@ -503,6 +504,7 @@ public class Commands { private void runSync(ServerPlayer player, Collection bukkit, RootCommandNode rootcommandnode) { // Paper end - Perf: Async command map building @@ -118,7 +118,7 @@ index af7cb518a32a4d550eae833fdd5bb17fd4058717..40ff3090fb17fb0f01a9b52639fb783e PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit)); event.getPlayer().getServer().getPluginManager().callEvent(event); -@@ -518,6 +520,11 @@ public class Commands { +@@ -521,6 +523,11 @@ public class Commands { while (iterator.hasNext()) { CommandNode commandnode2 = (CommandNode) iterator.next(); @@ -131,10 +131,10 @@ index af7cb518a32a4d550eae833fdd5bb17fd4058717..40ff3090fb17fb0f01a9b52639fb783e if (commandnode2.canUse(source)) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b42b429e318b9ee784847a1824157573df99f683..9e7598a0cc3965e382ba13d7fd700585a4884a97 100644 +index a82a6e0381da86e5173a815e1a0160beb8927a1c..ba6944eb4602549ef139a427788f8175ce912677 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -746,7 +746,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -772,19 +772,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl builder.suggest(completion.suggestion(), PaperAdventure.asVanilla(completion.tooltip())); } } @@ -144,23 +144,31 @@ index b42b429e318b9ee784847a1824157573df99f683..9e7598a0cc3965e382ba13d7fd700585 + com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getCraftPlayer(), suggestions, packet.getCommand()); + suggestEvent.setCancelled(suggestions.isEmpty()); + if (suggestEvent.callEvent()) { -+ this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions())); ++ this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), limitTo(suggestEvent.getSuggestions(), ServerGamePacketListenerImpl.MAX_COMMAND_SUGGESTIONS))); + } + // Paper end - Brigadier API } } ++ // Paper start - brig API ++ private static Suggestions limitTo(final Suggestions suggestions, final int size) { ++ return suggestions.getList().size() <= size ? suggestions : new Suggestions(suggestions.getRange(), suggestions.getList().subList(0, size)); ++ } ++ // Paper end - brig API -@@ -755,8 +762,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + private void sendServerSuggestions(final ServerboundCommandSuggestionPacket packet, final StringReader stringreader) { + // Paper end - AsyncTabCompleteEvent ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { - if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer -- this.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions)); +- Suggestions suggestions1 = suggestions.getList().size() <= 1000 ? suggestions : new Suggestions(suggestions.getRange(), suggestions.getList().subList(0, 1000)); +- +- this.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions1)); + // Paper start - Brigadier API + com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getCraftPlayer(), suggestions, packet.getCommand()); + suggestEvent.setCancelled(suggestions.isEmpty()); + if (suggestEvent.callEvent()) { -+ this.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions())); ++ this.send(new ClientboundCommandSuggestionsPacket(packet.getId(), limitTo(suggestEvent.getSuggestions(), ServerGamePacketListenerImpl.MAX_COMMAND_SUGGESTIONS))); + } + // Paper end - Brigadier API }); diff --git a/patches/unapplied/server/0295-Improve-exact-choice-recipe-ingredients.patch b/patches/server/0287-Improve-exact-choice-recipe-ingredients.patch similarity index 86% rename from patches/unapplied/server/0295-Improve-exact-choice-recipe-ingredients.patch rename to patches/server/0287-Improve-exact-choice-recipe-ingredients.patch index 40cf56721d..99b2e8b822 100644 --- a/patches/unapplied/server/0295-Improve-exact-choice-recipe-ingredients.patch +++ b/patches/server/0287-Improve-exact-choice-recipe-ingredients.patch @@ -48,7 +48,7 @@ index 0000000000000000000000000000000000000000..2a2f8327a5bd3983a3a13fd663beb989 +} diff --git a/src/main/java/io/papermc/paper/inventory/recipe/StackedContentsExtraMap.java b/src/main/java/io/papermc/paper/inventory/recipe/StackedContentsExtraMap.java new file mode 100644 -index 0000000000000000000000000000000000000000..63db0b843c5bd11f979e613ba6cfac9d9da956bb +index 0000000000000000000000000000000000000000..2258d4556a1c608e2b0ece38471350646718eb19 --- /dev/null +++ b/src/main/java/io/papermc/paper/inventory/recipe/StackedContentsExtraMap.java @@ -0,0 +1,79 @@ @@ -93,7 +93,7 @@ index 0000000000000000000000000000000000000000..63db0b843c5bd11f979e613ba6cfac9d + final IntList idList = new IntArrayList(items.length); + for (final ItemStack item : items) { + idList.add(this.registerExact(item)); // I think not copying the stack here is safe because cb copies the stack when creating the ingredient -+ if (!item.hasTag()) { ++ if (item.getComponentsPatch().isEmpty()) { + // add regular index if it's a plain itemstack but still registered as exact + idList.add(StackedContents.getStackingIndex(item)); + } @@ -143,7 +143,7 @@ index 0000000000000000000000000000000000000000..413dfa52760db393ad6a8b5341200ee7 +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.framework.qual.DefaultQualifier; diff --git a/src/main/java/net/minecraft/recipebook/ServerPlaceRecipe.java b/src/main/java/net/minecraft/recipebook/ServerPlaceRecipe.java -index f7328e583c63b4b74664ea78110f8b71c635ce60..80f032cca3309b709a11898cbc08bce27cbd624d 100644 +index fc97748870f2cddea5d5b3afed756d6383fecfa8..5c5a4b4450301cd3bc7c895f976b991467234a42 100644 --- a/src/main/java/net/minecraft/recipebook/ServerPlaceRecipe.java +++ b/src/main/java/net/minecraft/recipebook/ServerPlaceRecipe.java @@ -34,6 +34,7 @@ public class ServerPlaceRecipe implements PlaceRecipe implements PlaceRecipe implements PlaceRecipe inputs, int slot, int amount, int gridX, int gridY) { Slot slot2 = this.menu.getSlot(slot); @@ -187,7 +187,7 @@ index f7328e583c63b4b74664ea78110f8b71c635ce60..80f032cca3309b709a11898cbc08bce2 } } } -@@ -128,8 +140,14 @@ public class ServerPlaceRecipe implements PlaceRecipe implements PlaceRecipe= BuiltInRegistries.ITEM.size()) { -+ return fromStackingIndexExtras(itemId, contents.extrasMap).getMaxStackSize(); ++ return fromStackingIndexExtras(itemId, contents.extrasMap); + } -+ return fromStackingIndex(itemId).getMaxStackSize(); ++ return fromStackingIndex(itemId); + } + + public static ItemStack fromStackingIndexExtras(final int itemId, final io.papermc.paper.inventory.recipe.StackedContentsExtraMap extrasMap) { @@ -250,7 +250,7 @@ index a3a7bfaf5d21a50410017c8d17484ef5a409d68a..33e493874cb8cecd820e80f2c15e6f65 public void clear() { this.contents.clear(); } -@@ -105,7 +125,7 @@ public class StackedContents { +@@ -106,7 +126,7 @@ public class StackedContents { this.data = new BitSet(this.ingredientCount + this.itemCount + this.ingredientCount + this.ingredientCount * this.itemCount); for (int i = 0; i < this.ingredients.size(); i++) { @@ -259,7 +259,7 @@ index a3a7bfaf5d21a50410017c8d17484ef5a409d68a..33e493874cb8cecd820e80f2c15e6f65 for (int j = 0; j < this.itemCount; j++) { if (intList.contains(this.items[j])) { -@@ -168,7 +188,7 @@ public class StackedContents { +@@ -169,7 +189,7 @@ public class StackedContents { IntCollection intCollection = new IntAVLTreeSet(); for (Ingredient ingredient : this.ingredients) { @@ -268,7 +268,7 @@ index a3a7bfaf5d21a50410017c8d17484ef5a409d68a..33e493874cb8cecd820e80f2c15e6f65 } IntIterator intIterator = intCollection.iterator(); -@@ -297,7 +317,7 @@ public class StackedContents { +@@ -298,7 +318,7 @@ public class StackedContents { for (Ingredient ingredient : this.ingredients) { int j = 0; @@ -277,7 +277,7 @@ index a3a7bfaf5d21a50410017c8d17484ef5a409d68a..33e493874cb8cecd820e80f2c15e6f65 j = Math.max(j, StackedContents.this.contents.get(k)); } -@@ -308,5 +328,17 @@ public class StackedContents { +@@ -309,5 +329,17 @@ public class StackedContents { return i; } @@ -296,7 +296,7 @@ index a3a7bfaf5d21a50410017c8d17484ef5a409d68a..33e493874cb8cecd820e80f2c15e6f65 } } diff --git a/src/main/java/net/minecraft/world/item/crafting/AbstractCookingRecipe.java b/src/main/java/net/minecraft/world/item/crafting/AbstractCookingRecipe.java -index 7fe2389df3f033da60ec246937f67662355d3715..2a99d6b9c5c0bed7c971303cff82f84303184bca 100644 +index 3b55a36192f75fafcf2f37727d891b461ca494a1..e037647ea39c5ecc566a9198bb77fecc0ed3f997 100644 --- a/src/main/java/net/minecraft/world/item/crafting/AbstractCookingRecipe.java +++ b/src/main/java/net/minecraft/world/item/crafting/AbstractCookingRecipe.java @@ -6,7 +6,7 @@ import net.minecraft.world.Container; @@ -317,10 +317,10 @@ index 7fe2389df3f033da60ec246937f67662355d3715..2a99d6b9c5c0bed7c971303cff82f843 @Override diff --git a/src/main/java/net/minecraft/world/item/crafting/Recipe.java b/src/main/java/net/minecraft/world/item/crafting/Recipe.java -index 8b631e457f783e55b7c37dd915b699912a9c5b49..e2d6c8ed586ef429cc712139e501df696ed10f6e 100644 +index 5ccc99f8a64503db4478662f31a035b1ca7daade..b975bd02087ee40fc9d35ebd99b7730bb26ef6b2 100644 --- a/src/main/java/net/minecraft/world/item/crafting/Recipe.java +++ b/src/main/java/net/minecraft/world/item/crafting/Recipe.java -@@ -69,4 +69,10 @@ public interface Recipe { +@@ -74,4 +74,10 @@ public interface Recipe { } org.bukkit.inventory.Recipe toBukkitRecipe(org.bukkit.NamespacedKey id); // CraftBukkit @@ -332,10 +332,10 @@ index 8b631e457f783e55b7c37dd915b699912a9c5b49..e2d6c8ed586ef429cc712139e501df69 + // Paper end } diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java -index 201897bbde809699b53617e09703f5b22bbbe938..d772cf80fa3831e1c79d601ea09a073da089e2c5 100644 +index 22f8396b438a0ca4532190e1a27f0f5ad77832c5..482d7b12b80328fba97a01bcfeb974b7ac4bcdb7 100644 --- a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java +++ b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java -@@ -17,7 +17,7 @@ import org.bukkit.craftbukkit.inventory.CraftShapedRecipe; +@@ -18,7 +18,7 @@ import org.bukkit.craftbukkit.inventory.CraftShapedRecipe; import org.bukkit.inventory.RecipeChoice; // CraftBukkit end @@ -344,7 +344,7 @@ index 201897bbde809699b53617e09703f5b22bbbe938..d772cf80fa3831e1c79d601ea09a073d final ShapedRecipePattern pattern; final ItemStack result; -@@ -31,6 +31,7 @@ public class ShapedRecipe implements CraftingRecipe { +@@ -32,6 +32,7 @@ public class ShapedRecipe implements CraftingRecipe { this.pattern = raw; this.result = result; this.showNotification = showNotification; @@ -353,10 +353,10 @@ index 201897bbde809699b53617e09703f5b22bbbe938..d772cf80fa3831e1c79d601ea09a073d 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 870e07140d835feaa55808101722d4547d5021d0..27b0a79f7a7c47047216aae42944bac2a2151181 100644 +index 5d58922c0953b997ad7f2a174e2ca60f81789305..3554109bcc4651ca93b6275c914e57e007e2204e 100644 --- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java +++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java -@@ -20,7 +20,7 @@ import org.bukkit.craftbukkit.inventory.CraftRecipe; +@@ -21,7 +21,7 @@ import org.bukkit.craftbukkit.inventory.CraftRecipe; import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe; // CraftBukkit end @@ -365,7 +365,7 @@ index 870e07140d835feaa55808101722d4547d5021d0..27b0a79f7a7c47047216aae42944bac2 final String group; final CraftingBookCategory category; -@@ -32,6 +32,7 @@ public class ShapelessRecipe implements CraftingRecipe { +@@ -33,6 +33,7 @@ public class ShapelessRecipe implements CraftingRecipe { this.category = category; this.result = result; this.ingredients = ingredients; @@ -373,7 +373,7 @@ index 870e07140d835feaa55808101722d4547d5021d0..27b0a79f7a7c47047216aae42944bac2 } // CraftBukkit start -@@ -77,6 +78,7 @@ public class ShapelessRecipe implements CraftingRecipe { +@@ -78,6 +79,7 @@ public class ShapelessRecipe implements CraftingRecipe { public boolean matches(CraftingContainer inventory, Level world) { StackedContents autorecipestackmanager = new StackedContents(); diff --git a/patches/unapplied/server/0296-Limit-Client-Sign-length-more.patch b/patches/server/0288-Limit-Client-Sign-length-more.patch similarity index 92% rename from patches/unapplied/server/0296-Limit-Client-Sign-length-more.patch rename to patches/server/0288-Limit-Client-Sign-length-more.patch index 85eb7ca58c..9449d59d41 100644 --- a/patches/unapplied/server/0296-Limit-Client-Sign-length-more.patch +++ b/patches/server/0288-Limit-Client-Sign-length-more.patch @@ -22,10 +22,10 @@ it only impacts data sent from the client. Set -DPaper.maxSignLength=XX to change limit or -1 to disable diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9e7598a0cc3965e382ba13d7fd700585a4884a97..6d540917d0d4f4787e9abc8c80fd797b2ec1656f 100644 +index ba6944eb4602549ef139a427788f8175ce912677..eae6e3aeaca1b567698eaa05ed02c6c45717d7f6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -290,6 +290,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -300,6 +300,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private final MessageSignatureCache messageSignatureCache = MessageSignatureCache.createDefault(); private final FutureChain chatMessageChain; private boolean waitingForSwitchToConfig; @@ -33,7 +33,7 @@ index 9e7598a0cc3965e382ba13d7fd700585a4884a97..6d540917d0d4f4787e9abc8c80fd797b public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player, CommonListenerCookie clientData) { super(server, connection, clientData, player); // CraftBukkit -@@ -3059,7 +3060,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3144,7 +3145,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleSignUpdate(ServerboundSignUpdatePacket packet) { diff --git a/patches/unapplied/server/0297-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/patches/server/0289-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch similarity index 83% rename from patches/unapplied/server/0297-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch rename to patches/server/0289-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch index 406e5f78c6..5209c894e2 100644 --- a/patches/unapplied/server/0297-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch +++ b/patches/server/0289-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 2a0d3319899f0b3f38135e25306b87b1974b3d83..28b81e29be07902ad4d04aeb18bffd49757c3029 100644 +index 7112c6c77c5527f530223d5ffdf81c837a609b7c..f29cd4d7c528404ea8e77e82a5ae17a9d9d19ed5 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1158,6 +1158,7 @@ public abstract class PlayerList { +@@ -1157,6 +1157,7 @@ public abstract class PlayerList { } public void setUsingWhiteList(boolean whitelistEnabled) { diff --git a/patches/unapplied/server/0298-Entity-getEntitySpawnReason.patch b/patches/server/0290-Entity-getEntitySpawnReason.patch similarity index 81% rename from patches/unapplied/server/0298-Entity-getEntitySpawnReason.patch rename to patches/server/0290-Entity-getEntitySpawnReason.patch index aee2a0bbb9..5d83fc3627 100644 --- a/patches/unapplied/server/0298-Entity-getEntitySpawnReason.patch +++ b/patches/server/0290-Entity-getEntitySpawnReason.patch @@ -10,7 +10,7 @@ persistenting Living Entity, SPAWNER for spawners, or DEFAULT since data was not stored. diff --git a/src/main/java/net/minecraft/server/commands/SummonCommand.java b/src/main/java/net/minecraft/server/commands/SummonCommand.java -index 2eddeb8d5239bbfeefbf4d3bd363f1ad083299b6..e2b44b8ddb8afc6e1f7dddadb434c2268f284809 100644 +index bf72cf288ade52ee8cc41ca978f368b3ad575951..798999be50d26be357ef3c6d5b9383ce4d1048c1 100644 --- a/src/main/java/net/minecraft/server/commands/SummonCommand.java +++ b/src/main/java/net/minecraft/server/commands/SummonCommand.java @@ -57,6 +57,7 @@ public class SummonCommand { @@ -22,10 +22,10 @@ index 2eddeb8d5239bbfeefbf4d3bd363f1ad083299b6..e2b44b8ddb8afc6e1f7dddadb434c226 }); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 0811a2e87192b46c39f54c26ce0e56fc6e9d87e5..57f129651778d6c20c695bf7b3a8b4d40c402a20 100644 +index ce89f04b74e579dedae05cfdf681827a92626f9a..e008b0b1b04dd8da118be6ee0bdd05c146a97532 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1203,6 +1203,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1209,6 +1209,7 @@ public class ServerLevel extends Level implements WorldGenLevel { return true; } // Paper end - extra debug info @@ -34,10 +34,10 @@ index 0811a2e87192b46c39f54c26ce0e56fc6e9d87e5..57f129651778d6c20c695bf7b3a8b4d4 // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit return false; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 28b81e29be07902ad4d04aeb18bffd49757c3029..bc440f9a239d3935bf6837edf815d4fdc6093655 100644 +index f29cd4d7c528404ea8e77e82a5ae17a9d9d19ed5..7d4b2c499dfe449e6f7116ae140535450b95e6d1 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -224,6 +224,11 @@ public abstract class PlayerList { +@@ -223,6 +223,11 @@ public abstract class PlayerList { worldserver1 = worldserver; } @@ -50,19 +50,19 @@ index 28b81e29be07902ad4d04aeb18bffd49757c3029..bc440f9a239d3935bf6837edf815d4fd String s1 = connection.getLoggableAddress(this.server.logIPs()); @@ -355,7 +360,7 @@ public abstract class PlayerList { - // CraftBukkit start - ServerLevel finalWorldServer = worldserver1; - Entity entity = EntityType.loadEntityRecursive(nbttagcompound1.getCompound("Entity"), finalWorldServer, (entity1) -> { -- return !finalWorldServer.addWithUUID(entity1) ? null : entity1; -+ return !finalWorldServer.addWithUUID(entity1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.MOUNT) ? null : entity1; // Paper - Entity#getEntitySpawnReason - // CraftBukkit end + CompoundTag nbttagcompound = ((CompoundTag) optional.get()).getCompound("RootVehicle"); + ServerLevel finalWorldServer = worldserver1; // CraftBukkit - decompile error + Entity entity = EntityType.loadEntityRecursive(nbttagcompound.getCompound("Entity"), worldserver1, (entity1) -> { +- return !finalWorldServer.addWithUUID(entity1) ? null : entity1; // CraftBukkit - decompile error ++ return !finalWorldServer.addWithUUID(entity1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.MOUNT) ? null : entity1; // CraftBukkit - decompile error // Paper - Entity#getEntitySpawnReason }); + if (entity != null) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f746829f1e94ee58821e56ec4192269add00395b..257be4dd3f38c089dd970b9ac6f292b4f010a01c 100644 +index 28708e1e8ade8fbfec24120478d250ddf1351bf4..ce2594baa8eb5cfff75a2fb9f3277676a7b08e18 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -238,6 +238,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -241,6 +241,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } // Paper end - Share random for entities to make them more random @@ -70,7 +70,7 @@ index f746829f1e94ee58821e56ec4192269add00395b..257be4dd3f38c089dd970b9ac6f292b4 public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper private CraftEntity bukkitEntity; -@@ -2178,6 +2179,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2206,6 +2207,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } nbttagcompound.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ())); } @@ -80,7 +80,7 @@ index f746829f1e94ee58821e56ec4192269add00395b..257be4dd3f38c089dd970b9ac6f292b4 // Save entity's from mob spawner status if (spawnedViaMobSpawner) { nbttagcompound.putBoolean("Paper.FromMobSpawner", true); -@@ -2324,6 +2328,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2352,6 +2356,26 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status @@ -108,10 +108,10 @@ index f746829f1e94ee58821e56ec4192269add00395b..257be4dd3f38c089dd970b9ac6f292b4 } catch (Throwable throwable) { diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index cae8c508972d771ad96228ace8a7e6cbc34d5489..3184f73ce799cc5202d2129be736e2fed9a3b8e3 100644 +index ee897b8c9462dbb3d7be9a2994753155065ce205..1d0964a7f544735a0213d5c7832c71f53db139a9 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java -@@ -182,6 +182,7 @@ public abstract class BaseSpawner { +@@ -191,6 +191,7 @@ public abstract class BaseSpawner { } entity.spawnedViaMobSpawner = true; // Paper @@ -120,10 +120,10 @@ index cae8c508972d771ad96228ace8a7e6cbc34d5489..3184f73ce799cc5202d2129be736e2fe // CraftBukkit start if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java -index 41fa4258fbdd2f887383b9d3def10466557c406c..d71a9fb54269f7c7e251e0e3bdd8b5a072af5201 100644 +index 570957f00ad4817d5631c72060e85f85af634619..baa876db3a58a3c756a72ef1ad081964b358f58e 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java -@@ -181,7 +181,7 @@ public class SculkShriekerBlockEntity extends BlockEntity implements GameEventLi +@@ -183,7 +183,7 @@ public class SculkShriekerBlockEntity extends BlockEntity implements GameEventLi private boolean trySummonWarden(ServerLevel world) { return this.warningLevel >= 4 @@ -133,10 +133,10 @@ index 41fa4258fbdd2f887383b9d3def10466557c406c..d71a9fb54269f7c7e251e0e3bdd8b5a0 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 6fddbcec673564ac531a852f631f6acc460accbd..9ed122efb2b380bb2c1b50fdfe75bf3e679c9c6e 100644 +index 621970006f21d219784dc58d7aa8d6062c4620f1..571b8352de4070622cdc47a50643beada0b16c36 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -991,4 +991,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1001,4 +1001,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return this.getHandle().spawnedViaMobSpawner; } // Paper end - Entity#fromMobSpawner diff --git a/patches/unapplied/server/0299-Fire-event-on-GS4-query.patch b/patches/server/0291-Fire-event-on-GS4-query.patch similarity index 100% rename from patches/unapplied/server/0299-Fire-event-on-GS4-query.patch rename to patches/server/0291-Fire-event-on-GS4-query.patch diff --git a/patches/unapplied/server/0300-Add-PlayerPostRespawnEvent.patch b/patches/server/0292-Add-PlayerPostRespawnEvent.patch similarity index 87% rename from patches/unapplied/server/0300-Add-PlayerPostRespawnEvent.patch rename to patches/server/0292-Add-PlayerPostRespawnEvent.patch index 15c48ae0e1..47998f679c 100644 --- a/patches/unapplied/server/0300-Add-PlayerPostRespawnEvent.patch +++ b/patches/server/0292-Add-PlayerPostRespawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerPostRespawnEvent diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index bc440f9a239d3935bf6837edf815d4fdc6093655..6bd83549e2ff84b1bc993ef2be79a336ced28f67 100644 +index 7d4b2c499dfe449e6f7116ae140535450b95e6d1..03051e2252d7b871adc06dbbe48d2a90854c7adf 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -752,9 +752,14 @@ public abstract class PlayerList { +@@ -751,9 +751,14 @@ public abstract class PlayerList { boolean flag2 = false; @@ -24,7 +24,7 @@ index bc440f9a239d3935bf6837edf815d4fdc6093655..6bd83549e2ff84b1bc993ef2be79a336 ServerLevel worldserver1 = this.server.getLevel(entityplayer.getRespawnDimension()); if (worldserver1 != null) { Optional optional; -@@ -806,6 +811,7 @@ public abstract class PlayerList { +@@ -805,6 +810,7 @@ public abstract class PlayerList { location = respawnEvent.getRespawnLocation(); if (!flag) entityplayer.reset(); // SPIGOT-4785 @@ -32,7 +32,7 @@ index bc440f9a239d3935bf6837edf815d4fdc6093655..6bd83549e2ff84b1bc993ef2be79a336 } else { location.setWorld(worldserver.getWorld()); } -@@ -864,6 +870,13 @@ public abstract class PlayerList { +@@ -863,6 +869,13 @@ public abstract class PlayerList { if (entityplayer.connection.isDisconnected()) { this.save(entityplayer); } diff --git a/patches/unapplied/server/0301-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/patches/server/0293-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch similarity index 86% rename from patches/unapplied/server/0301-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch rename to patches/server/0293-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch index e83c1e11e6..f94771a112 100644 --- a/patches/unapplied/server/0301-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch +++ b/patches/server/0293-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch @@ -6,10 +6,10 @@ Subject: [PATCH] don't go below 0 for pickupDelay, breaks picking up items vanilla checks for == 0 diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index d568726f80308e29bcfa3714728096d7d0aa822c..bfbbb9382cf483a23acf35c17250f6f9223f7507 100644 +index d97e12a2dca072ae102b029fb67472dacc2c5b40..f0e6375236d61f32235ed23c3bae49db1545d1a2 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -141,6 +141,7 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -148,6 +148,7 @@ public class ItemEntity extends Entity implements TraceableEntity { // CraftBukkit start - Use wall time for pickup and despawn timers int elapsedTicks = MinecraftServer.currentTick - this.lastTick; if (this.pickupDelay != 32767) this.pickupDelay -= elapsedTicks; @@ -17,7 +17,7 @@ index d568726f80308e29bcfa3714728096d7d0aa822c..bfbbb9382cf483a23acf35c17250f6f9 if (this.age != -32768) this.age += elapsedTicks; this.lastTick = MinecraftServer.currentTick; // CraftBukkit end -@@ -227,6 +228,7 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -233,6 +234,7 @@ public class ItemEntity extends Entity implements TraceableEntity { // CraftBukkit start - Use wall time for pickup and despawn timers int elapsedTicks = MinecraftServer.currentTick - this.lastTick; if (this.pickupDelay != 32767) this.pickupDelay -= elapsedTicks; diff --git a/patches/unapplied/server/0302-Server-Tick-Events.patch b/patches/server/0294-Server-Tick-Events.patch similarity index 86% rename from patches/unapplied/server/0302-Server-Tick-Events.patch rename to patches/server/0294-Server-Tick-Events.patch index 8402df699f..33e351aae3 100644 --- a/patches/unapplied/server/0302-Server-Tick-Events.patch +++ b/patches/server/0294-Server-Tick-Events.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Server Tick Events Fires event at start and end of a server tick diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3d59c9f256f00c213af33c35cd6471a78b97c290..176378ddbf21d758694e8e624cc6c555c78e0fab 100644 +index 270ec206c0dd3183db8f81241d7b87087681c80c..fbe459664f93ec9d314cd305f1e3857710191cfd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1357,6 +1357,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop(nms.slotDropChances().entrySet().stream().collect(Collectors.toMap((entry) -> CraftEquipmentSlot.getSlot(entry.getKey()), Map.Entry::getValue))) + )).orElse(null); } + + // Paper start diff --git a/patches/unapplied/server/0307-Fix-CB-call-to-changed-postToMainThread-method.patch b/patches/server/0299-Fix-CB-call-to-changed-postToMainThread-method.patch similarity index 85% rename from patches/unapplied/server/0307-Fix-CB-call-to-changed-postToMainThread-method.patch rename to patches/server/0299-Fix-CB-call-to-changed-postToMainThread-method.patch index 1571598444..a3ee37d8c6 100644 --- a/patches/unapplied/server/0307-Fix-CB-call-to-changed-postToMainThread-method.patch +++ b/patches/server/0299-Fix-CB-call-to-changed-postToMainThread-method.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix CB call to changed postToMainThread method diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index d0f89a66734423ceea67fbeb99b0e72797f80e63..e69043316372d98b122ed3788fda79cdd36849e8 100644 +index 89c05909c10ef5172693c5d9d8fdf7e6efead53b..96b5e033aab4e1ee090af77a871e643dbf6300a4 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -@@ -310,7 +310,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -355,7 +355,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack Objects.requireNonNull(this.connection); // CraftBukkit - Don't wait diff --git a/patches/unapplied/server/0308-Fix-sounds-when-item-frames-are-modified-MC-123450.patch b/patches/server/0300-Fix-sounds-when-item-frames-are-modified-MC-123450.patch similarity index 85% rename from patches/unapplied/server/0308-Fix-sounds-when-item-frames-are-modified-MC-123450.patch rename to patches/server/0300-Fix-sounds-when-item-frames-are-modified-MC-123450.patch index 76b1e55348..8e45f027aa 100644 --- a/patches/unapplied/server/0308-Fix-sounds-when-item-frames-are-modified-MC-123450.patch +++ b/patches/server/0300-Fix-sounds-when-item-frames-are-modified-MC-123450.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix sounds when item frames are modified (MC-123450) This also fixes the adding sound playing when the item frame direction is changed. diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -index f90878e0449f39f66ae3a7036a65c374b36b7dbc..5c507b1160835fd4beb3b2d5b621250540545d4e 100644 +index d4f498789ae1d93533f058b0ce4981eed1ce8ea2..5a0658932cc45c49c9285b1419d574dd83041732 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -@@ -326,7 +326,7 @@ public class ItemFrame extends HangingEntity { +@@ -313,7 +313,7 @@ public class ItemFrame extends HangingEntity { this.onItemChanged(itemstack); this.getEntityData().set(ItemFrame.DATA_ITEM, itemstack); diff --git a/patches/unapplied/server/0309-Implement-CraftBlockSoundGroup.patch b/patches/server/0301-Implement-CraftBlockSoundGroup.patch similarity index 100% rename from patches/unapplied/server/0309-Implement-CraftBlockSoundGroup.patch rename to patches/server/0301-Implement-CraftBlockSoundGroup.patch diff --git a/patches/unapplied/server/0264-Configurable-connection-throttle-kick-message.patch b/patches/unapplied/server/0264-Configurable-connection-throttle-kick-message.patch deleted file mode 100644 index d14ef13eaa..0000000000 --- a/patches/unapplied/server/0264-Configurable-connection-throttle-kick-message.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Tue, 2 Oct 2018 09:57:50 +0100 -Subject: [PATCH] Configurable connection throttle kick message - - -diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index 3dfec4462d85f3223071b4e78465587db6185f0d..08a7461a92ae84cac69e4bb57a099d1f35ff1c1a 100644 ---- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -@@ -51,7 +51,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL - synchronized (ServerHandshakePacketListenerImpl.throttleTracker) { - if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) { - ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime); -- MutableComponent chatmessage = Component.literal("Connection throttled! Please wait before reconnecting."); -+ Component chatmessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.connectionThrottle); // Paper - Configurable connection throttle kick message - this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage)); - this.connection.disconnect(chatmessage); - return; diff --git a/patches/unapplied/server/0259-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch b/removed-patches-1-20-5/0259-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch similarity index 100% rename from patches/unapplied/server/0259-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch rename to removed-patches-1-20-5/0259-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch diff --git a/patches/unapplied/server/0284-Handle-Large-Packets-disconnecting-client.patch b/removed-patches-1-20-5/0284-Handle-Large-Packets-disconnecting-client.patch similarity index 100% rename from patches/unapplied/server/0284-Handle-Large-Packets-disconnecting-client.patch rename to removed-patches-1-20-5/0284-Handle-Large-Packets-disconnecting-client.patch diff --git a/patches/unapplied/server/0310-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/removed-patches-1-20-5/0310-Configurable-Keep-Spawn-Loaded-range-per-world.patch similarity index 100% rename from patches/unapplied/server/0310-Configurable-Keep-Spawn-Loaded-range-per-world.patch rename to removed-patches-1-20-5/0310-Configurable-Keep-Spawn-Loaded-range-per-world.patch