From 64032adfd28dbe545ce9dab346a1b9abbc56d349 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 18 Nov 2016 09:11:17 +1100 Subject: [PATCH] Remove unit test based on now incorrect assumptions --- .../org/bukkit/craftbukkit/event/CraftEventFactory.java | 4 ++-- .../craftbukkit/inventory/NMSCraftItemStackTest.java | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 869ea6ac62..1c67ee9f57 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -996,7 +996,7 @@ public class CraftEventFactory { } public static PrepareAnvilEvent callPrepareAnvilEvent(InventoryView view, ItemStack item) { - PrepareAnvilEvent event = new PrepareAnvilEvent(view, CraftItemStack.asCraftMirror(item).clone()); + PrepareAnvilEvent event = new PrepareAnvilEvent(view, CraftItemStack.asCraftMirror(item)); event.getView().getPlayer().getServer().getPluginManager().callEvent(event); event.getInventory().setItem(2, event.getResult()); return event; @@ -1016,7 +1016,7 @@ public class CraftEventFactory { public static EntityBreedEvent callEntityBreedEvent(EntityLiving child, EntityLiving mother, EntityLiving father, EntityLiving breeder, ItemStack bredWith, int experience) { org.bukkit.entity.LivingEntity breederEntity = (LivingEntity)(breeder == null ? null : breeder.getBukkitEntity()); - CraftItemStack bredWithStack = (bredWith.isEmpty()) ? null : CraftItemStack.asCraftMirror(bredWith).clone(); + CraftItemStack bredWithStack = CraftItemStack.asCraftMirror(bredWith); EntityBreedEvent event = new EntityBreedEvent((LivingEntity) child.getBukkitEntity(), (LivingEntity) mother.getBukkitEntity(), (LivingEntity) father.getBukkitEntity(), breederEntity, bredWithStack, experience); child.world.getServer().getPluginManager().callEvent(event); diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java index 1f5a6a32f1..10baff3919 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java @@ -25,12 +25,4 @@ public class NMSCraftItemStackTest extends AbstractTestingBase { assertThat(clone.getData(), is(itemStack.getData())); assertThat(clone, is(itemStack)); } - - @Test - public void testCloneNullItem() throws Exception { - net.minecraft.server.ItemStack nmsItemStack = null; - ItemStack itemStack = CraftItemStack.asCraftMirror(nmsItemStack); - ItemStack clone = itemStack.clone(); - assertThat(clone, is(itemStack)); - } }