From c6a0ad379d104714fa1cc94aa895b32c5c6d7a3e Mon Sep 17 00:00:00 2001
From: Bjarne Koll <git@lynxplay.dev>
Date: Fri, 25 Oct 2024 13:52:04 +0200
Subject: [PATCH] Compiler issues v2

---
 patches/api/Add-getI18NDisplayName-API.patch  |  2 +-
 patches/api/ensureServerConversions-API.patch |  2 +-
 ...CanPlaceOn-and-CanDestroy-NBT-values.patch |  8 +++++---
 .../server/Add-EntityFertilizeEggEvent.patch  |  2 +-
 .../Add-ItemFactory-getSpawnEgg-API.patch     |  2 +-
 .../server/Add-drops-to-shear-events.patch    |  2 +-
 ...d-proper-async-player-disconnections.patch |  2 +-
 ...us-missing-EntityDropItemEvent-calls.patch | 10 +++++-----
 patches/server/Adventure.patch                |  6 +++---
 patches/server/Anti-Xray.patch                |  2 +-
 ...ate-HoverEvent-from-ItemStack-Entity.patch |  2 +-
 .../server/EntityPickupItemEvent-fixes.patch  |  2 +-
 ...g-not-using-commands.spam-exclusions.patch | 19 -------------------
 .../Force-close-world-loading-screen.patch    |  2 +-
 .../Implement-enchantWithLevels-API.patch     |  2 +-
 .../server/Implement-getI18NDisplayName.patch |  2 +-
 patches/server/ItemStack-damage-API.patch     |  9 ++++++---
 ...able-API-and-replenishable-lootables.patch |  4 ++--
 patches/server/More-Teleport-API.patch        |  2 +-
 .../Optional-TNT-doesn-t-move-in-water.patch  |  2 +-
 20 files changed, 35 insertions(+), 49 deletions(-)
 delete mode 100644 patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch

diff --git a/patches/api/Add-getI18NDisplayName-API.patch b/patches/api/Add-getI18NDisplayName-API.patch
index 1b29ae0347..be7ab40234 100644
--- a/patches/api/Add-getI18NDisplayName-API.patch
+++ b/patches/api/Add-getI18NDisplayName-API.patch
@@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +     * {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)} instead.
 +     */
 +    @Nullable
-+    @Deprecated(since = "1.18.1")
++    @Deprecated(since = "1.18.1", forRemoval = true)
 +    String getI18NDisplayName(@Nullable ItemStack item);
 +    // Paper end - add getI18NDisplayName
  }
diff --git a/patches/api/ensureServerConversions-API.patch b/patches/api/ensureServerConversions-API.patch
index 98773c6bd3..b6589deb4a 100644
--- a/patches/api/ensureServerConversions-API.patch
+++ b/patches/api/ensureServerConversions-API.patch
@@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java
 +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
 @@ -0,0 +0,0 @@ public interface ItemFactory {
-     @Deprecated(since = "1.18.1")
+     @Deprecated(since = "1.18.1", forRemoval = true)
      String getI18NDisplayName(@Nullable ItemStack item);
      // Paper end - add getI18NDisplayName
 +
diff --git a/patches/server/Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch b/patches/server/Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch
index 601940d7a9..1c2829c85f 100644
--- a/patches/server/Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch
+++ b/patches/server/Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch
@@ -36,8 +36,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +    }
 +
 +    private static List<net.minecraft.advancements.critereon.BlockPredicate> convertFromLegacyMaterial(final Collection<Material> materials) {
++        final net.minecraft.core.Registry<net.minecraft.world.level.block.Block> blockRegistry = net.minecraft.server.MinecraftServer.getServer().registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BLOCK);
 +        return materials.stream().map(m -> {
-+            return net.minecraft.advancements.critereon.BlockPredicate.Builder.block().of(CraftBlockType.bukkitToMinecraft(m)).build();
++            return net.minecraft.advancements.critereon.BlockPredicate.Builder.block().of(blockRegistry, CraftBlockType.bukkitToMinecraft(m)).build();
 +        }).toList();
 +    }
 +
@@ -74,11 +75,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +
 +    private static List<net.minecraft.advancements.critereon.BlockPredicate> convertFromLegacyNamespaced(final Collection<com.destroystokyo.paper.Namespaced> namespaceds) {
 +        final List<net.minecraft.advancements.critereon.BlockPredicate> predicates = new ArrayList<>();
++        final net.minecraft.core.Registry<net.minecraft.world.level.block.Block> blockRegistry = net.minecraft.server.MinecraftServer.getServer().registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BLOCK);
 +        for (final com.destroystokyo.paper.Namespaced namespaced : namespaceds) {
 +            if (namespaced instanceof final org.bukkit.NamespacedKey key) {
-+                predicates.add(net.minecraft.advancements.critereon.BlockPredicate.Builder.block().of(CraftBlockType.bukkitToMinecraft(Objects.requireNonNull(org.bukkit.Registry.MATERIAL.get(key)))).build());
++                predicates.add(net.minecraft.advancements.critereon.BlockPredicate.Builder.block().of(blockRegistry, CraftBlockType.bukkitToMinecraft(Objects.requireNonNull(org.bukkit.Registry.MATERIAL.get(key)))).build());
 +            } else if (namespaced instanceof final com.destroystokyo.paper.NamespacedTag tag) {
-+                predicates.add(net.minecraft.advancements.critereon.BlockPredicate.Builder.block().of(net.minecraft.tags.TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(tag.getNamespace(), tag.getKey()))).build());
++                predicates.add(net.minecraft.advancements.critereon.BlockPredicate.Builder.block().of(blockRegistry, net.minecraft.tags.TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(tag.getNamespace(), tag.getKey()))).build());
 +            }
 +        }
 +        return predicates;
diff --git a/patches/server/Add-EntityFertilizeEggEvent.patch b/patches/server/Add-EntityFertilizeEggEvent.patch
index 665e1a469e..12d26513db 100644
--- a/patches/server/Add-EntityFertilizeEggEvent.patch
+++ b/patches/server/Add-EntityFertilizeEggEvent.patch
@@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          entityitem.setDefaultPickUpDelay();
 -        this.finalizeSpawnChildFromBreeding(world, other, (AgeableMob) null);
 +        this.finalizeSpawnChildFromBreeding(world, other, (AgeableMob) null, result.getExperience()); // Paper - Add EntityFertilizeEggEvent event
-         if (this.spawnAtLocation(entityitem) != null) { // Paper - Call EntityDropItemEvent
+         if (this.spawnAtLocation(world, entityitem) != null) { // Paper - Call EntityDropItemEvent
          this.playSound(SoundEvents.SNIFFER_EGG_PLOP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 0.5F);
          } // Paper - Call EntityDropItemEvent
 diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
diff --git a/patches/server/Add-ItemFactory-getSpawnEgg-API.patch b/patches/server/Add-ItemFactory-getSpawnEgg-API.patch
index b944acb7b3..2170f313f2 100644
--- a/patches/server/Add-ItemFactory-getSpawnEgg-API.patch
+++ b/patches/server/Add-ItemFactory-getSpawnEgg-API.patch
@@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +        }
 +        String typeId = type.getKey().toString();
 +        net.minecraft.resources.ResourceLocation typeKey = ResourceLocation.parse(typeId);
-+        net.minecraft.world.entity.EntityType<?> nmsType = net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(typeKey);
++        net.minecraft.world.entity.EntityType<?> nmsType = net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.getValue(typeKey);
 +        net.minecraft.world.item.SpawnEggItem eggItem = net.minecraft.world.item.SpawnEggItem.byId(nmsType);
 +        return eggItem == null ? null : new net.minecraft.world.item.ItemStack(eggItem).asBukkitMirror();
 +    }
diff --git a/patches/server/Add-drops-to-shear-events.patch b/patches/server/Add-drops-to-shear-events.patch
index 225f435d9d..fc3356a780 100644
--- a/patches/server/Add-drops-to-shear-events.patch
+++ b/patches/server/Add-drops-to-shear-events.patch
@@ -115,7 +115,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +            drops.forEach(itemstack1 -> {
 +                for (final ItemStack drop : drops) {
 +                    ItemEntity entityitem = new ItemEntity(this.level(), this.getX(), this.getY(1.0D), this.getZ(), drop);
-+                    this.spawnAtLocation(entityitem);
++                    this.spawnAtLocation(world, entityitem);
                  }
 -
 +            // Paper end - custom shear drops; moved drop generation to separate method
diff --git a/patches/server/Add-proper-async-player-disconnections.patch b/patches/server/Add-proper-async-player-disconnections.patch
index c97a02a2a4..94b54fe962 100644
--- a/patches/server/Add-proper-async-player-disconnections.patch
+++ b/patches/server/Add-proper-async-player-disconnections.patch
@@ -132,7 +132,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
              return optional;
 @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
          // this.chatSpamThrottler.increment();
-         if (counted && !this.chatSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // Paper - exclude from SpigotConfig.spamExclusions
+         if (!this.chatSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
              // CraftBukkit end
 -            this.disconnect((Component) Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause
 +            this.disconnectAsync((Component) Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause // Paper - add proper async disconnect
diff --git a/patches/server/Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/Add-various-missing-EntityDropItemEvent-calls.patch
index 7271c8c7d9..f1d97d34cb 100644
--- a/patches/server/Add-various-missing-EntityDropItemEvent-calls.patch
+++ b/patches/server/Add-various-missing-EntityDropItemEvent-calls.patch
@@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  
                  entityitem.setDeltaMovement((double) (0.3F * -Mth.sin(Dolphin.this.getYRot() * 0.017453292F) * Mth.cos(Dolphin.this.getXRot() * 0.017453292F) + Mth.cos(f1) * f2), (double) (0.3F * Mth.sin(Dolphin.this.getXRot() * 0.017453292F) * 1.5F), (double) (0.3F * Mth.cos(Dolphin.this.getYRot() * 0.017453292F) * Mth.cos(Dolphin.this.getXRot() * 0.017453292F) + Mth.sin(f1) * f2));
 -                Dolphin.this.level().addFreshEntity(entityitem);
-+                Dolphin.this.spawnAtLocation(entityitem); // Paper - Call EntityDropItemEvent
++                Dolphin.this.spawnAtLocation(getServerLevel(Dolphin.this), entityitem); // Paper - Call EntityDropItemEvent
              }
          }
      }
@@ -45,7 +45,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
              entityitem.setThrower(this);
              this.playSound(SoundEvents.FOX_SPIT, 1.0F, 1.0F);
 -            this.level().addFreshEntity(entityitem);
-+            this.spawnAtLocation(entityitem); // Paper - Call EntityDropItemEvent
++            this.spawnAtLocation((net.minecraft.server.level.ServerLevel) this.level(), entityitem); // Paper - Call EntityDropItemEvent
          }
      }
  
@@ -53,7 +53,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          ItemEntity entityitem = new ItemEntity(this.level(), this.getX(), this.getY(), this.getZ(), stack);
  
 -        this.level().addFreshEntity(entityitem);
-+        this.spawnAtLocation(entityitem); // Paper - Call EntityDropItemEvent
++        this.spawnAtLocation((net.minecraft.server.level.ServerLevel) this.level(), entityitem); // Paper - Call EntityDropItemEvent
      }
  
      @Override
@@ -67,7 +67,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  
 -            this.level().addFreshEntity(entityitem);
 -            return true;
-+            return this.spawnAtLocation(entityitem) != null; // Paper - Call EntityDropItemEvent
++            return this.spawnAtLocation((net.minecraft.server.level.ServerLevel) this.level(), entityitem) != null; // Paper - Call EntityDropItemEvent
          }
      }
  
@@ -79,7 +79,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  
          entityitem.setDefaultPickUpDelay();
          this.finalizeSpawnChildFromBreeding(world, other, (AgeableMob) null);
-+        if (this.spawnAtLocation(entityitem) != null) { // Paper - Call EntityDropItemEvent
++        if (this.spawnAtLocation(world, entityitem) != null) { // Paper - Call EntityDropItemEvent
          this.playSound(SoundEvents.SNIFFER_EGG_PLOP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 0.5F);
 -        world.addFreshEntity(entityitem);
 +        } // Paper - Call EntityDropItemEvent
diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch
index 6b2becf907..dc64632a87 100644
--- a/patches/server/Adventure.patch
+++ b/patches/server/Adventure.patch
@@ -4437,10 +4437,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +    }
 +
 +    private net.minecraft.network.chat.ChatType.Bound toHandle(net.kyori.adventure.chat.ChatType.Bound boundChatType) {
-+        net.minecraft.core.Registry<net.minecraft.network.chat.ChatType> chatTypeRegistry = this.getHandle().level().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.CHAT_TYPE);
++        net.minecraft.core.Registry<net.minecraft.network.chat.ChatType> chatTypeRegistry = this.getHandle().level().registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.CHAT_TYPE);
 +
 +        return new net.minecraft.network.chat.ChatType.Bound(
-+            chatTypeRegistry.getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.CHAT_TYPE, io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.type().key()))),
++            chatTypeRegistry.getOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.CHAT_TYPE, io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.type().key()))),
 +            io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.name()),
 +            Optional.ofNullable(io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.target()))
 +        );
@@ -4483,7 +4483,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +    @Override
 +    public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) {
 +        if (getHandle().connection == null) return;
-+        final net.minecraft.core.Registry<net.minecraft.network.chat.ChatType> chatTypeRegistry = this.getHandle().level().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.CHAT_TYPE);
++        final net.minecraft.core.Registry<net.minecraft.network.chat.ChatType> chatTypeRegistry = this.getHandle().level().registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.CHAT_TYPE);
 +        this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(message, false));
 +    }
 +
diff --git a/patches/server/Anti-Xray.patch b/patches/server/Anti-Xray.patch
index acdd65e190..79f853edaf 100644
--- a/patches/server/Anti-Xray.patch
+++ b/patches/server/Anti-Xray.patch
@@ -1161,7 +1161,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/net/minecraft/server/players/PlayerList.java
 +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
 @@ -0,0 +0,0 @@ public abstract class PlayerList {
-                     .getHolderOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS);
+                     .getOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS);
              player.connection.send(new net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket(
                      new net.minecraft.world.level.chunk.EmptyLevelChunk(worldserver1, player.chunkPosition(), plains),
 -                    worldserver1.getLightEngine(), (java.util.BitSet)null, (java.util.BitSet) null)
diff --git a/patches/server/Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/Create-HoverEvent-from-ItemStack-Entity.patch
index e133374ad7..d07e87e536 100644
--- a/patches/server/Create-HoverEvent-from-ItemStack-Entity.patch
+++ b/patches/server/Create-HoverEvent-from-ItemStack-Entity.patch
@@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
 +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
 @@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory {
-         return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId(nms)) : null;
+         return nms != null ? nms.getItem().getName(nms).getString() : null;
      }
      // Paper end - add getI18NDisplayName
 +
diff --git a/patches/server/EntityPickupItemEvent-fixes.patch b/patches/server/EntityPickupItemEvent-fixes.patch
index 2d7b46beff..8edcce72df 100644
--- a/patches/server/EntityPickupItemEvent-fixes.patch
+++ b/patches/server/EntityPickupItemEvent-fixes.patch
@@ -64,7 +64,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  
          if (this.hasActiveRaid() && !flag && ItemStack.matches(itemstack, Raid.getOminousBannerInstance(this.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)))) {
 +            // Paper start - EntityPickupItemEvent fixes
-+            if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, itemstack, 0, false).isCancelled()) {
++            if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, itemEntity, 0, false).isCancelled()) {
 +                return;
 +            }
 +            // Paper end - EntityPickupItemEvent fixes
diff --git a/patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch
deleted file mode 100644
index c267468b05..0000000000
--- a/patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Doc <nachito94@msn.com>
-Date: Sun, 17 Jul 2022 11:49:43 -0400
-Subject: [PATCH] Fix Spigot Config not using commands.spam-exclusions
-
-
-diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
-         }
-         // Spigot end
-         // this.chatSpamThrottler.increment();
--        if (!this.chatSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
-+        if (counted && !this.chatSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // Paper - exclude from SpigotConfig.spamExclusions
-             // CraftBukkit end
-             this.disconnect((Component) Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause
-         }
diff --git a/patches/server/Force-close-world-loading-screen.patch b/patches/server/Force-close-world-loading-screen.patch
index 0e2f8c1ec9..b769726567 100644
--- a/patches/server/Force-close-world-loading-screen.patch
+++ b/patches/server/Force-close-world-loading-screen.patch
@@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +        // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead
 +        if (player.isDeadOrDying()) {
 +            net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> plains = worldserver1.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME)
-+                    .getHolderOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS);
++                    .getOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS);
 +            player.connection.send(new net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket(
 +                    new net.minecraft.world.level.chunk.EmptyLevelChunk(worldserver1, player.chunkPosition(), plains),
 +                    worldserver1.getLightEngine(), (java.util.BitSet)null, (java.util.BitSet) null)
diff --git a/patches/server/Implement-enchantWithLevels-API.patch b/patches/server/Implement-enchantWithLevels-API.patch
index 7dfce8d60d..6986199227 100644
--- a/patches/server/Implement-enchantWithLevels-API.patch
+++ b/patches/server/Implement-enchantWithLevels-API.patch
@@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +                // NON_TREASURE, which does contain all enchantments not in the treasure tag.
 +                // Additionally, the allowTreasure boolean is more intended to configure this method to behave like
 +                // an enchanting table.
-+                : net.minecraft.server.MinecraftServer.getServer().registryAccess().registryOrThrow(Registries.ENCHANTMENT).getTag(EnchantmentTags.IN_ENCHANTING_TABLE),
++                : net.minecraft.server.MinecraftServer.getServer().registryAccess().lookupOrThrow(Registries.ENCHANTMENT).get(EnchantmentTags.IN_ENCHANTING_TABLE),
 +            random
 +        );
 +    }
diff --git a/patches/server/Implement-getI18NDisplayName.patch b/patches/server/Implement-getI18NDisplayName.patch
index cf1c5c355c..c353efdbf6 100644
--- a/patches/server/Implement-getI18NDisplayName.patch
+++ b/patches/server/Implement-getI18NDisplayName.patch
@@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +            nms = CraftItemStack.asNMSCopy(item);
 +        }
 +
-+        return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId(nms)) : null;
++        return nms != null ? nms.getItem().getName(nms).getString() : null;
 +    }
 +    // Paper end - add getI18NDisplayName
  }
diff --git a/patches/server/ItemStack-damage-API.patch b/patches/server/ItemStack-damage-API.patch
index 6d15ba1ea5..adf27b75ed 100644
--- a/patches/server/ItemStack-damage-API.patch
+++ b/patches/server/ItemStack-damage-API.patch
@@ -30,13 +30,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          if (player instanceof final ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent
              PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), j, originalDamage); // Paper - Add EntityDamageItemEvent
 @@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder {
- 
      }
  
--    private int processDurabilityChange(int baseDamage, ServerLevel world, @Nullable LivingEntity player) {  // Paper - Add EntityDamageItemEvent
+     private int processDurabilityChange(int baseDamage, ServerLevel world, @Nullable LivingEntity player) {  // Paper - Add EntityDamageItemEvent
 -        return !this.isDamageableItem() ? 0 : (player instanceof ServerPlayer && player.hasInfiniteMaterials() ? 0 : (baseDamage > 0 ? EnchantmentHelper.processDurabilityChange(world, this, baseDamage) : baseDamage));  // Paper - Add EntityDamageItemEvent
-+    private int processDurabilityChange(int baseDamage, ServerLevel world, @Nullable LivingEntity player, boolean force) {  // Paper - Add EntityDamageItemEvent
++        // Paper start - itemstack damage api
++        return processDurabilityChange(baseDamage, world, player, false);
++    }
++    private int processDurabilityChange(int baseDamage, ServerLevel world, @Nullable LivingEntity player, boolean force) {
 +        return !this.isDamageableItem() ? 0 : (player instanceof ServerPlayer && player.hasInfiniteMaterials() && !force ? 0 : (baseDamage > 0 ? EnchantmentHelper.processDurabilityChange(world, this, baseDamage) : baseDamage));  // Paper - Add EntityDamageItemEvent
++        // Paper end - itemstack damage api
      }
  
      private void applyDamage(int damage, @Nullable LivingEntity player, Consumer<Item> breakCallback) { // Paper - Add EntityDamageItemEvent
diff --git a/patches/server/LootTable-API-and-replenishable-lootables.patch b/patches/server/LootTable-API-and-replenishable-lootables.patch
index 0611c85f5c..61e3e820c0 100644
--- a/patches/server/LootTable-API-and-replenishable-lootables.patch
+++ b/patches/server/LootTable-API-and-replenishable-lootables.patch
@@ -391,12 +391,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +
 +        @Override
 +        public void setSeed(final ContainerEntity holder, final long seed) {
-+            holder.setLootTableSeed(seed);
++            holder.setContainerLootTableSeed(seed);
 +        }
 +
 +        @Override
 +        public boolean hasLootTable(final ContainerEntity holder) {
-+            return holder.getLootTable() != null;
++            return holder.getContainerLootTable() != null;
 +        }
 +
 +        @Override
diff --git a/patches/server/More-Teleport-API.patch b/patches/server/More-Teleport-API.patch
index 23712d79ce..70893c283d 100644
--- a/patches/server/More-Teleport-API.patch
+++ b/patches/server/More-Teleport-API.patch
@@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 -        PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause);
 +        // Paper start - Teleport API
 +        Set<io.papermc.paper.entity.TeleportFlag.Relative> relativeFlags = java.util.EnumSet.noneOf(io.papermc.paper.entity.TeleportFlag.Relative.class);
-+        for (RelativeMovement relativeArgument : set) {
++        for (Relative relativeArgument : set) {
 +            relativeFlags.add(org.bukkit.craftbukkit.entity.CraftPlayer.toApiRelativeFlag(relativeArgument));
 +        }
 +        PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause, java.util.Set.copyOf(relativeFlags));
diff --git a/patches/server/Optional-TNT-doesn-t-move-in-water.patch b/patches/server/Optional-TNT-doesn-t-move-in-water.patch
index 0fddf14fe6..b692364a6f 100644
--- a/patches/server/Optional-TNT-doesn-t-move-in-water.patch
+++ b/patches/server/Optional-TNT-doesn-t-move-in-water.patch
@@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +            net.minecraft.server.level.ChunkMap.TrackedEntity ete = ((net.minecraft.server.level.ServerLevel) this.level()).getChunkSource().chunkMap.entityMap.get(this.getId());
 +            if (ete != null) {
 +                net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket velocityPacket = new net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket(this);
-+                net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket positionPacket = new net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket(this);
++                net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket positionPacket = net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket.teleport(this.getId(), net.minecraft.world.entity.PositionMoveRotation.of(this), java.util.Set.of(), this.onGround);
 +
 +                ete.seenBy.stream()
 +                    .filter(viewer -> (viewer.getPlayer().getX() - this.getX()) * (viewer.getPlayer().getY() - this.getY()) * (viewer.getPlayer().getZ() - this.getZ()) < 16 * 16)