Delegate ItemStack (#10852)

This commit is contained in:
Jake Potrebic 2024-06-17 12:12:42 -07:00 committed by GitHub
parent 13992b17c7
commit bf8552f0f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 1611 additions and 20 deletions

View file

@ -25,10 +25,10 @@ index a71717fe99e78c480747cc61ab30b53b6667fde7..080ab25d3585552c1abd62a9992d48bf
@Override
diff --git a/src/test/java/io/papermc/paper/util/ItemStackRepairCheckTest.java b/src/test/java/io/papermc/paper/util/ItemStackRepairCheckTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..6b8d360ef86e181a680ad77f28b7dd7368dddfe7
index 0000000000000000000000000000000000000000..9f8abe2376f16aeffe4e9f90a2da04b7e3a55429
--- /dev/null
+++ b/src/test/java/io/papermc/paper/util/ItemStackRepairCheckTest.java
@@ -0,0 +1,48 @@
@@ -0,0 +1,41 @@
+package io.papermc.paper.util;
+
+import org.bukkit.Material;
@ -69,11 +69,4 @@ index 0000000000000000000000000000000000000000..6b8d360ef86e181a680ad77f28b7dd73
+
+ assertFalse(diamond.canRepair(new ItemStack(Material.OAK_BUTTON)), "diamond can repair oak button");
+ }
+
+ @Test
+ public void testInvalidItem() {
+ ItemStack badItemStack = new ItemStack(Material.ACACIA_WALL_SIGN);
+
+ assertFalse(badItemStack.isRepairableBy(new ItemStack(Material.DIAMOND)), "acacia wall sign is repairable by diamond");
+ }
+}