Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: da08d022 SPIGOT-4700: Add PlayerFishEvent.State.REEL_IN 0cef14e4 Remove draft API from selectEntities CraftBukkit Changes: a46fdbc6 Remove outdated build delay. 3697519b SPIGOT-4708: Fix ExactChoice recipes neglecting material 9ead7009 SPIGOT-4677: Add minecraft.admin.command_feedback permission c3749a23 Remove the Damage tag from items when it is 0. f74c7b95 SPIGOT-4706: Can't interact with active item 494eef45 Mention requirement of JIRA ticket for bug fixes 51d62dec SPIGOT-4702: Exception when middle clicking certain slots be557e69 SPIGOT-4700: Add PlayerFishEvent.State.REEL_IN
This commit is contained in:
@@ -11,7 +11,7 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set.
|
||||
Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index bc8fb2816..ca9399bdb 100644
|
||||
index bc8fb28163..ca9399bdbe 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftItemStack extends ItemStack {
|
||||
@@ -24,7 +24,7 @@ index bc8fb2816..ca9399bdb 100644
|
||||
|
||||
static boolean hasItemMeta(net.minecraft.server.ItemStack item) {
|
||||
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
index 0ad0004b9..7455461f1 100644
|
||||
index d4f4508cce..3a2793f322 100644
|
||||
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
@@ -0,0 +0,0 @@ import static org.hamcrest.Matchers.*;
|
||||
@@ -36,23 +36,24 @@ index 0ad0004b9..7455461f1 100644
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -0,0 +0,0 @@ public class ItemMetaTest extends AbstractTestingBase {
|
||||
ItemStack pureBukkit = new ItemStack(Material.SHEARS);
|
||||
assertThat("Bukkit and craft stacks should be similar", craft.isSimilar(pureBukkit), is(true));
|
||||
assertThat("Bukkit and craft stacks should be equal", craft.equals(pureBukkit), is(true));
|
||||
+ // Paper start - test additional ItemMeta damage cases
|
||||
+ ItemStack clone = CraftItemStack.asBukkitCopy(CraftItemStack.asNMSCopy(craft));
|
||||
+ assertThat("Bukkit and craft stacks should be similar", craft.isSimilar(clone), is(true));
|
||||
+ assertThat("Bukkit and craft stacks should be equal", craft.equals(clone), is(true));
|
||||
|
||||
assertThat("noTag and enchanted stacks should not be similar", noTag.isSimilar(enchanted), is(false));
|
||||
assertThat("noTag and enchanted stacks should not be equal", noTag.equals(enchanted), is(false));
|
||||
+
|
||||
+ pureBukkit = new ItemStack(Material.DIAMOND_SWORD);
|
||||
+ // Paper start - test additional ItemMeta damage cases
|
||||
+ ItemStack clone = CraftItemStack.asBukkitCopy(CraftItemStack.asNMSCopy(noDamage));
|
||||
+ assertThat("Bukkit and craft stacks should be similar", noDamage.isSimilar(clone), is(true));
|
||||
+ assertThat("Bukkit and craft stacks should be equal", noDamage.equals(clone), is(true));
|
||||
+
|
||||
+ ItemStack pureBukkit = new ItemStack(Material.DIAMOND_SWORD);
|
||||
+ pureBukkit.setDurability((short) 2);
|
||||
+ net.minecraft.server.ItemStack nms = CraftItemStack.asNMSCopy(pureBukkit);
|
||||
+ ItemStack other = CraftItemStack.asBukkitCopy(nms);
|
||||
+
|
||||
+ assertThat("Bukkit and NMS ItemStack copies should be similar", pureBukkit.isSimilar(other), is(true));
|
||||
+ assertThat("Bukkit and NMS ItemStack copies should be equal", pureBukkit.equals(other), is(true));
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ private void testItemMeta(ItemStack stack) {
|
||||
+ assertThat("Should not have ItemMeta", stack.hasItemMeta(), is(false));
|
||||
+
|
||||
@@ -77,10 +78,9 @@ index 0ad0004b9..7455461f1 100644
|
||||
+
|
||||
+ testItemMeta(itemStack);
|
||||
+ testItemMeta(CraftItemStack.asCraftCopy(itemStack));
|
||||
+ }
|
||||
}
|
||||
+ // Paper end
|
||||
+
|
||||
|
||||
@Test
|
||||
public void testBlockStateMeta() {
|
||||
List<Block> queue = new ArrayList<>();
|
||||
--
|
||||
Reference in New Issue
Block a user