From 0a91b13eb3ab3404b18835d75192a7dcec1335ab Mon Sep 17 00:00:00 2001
From: Bjarne Koll <git@lynxplay.dev>
Date: Wed, 23 Oct 2024 19:46:06 +0200
Subject: [PATCH] 503

---
 .../server/Add-Block-isValidTool.patch        |  0
 .../server/Add-BlockPreDispenseEvent.patch    |  2 +-
 .../server/Add-DragonEggFormEvent.patch       |  0
 .../server/Add-EntityMoveEvent.patch          | 12 ++--
 .../Add-PlayerChangeBeaconEffectEvent.patch   |  0
 .../server/Add-PlayerNameEntityEvent.patch    |  2 +-
 ...d-PlayerStonecutterRecipeSelectEvent.patch | 19 ++++--
 ...gistryAccess-for-managing-Registries.patch | 64 +++++++++----------
 .../server/Add-StructuresLocateEvent.patch    |  0
 ...lternative-constructor-for-Rotations.patch |  0
 ...ainThreadExecutor-to-BukkitScheduler.patch |  0
 .../server/Add-recipe-to-cook-events.patch    | 10 +--
 .../server/Add-sendOpLevel-API.patch          |  0
 ...le-for-always-placing-the-dragon-egg.patch |  0
 .../server/Add-worldborder-events.patch       |  0
 ...w-adding-items-to-BlockDropItemEvent.patch |  0
 ...-using-signs-inside-spawn-protection.patch |  7 +-
 ...n-for-requiring-a-player-participant.patch | 24 +++----
 .../Configurable-max-leash-distance.patch     |  0
 ...ignore-result-of-PlayerEditBookEvent.patch |  0
 ...ed-item-when-player-has-disconnected.patch |  0
 ...tab-completions-for-brigadier-comman.patch |  0
 .../server/Expand-EntityUnleashEvent.patch    |  9 ++-
 .../server/Expand-world-key-API.patch         |  0
 .../server/Expose-Tracked-Players.patch       |  0
 .../server/Expose-protocol-version.patch      |  0
 ...ItemConsumeEvent-cancelling-properly.patch |  4 +-
 .../server/Fix-villager-boat-exploit.patch    |  0
 .../server/Improve-ServerGUI.patch            |  0
 .../Inline-shift-direction-fields.patch       |  2 +-
 .../Make-schedule-command-per-world.patch     |  2 +-
 ...ipes-should-return-an-immutable-list.patch |  0
 .../server/Remove-stale-POIs.patch            |  2 +-
 ...-shield-blocking-on-dimension-change.patch |  0
 ...onent-with-empty-text-instead-of-thr.patch |  0
 ...disable-pathfinding-updates-on-block.patch |  4 +-
 .../fix-converting-txt-to-json-file.patch     |  0
 ...fix-dead-slime-setSize-invincibility.patch |  0
 ...telist-use-configurable-kick-message.patch |  0
 ...-entity-allow-attribute-registration.patch |  0
 40 files changed, 83 insertions(+), 80 deletions(-)
 rename patches/{unapplied => }/server/Add-Block-isValidTool.patch (100%)
 rename patches/{unapplied => }/server/Add-BlockPreDispenseEvent.patch (97%)
 rename patches/{unapplied => }/server/Add-DragonEggFormEvent.patch (100%)
 rename patches/{unapplied => }/server/Add-EntityMoveEvent.patch (92%)
 rename patches/{unapplied => }/server/Add-PlayerChangeBeaconEffectEvent.patch (100%)
 rename patches/{unapplied => }/server/Add-PlayerNameEntityEvent.patch (96%)
 rename patches/{unapplied => }/server/Add-PlayerStonecutterRecipeSelectEvent.patch (72%)
 rename patches/{unapplied => }/server/Add-RegistryAccess-for-managing-Registries.patch (96%)
 rename patches/{unapplied => }/server/Add-StructuresLocateEvent.patch (100%)
 rename patches/{unapplied => }/server/Add-fast-alternative-constructor-for-Rotations.patch (100%)
 rename patches/{unapplied => }/server/Add-getMainThreadExecutor-to-BukkitScheduler.patch (100%)
 rename patches/{unapplied => }/server/Add-recipe-to-cook-events.patch (85%)
 rename patches/{unapplied => }/server/Add-sendOpLevel-API.patch (100%)
 rename patches/{unapplied => }/server/Add-toggle-for-always-placing-the-dragon-egg.patch (100%)
 rename patches/{unapplied => }/server/Add-worldborder-events.patch (100%)
 rename patches/{unapplied => }/server/Allow-adding-items-to-BlockDropItemEvent.patch (100%)
 rename patches/{unapplied => }/server/Allow-using-signs-inside-spawn-protection.patch (84%)
 rename patches/{unapplied => }/server/Collision-option-for-requiring-a-player-participant.patch (86%)
 rename patches/{unapplied => }/server/Configurable-max-leash-distance.patch (100%)
 rename patches/{unapplied => }/server/Don-t-ignore-result-of-PlayerEditBookEvent.patch (100%)
 rename patches/{unapplied => }/server/Drop-carried-item-when-player-has-disconnected.patch (100%)
 rename patches/{unapplied => }/server/Enhance-console-tab-completions-for-brigadier-comman.patch (100%)
 rename patches/{unapplied => }/server/Expand-EntityUnleashEvent.patch (93%)
 rename patches/{unapplied => }/server/Expand-world-key-API.patch (100%)
 rename patches/{unapplied => }/server/Expose-Tracked-Players.patch (100%)
 rename patches/{unapplied => }/server/Expose-protocol-version.patch (100%)
 rename patches/{unapplied => }/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch (83%)
 rename patches/{unapplied => }/server/Fix-villager-boat-exploit.patch (100%)
 rename patches/{unapplied => }/server/Improve-ServerGUI.patch (100%)
 rename patches/{unapplied => }/server/Inline-shift-direction-fields.patch (97%)
 rename patches/{unapplied => }/server/Make-schedule-command-per-world.patch (91%)
 rename patches/{unapplied => }/server/Merchant-getRecipes-should-return-an-immutable-list.patch (100%)
 rename patches/{unapplied => }/server/Remove-stale-POIs.patch (97%)
 rename patches/{unapplied => }/server/Reset-shield-blocking-on-dimension-change.patch (100%)
 rename patches/{unapplied => }/server/Return-chat-component-with-empty-text-instead-of-thr.patch (100%)
 rename patches/{unapplied => }/server/added-option-to-disable-pathfinding-updates-on-block.patch (94%)
 rename patches/{unapplied => }/server/fix-converting-txt-to-json-file.patch (100%)
 rename patches/{unapplied => }/server/fix-dead-slime-setSize-invincibility.patch (100%)
 rename patches/{unapplied => }/server/forced-whitelist-use-configurable-kick-message.patch (100%)
 rename patches/{unapplied => }/server/living-entity-allow-attribute-registration.patch (100%)

diff --git a/patches/unapplied/server/Add-Block-isValidTool.patch b/patches/server/Add-Block-isValidTool.patch
similarity index 100%
rename from patches/unapplied/server/Add-Block-isValidTool.patch
rename to patches/server/Add-Block-isValidTool.patch
diff --git a/patches/unapplied/server/Add-BlockPreDispenseEvent.patch b/patches/server/Add-BlockPreDispenseEvent.patch
similarity index 97%
rename from patches/unapplied/server/Add-BlockPreDispenseEvent.patch
rename to patches/server/Add-BlockPreDispenseEvent.patch
index d04ab08501..81d0221fe1 100644
--- a/patches/unapplied/server/Add-BlockPreDispenseEvent.patch
+++ b/patches/server/Add-BlockPreDispenseEvent.patch
@@ -32,7 +32,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
 +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-@@ -0,0 +0,0 @@ public class CraftEventFactory {
+@@ -0,0 +0,0 @@ populateFields(victim, event); // Paper - make cancellable
          io.papermc.paper.event.block.BlockFailedDispenseEvent event = new io.papermc.paper.event.block.BlockFailedDispenseEvent(block);
          return event.callEvent();
      }
diff --git a/patches/unapplied/server/Add-DragonEggFormEvent.patch b/patches/server/Add-DragonEggFormEvent.patch
similarity index 100%
rename from patches/unapplied/server/Add-DragonEggFormEvent.patch
rename to patches/server/Add-DragonEggFormEvent.patch
diff --git a/patches/unapplied/server/Add-EntityMoveEvent.patch b/patches/server/Add-EntityMoveEvent.patch
similarity index 92%
rename from patches/unapplied/server/Add-EntityMoveEvent.patch
rename to patches/server/Add-EntityMoveEvent.patch
index ebe504a3bc..7ede26b9ca 100644
--- a/patches/unapplied/server/Add-EntityMoveEvent.patch
+++ b/patches/server/Add-EntityMoveEvent.patch
@@ -14,13 +14,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
              worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
 +            worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
  
-             this.profiler.push(() -> {
+             gameprofilerfiller.push(() -> {
                  String s = String.valueOf(worldserver);
 diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
 +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
      public final LevelStorageSource.LevelStorageAccess convertable;
      public final UUID uuid;
      public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent
@@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
  
          this.pushEntities();
-         this.level().getProfiler().pop();
+         gameprofilerfiller.pop();
 +        // Paper start - Add EntityMoveEvent
 +        if (((ServerLevel) this.level()).hasEntityMoveEvent && !(this instanceof net.minecraft.world.entity.player.Player)) {
 +            if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) {
@@ -50,6 +50,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +            }
 +        }
 +        // Paper end - Add EntityMoveEvent
-         if (!this.level().isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) {
-             this.hurt(this.damageSources().drown(), 1.0F);
-         }
+         world = this.level();
+         if (world instanceof ServerLevel worldserver) {
+             if (this.isSensitiveToWater() && this.isInWaterRainOrBubble()) {
diff --git a/patches/unapplied/server/Add-PlayerChangeBeaconEffectEvent.patch b/patches/server/Add-PlayerChangeBeaconEffectEvent.patch
similarity index 100%
rename from patches/unapplied/server/Add-PlayerChangeBeaconEffectEvent.patch
rename to patches/server/Add-PlayerChangeBeaconEffectEvent.patch
diff --git a/patches/unapplied/server/Add-PlayerNameEntityEvent.patch b/patches/server/Add-PlayerNameEntityEvent.patch
similarity index 96%
rename from patches/unapplied/server/Add-PlayerNameEntityEvent.patch
rename to patches/server/Add-PlayerNameEntityEvent.patch
index aed17ddd59..88de9ab5c6 100644
--- a/patches/unapplied/server/Add-PlayerNameEntityEvent.patch
+++ b/patches/server/Add-PlayerNameEntityEvent.patch
@@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +++ b/src/main/java/net/minecraft/world/item/NameTagItem.java
 @@ -0,0 +0,0 @@ public class NameTagItem extends Item {
          Component component = stack.get(DataComponents.CUSTOM_NAME);
-         if (component != null && !(entity instanceof Player)) {
+         if (component != null && entity.getType().canSerialize()) {
              if (!user.level().isClientSide && entity.isAlive()) {
 -                entity.setCustomName(component);
 -                if (entity instanceof Mob mob) {
diff --git a/patches/unapplied/server/Add-PlayerStonecutterRecipeSelectEvent.patch b/patches/server/Add-PlayerStonecutterRecipeSelectEvent.patch
similarity index 72%
rename from patches/unapplied/server/Add-PlayerStonecutterRecipeSelectEvent.patch
rename to patches/server/Add-PlayerStonecutterRecipeSelectEvent.patch
index 81accc5f74..6c5b8309a1 100644
--- a/patches/unapplied/server/Add-PlayerStonecutterRecipeSelectEvent.patch
+++ b/patches/server/Add-PlayerStonecutterRecipeSelectEvent.patch
@@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          super(MenuType.STONECUTTER, syncId);
 -        this.selectedRecipeIndex = DataSlot.standalone();
 +        this.selectedRecipeIndex = DataSlot.shared(new int[1], 0); // Paper - Add PlayerStonecutterRecipeSelectEvent
-         this.recipes = Lists.newArrayList();
+         this.recipesForInput = SelectableRecipe.SingleInputSet.empty();
          this.input = ItemStack.EMPTY;
          this.slotUpdateListener = () -> {
 @@ -0,0 +0,0 @@ public class StonecutterMenu extends AbstractContainerMenu {
@@ -23,21 +23,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
      public boolean clickMenuButton(net.minecraft.world.entity.player.Player player, int id) {
          if (this.isValidRecipeIndex(id)) {
 -            this.selectedRecipeIndex.set(id);
+-            this.setupResultSlot(id);
 +            // Paper start - Add PlayerStonecutterRecipeSelectEvent
 +            int recipeIndex = id;
 +            this.selectedRecipeIndex.set(recipeIndex);
 +            this.selectedRecipeIndex.checkAndClearUpdateFlag(); // mark as changed
-+            if (this.isValidRecipeIndex(id)) {
-+                io.papermc.paper.event.player.PlayerStonecutterRecipeSelectEvent event = new io.papermc.paper.event.player.PlayerStonecutterRecipeSelectEvent((Player) player.getBukkitEntity(), (org.bukkit.inventory.StonecutterInventory) getBukkitView().getTopInventory(), (org.bukkit.inventory.StonecuttingRecipe) this.getRecipes().get(id).toBukkitRecipe());
++            paperEventBlock: if (this.isValidRecipeIndex(id)) {
++                final Optional<RecipeHolder<StonecutterRecipe>> recipe = this.recipesForInput.entries().get(id).recipe().recipe();
++                if (recipe.isEmpty()) break paperEventBlock; // The recipe selected does not have an actual server recipe (presumably its the empty one). Cannot call the event, just break.
++
++                io.papermc.paper.event.player.PlayerStonecutterRecipeSelectEvent event = new io.papermc.paper.event.player.PlayerStonecutterRecipeSelectEvent((Player) player.getBukkitEntity(), getBukkitView().getTopInventory(), (org.bukkit.inventory.StonecuttingRecipe) recipe.get().toBukkitRecipe());
 +                if (!event.callEvent()) {
 +                    player.containerMenu.sendAllDataToRemote();
 +                    return false;
 +                }
 +
 +                net.minecraft.resources.ResourceLocation key = org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getStonecuttingRecipe().getKey());
-+                if (!this.getRecipes().get(recipeIndex).id().equals(key)) { // If the recipe did NOT stay the same
-+                    for (int newRecipeIndex = 0; newRecipeIndex < this.getRecipes().size(); newRecipeIndex++) {
-+                        if (this.getRecipes().get(newRecipeIndex).id().equals(key)) {
++                if (!recipe.get().id().location().equals(key)) { // If the recipe did NOT stay the same
++                    for (int newRecipeIndex = 0; newRecipeIndex < this.recipesForInput.entries().size(); newRecipeIndex++) {
++                        if (this.recipesForInput.entries().get(newRecipeIndex).recipe().recipe().filter(r -> r.id().location().equals(key)).isPresent()) {
 +                            recipeIndex = newRecipeIndex;
 +                            break;
 +                        }
@@ -46,7 +50,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +            }
 +            player.containerMenu.sendAllDataToRemote();
 +            this.selectedRecipeIndex.set(recipeIndex); // set new index, so that listeners can read it
++            this.setupResultSlot(recipeIndex);
 +            // Paper end - Add PlayerStonecutterRecipeSelectEvent
-             this.setupResultSlot();
          }
  
+         return true;
diff --git a/patches/unapplied/server/Add-RegistryAccess-for-managing-Registries.patch b/patches/server/Add-RegistryAccess-for-managing-Registries.patch
similarity index 96%
rename from patches/unapplied/server/Add-RegistryAccess-for-managing-Registries.patch
rename to patches/server/Add-RegistryAccess-for-managing-Registries.patch
index 1cded328ac..cc534ef511 100644
--- a/patches/unapplied/server/Add-RegistryAccess-for-managing-Registries.patch
+++ b/patches/server/Add-RegistryAccess-for-managing-Registries.patch
@@ -713,7 +713,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 @@ -0,0 +0,0 @@ public class BuiltInRegistries {
          ResourceKey<? extends Registry<T>> key, R registry, BuiltInRegistries.RegistryBootstrap<T> initializer
      ) {
-         Bootstrap.checkBootstrapCalled(() -> "registry " + key);
+         Bootstrap.checkBootstrapCalled(() -> "registry " + key.location());
 +        io.papermc.paper.registry.PaperRegistryAccess.instance().registerRegistry(registry.key(), registry); // Paper - initialize API registry
          ResourceLocation resourceLocation = key.location();
          LOADERS.put(resourceLocation, () -> initializer.run(registry));
@@ -735,13 +735,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/net/minecraft/server/ReloadableServerRegistries.java
 +++ b/src/main/java/net/minecraft/server/ReloadableServerRegistries.java
 @@ -0,0 +0,0 @@ public class ReloadableServerRegistries {
-         return CompletableFuture.supplyAsync(
-             () -> {
-                 WritableRegistry<T> writableRegistry = new MappedRegistry<>(type.registryKey(), Lifecycle.experimental());
-+                io.papermc.paper.registry.PaperRegistryAccess.instance().registerReloadableRegistry(type.registryKey(), writableRegistry); // Paper - register reloadable registry
-                 Map<ResourceLocation, JsonElement> map = new HashMap<>();
-                 String string = Registries.elementsDirPath(type.registryKey());
-                 SimpleJsonResourceReloadListener.scanDirectory(resourceManager, string, GSON, map);
+     ) {
+         return CompletableFuture.supplyAsync(() -> {
+             WritableRegistry<T> writableRegistry = new MappedRegistry<>(type.registryKey(), Lifecycle.experimental());
++            io.papermc.paper.registry.PaperRegistryAccess.instance().registerReloadableRegistry(type.registryKey(), writableRegistry); // Paper - register reloadable registry
+             Map<ResourceLocation, T> map = new HashMap<>();
+             String string = Registries.elementsDirPath(type.registryKey());
+             SimpleJsonResourceReloadListener.scanDirectory(resourceManager, string, ops, type.codec(), map);
 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
@@ -759,64 +759,64 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 -     */
 -    public static <B extends Keyed> Registry<?> createRegistry(Class<? super B> bukkitClass, RegistryAccess registryHolder) {
 -        if (bukkitClass == Enchantment.class) {
--            return new CraftRegistry<>(Enchantment.class, registryHolder.registryOrThrow(Registries.ENCHANTMENT), CraftEnchantment::new, FieldRename.ENCHANTMENT_RENAME);
+-            return new CraftRegistry<>(Enchantment.class, registryHolder.lookupOrThrow(Registries.ENCHANTMENT), CraftEnchantment::new, FieldRename.ENCHANTMENT_RENAME);
 -        }
 -        if (bukkitClass == GameEvent.class) {
--            return new CraftRegistry<>(GameEvent.class, registryHolder.registryOrThrow(Registries.GAME_EVENT), CraftGameEvent::new, FieldRename.NONE);
+-            return new CraftRegistry<>(GameEvent.class, registryHolder.lookupOrThrow(Registries.GAME_EVENT), CraftGameEvent::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == MusicInstrument.class) {
--            return new CraftRegistry<>(MusicInstrument.class, registryHolder.registryOrThrow(Registries.INSTRUMENT), CraftMusicInstrument::new, FieldRename.NONE);
+-            return new CraftRegistry<>(MusicInstrument.class, registryHolder.lookupOrThrow(Registries.INSTRUMENT), CraftMusicInstrument::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == MenuType.class) {
--            return new CraftRegistry<>(MenuType.class, registryHolder.registryOrThrow(Registries.MENU), CraftMenuType::new, FieldRename.NONE);
+-            return new CraftRegistry<>(MenuType.class, registryHolder.lookupOrThrow(Registries.MENU), CraftMenuType::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == PotionEffectType.class) {
--            return new CraftRegistry<>(PotionEffectType.class, registryHolder.registryOrThrow(Registries.MOB_EFFECT), CraftPotionEffectType::new, FieldRename.NONE);
+-            return new CraftRegistry<>(PotionEffectType.class, registryHolder.lookupOrThrow(Registries.MOB_EFFECT), CraftPotionEffectType::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == Structure.class) {
--            return new CraftRegistry<>(Structure.class, registryHolder.registryOrThrow(Registries.STRUCTURE), CraftStructure::new, FieldRename.NONE);
+-            return new CraftRegistry<>(Structure.class, registryHolder.lookupOrThrow(Registries.STRUCTURE), CraftStructure::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == StructureType.class) {
--            return new CraftRegistry<>(StructureType.class, registryHolder.registryOrThrow(Registries.STRUCTURE_TYPE), CraftStructureType::new, FieldRename.NONE);
+-            return new CraftRegistry<>(StructureType.class, registryHolder.lookupOrThrow(Registries.STRUCTURE_TYPE), CraftStructureType::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == Villager.Type.class) {
--            return new CraftRegistry<>(Villager.Type.class, registryHolder.registryOrThrow(Registries.VILLAGER_TYPE), CraftVillager.CraftType::new, FieldRename.NONE);
+-            return new CraftRegistry<>(Villager.Type.class, registryHolder.lookupOrThrow(Registries.VILLAGER_TYPE), CraftVillager.CraftType::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == Villager.Profession.class) {
--            return new CraftRegistry<>(Villager.Profession.class, registryHolder.registryOrThrow(Registries.VILLAGER_PROFESSION), CraftVillager.CraftProfession::new, FieldRename.NONE);
+-            return new CraftRegistry<>(Villager.Profession.class, registryHolder.lookupOrThrow(Registries.VILLAGER_PROFESSION), CraftVillager.CraftProfession::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == TrimMaterial.class) {
--            return new CraftRegistry<>(TrimMaterial.class, registryHolder.registryOrThrow(Registries.TRIM_MATERIAL), CraftTrimMaterial::new, FieldRename.NONE);
+-            return new CraftRegistry<>(TrimMaterial.class, registryHolder.lookupOrThrow(Registries.TRIM_MATERIAL), CraftTrimMaterial::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == TrimPattern.class) {
--            return new CraftRegistry<>(TrimPattern.class, registryHolder.registryOrThrow(Registries.TRIM_PATTERN), CraftTrimPattern::new, FieldRename.NONE);
+-            return new CraftRegistry<>(TrimPattern.class, registryHolder.lookupOrThrow(Registries.TRIM_PATTERN), CraftTrimPattern::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == DamageType.class) {
--            return new CraftRegistry<>(DamageType.class, registryHolder.registryOrThrow(Registries.DAMAGE_TYPE), CraftDamageType::new, FieldRename.NONE);
+-            return new CraftRegistry<>(DamageType.class, registryHolder.lookupOrThrow(Registries.DAMAGE_TYPE), CraftDamageType::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == JukeboxSong.class) {
--            return new CraftRegistry<>(JukeboxSong.class, registryHolder.registryOrThrow(Registries.JUKEBOX_SONG), CraftJukeboxSong::new, FieldRename.NONE);
+-            return new CraftRegistry<>(JukeboxSong.class, registryHolder.lookupOrThrow(Registries.JUKEBOX_SONG), CraftJukeboxSong::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == Wolf.Variant.class) {
--            return new CraftRegistry<>(Wolf.Variant.class, registryHolder.registryOrThrow(Registries.WOLF_VARIANT), CraftWolf.CraftVariant::new, FieldRename.NONE);
+-            return new CraftRegistry<>(Wolf.Variant.class, registryHolder.lookupOrThrow(Registries.WOLF_VARIANT), CraftWolf.CraftVariant::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == BlockType.class) {
--            return new CraftRegistry<>(BlockType.class, registryHolder.registryOrThrow(Registries.BLOCK), CraftBlockType::new, FieldRename.NONE);
+-            return new CraftRegistry<>(BlockType.class, registryHolder.lookupOrThrow(Registries.BLOCK), CraftBlockType::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == ItemType.class) {
--            return new CraftRegistry<>(ItemType.class, registryHolder.registryOrThrow(Registries.ITEM), CraftItemType::new, FieldRename.NONE);
+-            return new CraftRegistry<>(ItemType.class, registryHolder.lookupOrThrow(Registries.ITEM), CraftItemType::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == Frog.Variant.class) {
--            return new CraftRegistry<>(Frog.Variant.class, registryHolder.registryOrThrow(Registries.FROG_VARIANT), CraftFrog.CraftVariant::new, FieldRename.NONE);
+-            return new CraftRegistry<>(Frog.Variant.class, registryHolder.lookupOrThrow(Registries.FROG_VARIANT), CraftFrog.CraftVariant::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == Cat.Type.class) {
--            return new CraftRegistry<>(Cat.Type.class, registryHolder.registryOrThrow(Registries.CAT_VARIANT), CraftCat.CraftType::new, FieldRename.NONE);
+-            return new CraftRegistry<>(Cat.Type.class, registryHolder.lookupOrThrow(Registries.CAT_VARIANT), CraftCat.CraftType::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == MapCursor.Type.class) {
--            return new CraftRegistry<>(MapCursor.Type.class, registryHolder.registryOrThrow(Registries.MAP_DECORATION_TYPE), CraftMapCursor.CraftType::new, FieldRename.NONE);
+-            return new CraftRegistry<>(MapCursor.Type.class, registryHolder.lookupOrThrow(Registries.MAP_DECORATION_TYPE), CraftMapCursor.CraftType::new, FieldRename.NONE);
 -        }
 -        if (bukkitClass == PatternType.class) {
--            return new CraftRegistry<>(PatternType.class, registryHolder.registryOrThrow(Registries.BANNER_PATTERN), CraftPatternType::new, FieldRename.NONE);
+-            return new CraftRegistry<>(PatternType.class, registryHolder.lookupOrThrow(Registries.BANNER_PATTERN), CraftPatternType::new, FieldRename.NONE);
 -        }
 -
 -        return null;
@@ -1269,8 +1269,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 -        register(StructureType.class, Registries.STRUCTURE_TYPE, CraftStructureType.class, net.minecraft.world.level.levelgen.structure.StructureType.class);
 -        register(Villager.Type.class, Registries.VILLAGER_TYPE, CraftVillager.CraftType.class, VillagerType.class);
 -        register(Villager.Profession.class, Registries.VILLAGER_PROFESSION, CraftVillager.CraftProfession.class, VillagerProfession.class);
--        register(TrimMaterial.class, Registries.TRIM_MATERIAL, CraftTrimMaterial.class, net.minecraft.world.item.armortrim.TrimMaterial.class);
--        register(TrimPattern.class, Registries.TRIM_PATTERN, CraftTrimPattern.class, net.minecraft.world.item.armortrim.TrimPattern.class);
+-        register(TrimMaterial.class, Registries.TRIM_MATERIAL, CraftTrimMaterial.class, net.minecraft.world.item.equipment.trim.TrimMaterial.class);
+-        register(TrimPattern.class, Registries.TRIM_PATTERN, CraftTrimPattern.class, net.minecraft.world.item.equipment.trim.TrimPattern.class);
 -        register(DamageType.class, Registries.DAMAGE_TYPE, CraftDamageType.class, net.minecraft.world.damagesource.DamageType.class);
 -        register(JukeboxSong.class, Registries.JUKEBOX_SONG, CraftJukeboxSong.class, net.minecraft.world.item.JukeboxSong.class);
 -        register(Wolf.Variant.class, Registries.WOLF_VARIANT, CraftWolf.CraftVariant.class, WolfVariant.class);
@@ -1290,8 +1290,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +        register(RegistryKey.STRUCTURE_TYPE, StructureType.class, Registries.STRUCTURE_TYPE, CraftStructureType.class, net.minecraft.world.level.levelgen.structure.StructureType.class);
 +        register(RegistryKey.VILLAGER_TYPE, Villager.Type.class, Registries.VILLAGER_TYPE, CraftVillager.CraftType.class, VillagerType.class);
 +        register(RegistryKey.VILLAGER_PROFESSION, Villager.Profession.class, Registries.VILLAGER_PROFESSION, CraftVillager.CraftProfession.class, VillagerProfession.class);
-+        register(RegistryKey.TRIM_MATERIAL, TrimMaterial.class, Registries.TRIM_MATERIAL, CraftTrimMaterial.class, net.minecraft.world.item.armortrim.TrimMaterial.class);
-+        register(RegistryKey.TRIM_PATTERN, TrimPattern.class, Registries.TRIM_PATTERN, CraftTrimPattern.class, net.minecraft.world.item.armortrim.TrimPattern.class);
++        register(RegistryKey.TRIM_MATERIAL, TrimMaterial.class, Registries.TRIM_MATERIAL, CraftTrimMaterial.class, net.minecraft.world.item.equipment.trim.TrimMaterial.class);
++        register(RegistryKey.TRIM_PATTERN, TrimPattern.class, Registries.TRIM_PATTERN, CraftTrimPattern.class, net.minecraft.world.item.equipment.trim.TrimPattern.class);
 +        register(RegistryKey.DAMAGE_TYPE, DamageType.class, Registries.DAMAGE_TYPE, CraftDamageType.class, net.minecraft.world.damagesource.DamageType.class);
 +        register(RegistryKey.JUKEBOX_SONG, JukeboxSong.class, Registries.JUKEBOX_SONG, CraftJukeboxSong.class, net.minecraft.world.item.JukeboxSong.class);
 +        register(RegistryKey.WOLF_VARIANT, Wolf.Variant.class, Registries.WOLF_VARIANT, CraftWolf.CraftVariant.class, WolfVariant.class);
diff --git a/patches/unapplied/server/Add-StructuresLocateEvent.patch b/patches/server/Add-StructuresLocateEvent.patch
similarity index 100%
rename from patches/unapplied/server/Add-StructuresLocateEvent.patch
rename to patches/server/Add-StructuresLocateEvent.patch
diff --git a/patches/unapplied/server/Add-fast-alternative-constructor-for-Rotations.patch b/patches/server/Add-fast-alternative-constructor-for-Rotations.patch
similarity index 100%
rename from patches/unapplied/server/Add-fast-alternative-constructor-for-Rotations.patch
rename to patches/server/Add-fast-alternative-constructor-for-Rotations.patch
diff --git a/patches/unapplied/server/Add-getMainThreadExecutor-to-BukkitScheduler.patch b/patches/server/Add-getMainThreadExecutor-to-BukkitScheduler.patch
similarity index 100%
rename from patches/unapplied/server/Add-getMainThreadExecutor-to-BukkitScheduler.patch
rename to patches/server/Add-getMainThreadExecutor-to-BukkitScheduler.patch
diff --git a/patches/unapplied/server/Add-recipe-to-cook-events.patch b/patches/server/Add-recipe-to-cook-events.patch
similarity index 85%
rename from patches/unapplied/server/Add-recipe-to-cook-events.patch
rename to patches/server/Add-recipe-to-cook-events.patch
index a20e421e6f..e714522341 100644
--- a/patches/unapplied/server/Add-recipe-to-cook-events.patch
+++ b/patches/server/Add-recipe-to-cook-events.patch
@@ -23,13 +23,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
 @@ -0,0 +0,0 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
  
-                 if (campfire.cookingProgress[i] >= campfire.cookingTime[i]) {
+                 if (blockEntity.cookingProgress[i] >= blockEntity.cookingTime[i]) {
                      SingleRecipeInput singlerecipeinput = new SingleRecipeInput(itemstack);
--                    ItemStack itemstack1 = (ItemStack) campfire.quickCheck.getRecipeFor(singlerecipeinput, world).map((recipeholder) -> {
+-                    ItemStack itemstack1 = (ItemStack) recipeMatchGetter.getRecipeFor(singlerecipeinput, world).map((recipeholder) -> {
 +                    // Paper start - add recipe to cook events
-+                    Optional<RecipeHolder<CampfireCookingRecipe>> recipeHolderOptional = campfire.quickCheck.getRecipeFor(singlerecipeinput, world);
-+                    ItemStack itemstack1 = recipeHolderOptional.map((recipeholder) -> {
-+                        // Paper end - Add recipe to cook events
++                    final Optional<RecipeHolder<CampfireCookingRecipe>> recipeHolderOptional = recipeMatchGetter.getRecipeFor(singlerecipeinput, world);
++                    ItemStack itemstack1 = (ItemStack) recipeHolderOptional.map((recipeholder) -> {
++                    // Paper end - add recipe to cook events
                          return ((CampfireCookingRecipe) recipeholder.value()).assemble(singlerecipeinput, world.registryAccess());
                      }).orElse(itemstack);
  
diff --git a/patches/unapplied/server/Add-sendOpLevel-API.patch b/patches/server/Add-sendOpLevel-API.patch
similarity index 100%
rename from patches/unapplied/server/Add-sendOpLevel-API.patch
rename to patches/server/Add-sendOpLevel-API.patch
diff --git a/patches/unapplied/server/Add-toggle-for-always-placing-the-dragon-egg.patch b/patches/server/Add-toggle-for-always-placing-the-dragon-egg.patch
similarity index 100%
rename from patches/unapplied/server/Add-toggle-for-always-placing-the-dragon-egg.patch
rename to patches/server/Add-toggle-for-always-placing-the-dragon-egg.patch
diff --git a/patches/unapplied/server/Add-worldborder-events.patch b/patches/server/Add-worldborder-events.patch
similarity index 100%
rename from patches/unapplied/server/Add-worldborder-events.patch
rename to patches/server/Add-worldborder-events.patch
diff --git a/patches/unapplied/server/Allow-adding-items-to-BlockDropItemEvent.patch b/patches/server/Allow-adding-items-to-BlockDropItemEvent.patch
similarity index 100%
rename from patches/unapplied/server/Allow-adding-items-to-BlockDropItemEvent.patch
rename to patches/server/Allow-adding-items-to-BlockDropItemEvent.patch
diff --git a/patches/unapplied/server/Allow-using-signs-inside-spawn-protection.patch b/patches/server/Allow-using-signs-inside-spawn-protection.patch
similarity index 84%
rename from patches/unapplied/server/Allow-using-signs-inside-spawn-protection.patch
rename to patches/server/Allow-using-signs-inside-spawn-protection.patch
index cb577a13d1..5f8030a46b 100644
--- a/patches/unapplied/server/Allow-using-signs-inside-spawn-protection.patch
+++ b/patches/server/Allow-using-signs-inside-spawn-protection.patch
@@ -9,12 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
 +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
 @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
-                     int i = this.player.level().getMaxBuildHeight();
+                     int i = this.player.level().getMaxY();
  
-                     if (blockposition.getY() < i) {
+                     if (blockposition.getY() <= i) {
 -                        if (this.awaitingPositionFromClient == null && worldserver.mayInteract(this.player, blockposition)) {
--                            this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
 +                        if (this.awaitingPositionFromClient == null && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - Allow using signs inside spawn protection
+                             this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
                              InteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
  
-                             if (enuminteractionresult.consumesAction()) {
diff --git a/patches/unapplied/server/Collision-option-for-requiring-a-player-participant.patch b/patches/server/Collision-option-for-requiring-a-player-participant.patch
similarity index 86%
rename from patches/unapplied/server/Collision-option-for-requiring-a-player-participant.patch
rename to patches/server/Collision-option-for-requiring-a-player-participant.patch
index fb288a5dfb..588f46d42f 100644
--- a/patches/unapplied/server/Collision-option-for-requiring-a-player-participant.patch
+++ b/patches/server/Collision-option-for-requiring-a-player-participant.patch
@@ -16,6 +16,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
                  double d0 = entity.getX() - this.getX();
                  double d1 = entity.getZ() - this.getZ();
                  double d2 = Mth.absMax(d0, d1);
+diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java
++++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java
+@@ -0,0 +0,0 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
+ 
+     @Override
+     public void push(Entity entity) {
++        if (!this.level().paperConfig().collisions.allowVehicleCollisions && this.level().paperConfig().collisions.onlyPlayersCollide && !(entity instanceof Player)) return; // Paper - Collision option for requiring a player participant
+         if (entity instanceof AbstractBoat) {
+             if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
+                 // CraftBukkit start
 diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
@@ -28,15 +40,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
                  if (!this.hasPassenger(entity)) {
                      // CraftBukkit start
                      VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity());
-diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
-+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
-@@ -0,0 +0,0 @@ public class Boat extends VehicleEntity implements Leashable, VariantHolder<Boat
- 
-     @Override
-     public void push(Entity entity) {
-+        if (!this.level().paperConfig().collisions.allowVehicleCollisions && this.level().paperConfig().collisions.onlyPlayersCollide && !(entity instanceof Player)) return; // Paper - Collision option for requiring a player participant
-         if (entity instanceof Boat) {
-             if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
-                 // CraftBukkit start
diff --git a/patches/unapplied/server/Configurable-max-leash-distance.patch b/patches/server/Configurable-max-leash-distance.patch
similarity index 100%
rename from patches/unapplied/server/Configurable-max-leash-distance.patch
rename to patches/server/Configurable-max-leash-distance.patch
diff --git a/patches/unapplied/server/Don-t-ignore-result-of-PlayerEditBookEvent.patch b/patches/server/Don-t-ignore-result-of-PlayerEditBookEvent.patch
similarity index 100%
rename from patches/unapplied/server/Don-t-ignore-result-of-PlayerEditBookEvent.patch
rename to patches/server/Don-t-ignore-result-of-PlayerEditBookEvent.patch
diff --git a/patches/unapplied/server/Drop-carried-item-when-player-has-disconnected.patch b/patches/server/Drop-carried-item-when-player-has-disconnected.patch
similarity index 100%
rename from patches/unapplied/server/Drop-carried-item-when-player-has-disconnected.patch
rename to patches/server/Drop-carried-item-when-player-has-disconnected.patch
diff --git a/patches/unapplied/server/Enhance-console-tab-completions-for-brigadier-comman.patch b/patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch
similarity index 100%
rename from patches/unapplied/server/Enhance-console-tab-completions-for-brigadier-comman.patch
rename to patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch
diff --git a/patches/unapplied/server/Expand-EntityUnleashEvent.patch b/patches/server/Expand-EntityUnleashEvent.patch
similarity index 93%
rename from patches/unapplied/server/Expand-EntityUnleashEvent.patch
rename to patches/server/Expand-EntityUnleashEvent.patch
index f5bd7efda3..8aa9aadc8c 100644
--- a/patches/unapplied/server/Expand-EntityUnleashEvent.patch
+++ b/patches/server/Expand-EntityUnleashEvent.patch
@@ -50,12 +50,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  
          if (leashable_a != null && leashable_a.leashHolder != null) {
              if (!entity.isAlive() || !leashable_a.leashHolder.isAlive()) {
--                entity.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit
--                Leashable.dropLeash(entity, true, !entity.pluginRemoved); // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
+-                world.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit
 +                // Paper start - Expand EntityUnleashEvent
-+                final EntityUnleashEvent event = new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE, !entity.pluginRemoved);
++                final EntityUnleashEvent event = new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE, world.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS) && !entity.pluginRemoved);
 +                event.callEvent();
-+                Leashable.dropLeash(entity, true, event.isDropLeash()); // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
+                 Leashable.dropLeash(entity, true, world.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS) && !entity.pluginRemoved); // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
 +                // Paper end - Expand EntityUnleashEvent
              }
  
@@ -143,7 +142,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
 +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-@@ -0,0 +0,0 @@ public class CraftEventFactory {
+@@ -0,0 +0,0 @@ populateFields(victim, event); // Paper - make cancellable
          Bukkit.getPluginManager().callEvent(new PlayerRecipeBookSettingsChangeEvent(player.getBukkitEntity(), bukkitType, open, filter));
      }
  
diff --git a/patches/unapplied/server/Expand-world-key-API.patch b/patches/server/Expand-world-key-API.patch
similarity index 100%
rename from patches/unapplied/server/Expand-world-key-API.patch
rename to patches/server/Expand-world-key-API.patch
diff --git a/patches/unapplied/server/Expose-Tracked-Players.patch b/patches/server/Expose-Tracked-Players.patch
similarity index 100%
rename from patches/unapplied/server/Expose-Tracked-Players.patch
rename to patches/server/Expose-Tracked-Players.patch
diff --git a/patches/unapplied/server/Expose-protocol-version.patch b/patches/server/Expose-protocol-version.patch
similarity index 100%
rename from patches/unapplied/server/Expose-protocol-version.patch
rename to patches/server/Expose-protocol-version.patch
diff --git a/patches/unapplied/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch b/patches/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch
similarity index 83%
rename from patches/unapplied/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch
rename to patches/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch
index 33d2dfacb1..eb3ef45b6f 100644
--- a/patches/unapplied/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch
+++ b/patches/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch
@@ -18,5 +18,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
                          if (event.isCancelled()) {
 +                            this.stopUsingItem(); // Paper - event is using an item, clear active item to reset its use
                              // Update client
-                             if (this.useItem.getItem() instanceof net.minecraft.world.item.SuspiciousStewItem itemSuspiciousStew) {
-                                 itemSuspiciousStew.cancelUsingItem(entityPlayer, this.useItem);
+                             Consumable consumable = this.useItem.get(DataComponents.CONSUMABLE);
+                             if (consumable != null) {
diff --git a/patches/unapplied/server/Fix-villager-boat-exploit.patch b/patches/server/Fix-villager-boat-exploit.patch
similarity index 100%
rename from patches/unapplied/server/Fix-villager-boat-exploit.patch
rename to patches/server/Fix-villager-boat-exploit.patch
diff --git a/patches/unapplied/server/Improve-ServerGUI.patch b/patches/server/Improve-ServerGUI.patch
similarity index 100%
rename from patches/unapplied/server/Improve-ServerGUI.patch
rename to patches/server/Improve-ServerGUI.patch
diff --git a/patches/unapplied/server/Inline-shift-direction-fields.patch b/patches/server/Inline-shift-direction-fields.patch
similarity index 97%
rename from patches/unapplied/server/Inline-shift-direction-fields.patch
rename to patches/server/Inline-shift-direction-fields.patch
index e4f4e3a7d6..6b90cccfcb 100644
--- a/patches/unapplied/server/Inline-shift-direction-fields.patch
+++ b/patches/server/Inline-shift-direction-fields.patch
@@ -24,9 +24,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          final int id,
          final int idOpposite,
 @@ -0,0 +0,0 @@ public enum Direction implements StringRepresentable {
-         this.axis = axis;
          this.axisDirection = direction;
          this.normal = vector;
+         this.normalVec3 = Vec3.atLowerCornerOf(vector);
 +        // Paper start - Perf: Inline shift direction fields
 +        this.adjX = vector.getX();
 +        this.adjY = vector.getY();
diff --git a/patches/unapplied/server/Make-schedule-command-per-world.patch b/patches/server/Make-schedule-command-per-world.patch
similarity index 91%
rename from patches/unapplied/server/Make-schedule-command-per-world.patch
rename to patches/server/Make-schedule-command-per-world.patch
index 39c351332b..91f3827dbe 100644
--- a/patches/unapplied/server/Make-schedule-command-per-world.patch
+++ b/patches/server/Make-schedule-command-per-world.patch
@@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
 +++ b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
 @@ -0,0 +0,0 @@ public class ScheduleCommand {
-         return Component.translatableEscape("commands.schedule.cleared.failure", object);
      });
+     private static final SimpleCommandExceptionType ERROR_MACRO = new SimpleCommandExceptionType(Component.translatableEscape("commands.schedule.macro"));
      private static final SuggestionProvider<CommandSourceStack> SUGGEST_SCHEDULE = (commandcontext, suggestionsbuilder) -> {
 -        return SharedSuggestionProvider.suggest((Iterable) ((CommandSourceStack) commandcontext.getSource()).getServer().getWorldData().overworldData().getScheduledEvents().getEventsIds(), suggestionsbuilder);
 +        return SharedSuggestionProvider.suggest((Iterable) ((net.minecraft.commands.CommandSourceStack) commandcontext.getSource()).getLevel().serverLevelData.getScheduledEvents().getEventsIds(), suggestionsbuilder); // Paper - Make schedule command per-world
diff --git a/patches/unapplied/server/Merchant-getRecipes-should-return-an-immutable-list.patch b/patches/server/Merchant-getRecipes-should-return-an-immutable-list.patch
similarity index 100%
rename from patches/unapplied/server/Merchant-getRecipes-should-return-an-immutable-list.patch
rename to patches/server/Merchant-getRecipes-should-return-an-immutable-list.patch
diff --git a/patches/unapplied/server/Remove-stale-POIs.patch b/patches/server/Remove-stale-POIs.patch
similarity index 97%
rename from patches/unapplied/server/Remove-stale-POIs.patch
rename to patches/server/Remove-stale-POIs.patch
index 72bb935e68..443074c5b6 100644
--- a/patches/unapplied/server/Remove-stale-POIs.patch
+++ b/patches/server/Remove-stale-POIs.patch
@@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
 +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
              });
              optional1.ifPresent((holder) -> {
                  this.getServer().execute(() -> {
diff --git a/patches/unapplied/server/Reset-shield-blocking-on-dimension-change.patch b/patches/server/Reset-shield-blocking-on-dimension-change.patch
similarity index 100%
rename from patches/unapplied/server/Reset-shield-blocking-on-dimension-change.patch
rename to patches/server/Reset-shield-blocking-on-dimension-change.patch
diff --git a/patches/unapplied/server/Return-chat-component-with-empty-text-instead-of-thr.patch b/patches/server/Return-chat-component-with-empty-text-instead-of-thr.patch
similarity index 100%
rename from patches/unapplied/server/Return-chat-component-with-empty-text-instead-of-thr.patch
rename to patches/server/Return-chat-component-with-empty-text-instead-of-thr.patch
diff --git a/patches/unapplied/server/added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/added-option-to-disable-pathfinding-updates-on-block.patch
similarity index 94%
rename from patches/unapplied/server/added-option-to-disable-pathfinding-updates-on-block.patch
rename to patches/server/added-option-to-disable-pathfinding-updates-on-block.patch
index c94ecb5589..20d39fb7b1 100644
--- a/patches/unapplied/server/added-option-to-disable-pathfinding-updates-on-block.patch
+++ b/patches/server/added-option-to-disable-pathfinding-updates-on-block.patch
@@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai
 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
 +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
  
          this.getChunkSource().blockChanged(pos);
          this.pathTypesByPosCache.invalidate(pos);
@@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          VoxelShape voxelshape = oldState.getCollisionShape(this, pos);
          VoxelShape voxelshape1 = newState.getCollisionShape(this, pos);
  
-@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
              }
  
          }
diff --git a/patches/unapplied/server/fix-converting-txt-to-json-file.patch b/patches/server/fix-converting-txt-to-json-file.patch
similarity index 100%
rename from patches/unapplied/server/fix-converting-txt-to-json-file.patch
rename to patches/server/fix-converting-txt-to-json-file.patch
diff --git a/patches/unapplied/server/fix-dead-slime-setSize-invincibility.patch b/patches/server/fix-dead-slime-setSize-invincibility.patch
similarity index 100%
rename from patches/unapplied/server/fix-dead-slime-setSize-invincibility.patch
rename to patches/server/fix-dead-slime-setSize-invincibility.patch
diff --git a/patches/unapplied/server/forced-whitelist-use-configurable-kick-message.patch b/patches/server/forced-whitelist-use-configurable-kick-message.patch
similarity index 100%
rename from patches/unapplied/server/forced-whitelist-use-configurable-kick-message.patch
rename to patches/server/forced-whitelist-use-configurable-kick-message.patch
diff --git a/patches/unapplied/server/living-entity-allow-attribute-registration.patch b/patches/server/living-entity-allow-attribute-registration.patch
similarity index 100%
rename from patches/unapplied/server/living-entity-allow-attribute-registration.patch
rename to patches/server/living-entity-allow-attribute-registration.patch