From 838bab409eb04e7e130cc2127726a09f12c1a84b Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Sun, 5 May 2024 09:08:55 -0700
Subject: [PATCH] Updated Upstream (CraftBukkit) (#10646)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
66fd94322 SPIGOT-7652: Remove remap for SPELL_MOB_AMBIENT which no longer exists
ecfa4f973 SPIGOT-7654: ItemStack#isSimilar does not work with empty BlockStateMeta
4460ecc49 SPIGOT-7655: ItemMeta#addItemFlags(ItemFlag.HIDE_ATTRIBUTES) not working when no attribute modifiers set
5d84f48a4 SPIGOT-7653: Update ApiVersion.CURRENT with latest version and include tests
---
 patches/server/General-ItemMeta-fixes.patch | 11 +++++++++++
 work/CraftBukkit                            |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/patches/server/General-ItemMeta-fixes.patch b/patches/server/General-ItemMeta-fixes.patch
index 687360564d..99611a2d16 100644
--- a/patches/server/General-ItemMeta-fixes.patch
+++ b/patches/server/General-ItemMeta-fixes.patch
@@ -258,6 +258,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  
          <T> Applicator put(ItemMetaKeyType<T> key, T value) {
              this.builder.set(key.TYPE, value);
+@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+ 
+     void applyModifiers(Multimap<Attribute, AttributeModifier> modifiers, CraftMetaItem.Applicator tag) {
+         if (modifiers == null || modifiers.isEmpty()) {
+-            if (this.hasItemFlag(ItemFlag.HIDE_ATTRIBUTES)) {
+-                tag.put(CraftMetaItem.ATTRIBUTES, new ItemAttributeModifiers(Collections.emptyList(), false));
+-            }
++            // Paper - don't save ItemFlag if the underlying data isn't present
+             return;
+         }
+ 
 @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
  
      @Override
diff --git a/work/CraftBukkit b/work/CraftBukkit
index 666f091c61..66fd94322c 160000
--- a/work/CraftBukkit
+++ b/work/CraftBukkit
@@ -1 +1 @@
-Subproject commit 666f091c61cefb90f6903a66e5426d15d948b1c0
+Subproject commit 66fd94322c5b1b8eb474c7a95aed9d048f995803