From 7ffc581d32f846de65fd75a1f8e1f6d681733937 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 28 Apr 2024 14:20:52 +0200 Subject: [PATCH] Fix test compilation --- patches/server/General-ItemMeta-fixes.patch | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/patches/server/General-ItemMeta-fixes.patch b/patches/server/General-ItemMeta-fixes.patch index b3820c898c..981b7dfbc2 100644 --- a/patches/server/General-ItemMeta-fixes.patch +++ b/patches/server/General-ItemMeta-fixes.patch @@ -128,3 +128,38 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java +@@ -0,0 +0,0 @@ public class DeprecatedItemMetaCustomValueTest extends AbstractTestingBase { + public void testNBTTagStoring() { + CraftMetaItem itemMeta = this.createComplexItemMeta(); + +- CraftMetaItem.Applicator compound = new CraftMetaItem.Applicator(); ++ CraftMetaItem.Applicator compound = new CraftMetaItem.Applicator() {}; // Paper + itemMeta.applyToItem(compound); + + assertEquals(itemMeta, new CraftMetaItem(compound.build(), null)); // Paper +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/PersistentDataContainerTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/PersistentDataContainerTest.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/PersistentDataContainerTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/PersistentDataContainerTest.java +@@ -0,0 +0,0 @@ public class PersistentDataContainerTest extends AbstractTestingBase { + public void testNBTTagStoring() { + CraftMetaItem itemMeta = this.createComplexItemMeta(); + +- CraftMetaItem.Applicator compound = new CraftMetaItem.Applicator(); ++ CraftMetaItem.Applicator compound = new CraftMetaItem.Applicator() {}; // Paper + itemMeta.applyToItem(compound); + + assertEquals(itemMeta, new CraftMetaItem(compound.build(), null)); // Paper +@@ -0,0 +0,0 @@ public class PersistentDataContainerTest extends AbstractTestingBase { + assertEquals(List.of(), container.get(PersistentDataContainerTest.requestKey("list"), PersistentDataType.LIST.strings())); + + // Write and read the entire container to NBT +- final CraftMetaItem.Applicator storage = new CraftMetaItem.Applicator(); ++ final CraftMetaItem.Applicator storage = new CraftMetaItem.Applicator() {}; // Paper + craftItem.applyToItem(storage); + + final CraftMetaItem readItem = new CraftMetaItem(storage.build(), null); // Paper