mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-25 17:51:31 +01:00
Remove unit test based on now incorrect assumptions
By: md_5 <git@md-5.net>
This commit is contained in:
parent
2513cf0b73
commit
a75c80e93d
@ -996,7 +996,7 @@ public class CraftEventFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static PrepareAnvilEvent callPrepareAnvilEvent(InventoryView view, ItemStack item) {
|
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.getView().getPlayer().getServer().getPluginManager().callEvent(event);
|
||||||
event.getInventory().setItem(2, event.getResult());
|
event.getInventory().setItem(2, event.getResult());
|
||||||
return event;
|
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) {
|
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());
|
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);
|
EntityBreedEvent event = new EntityBreedEvent((LivingEntity) child.getBukkitEntity(), (LivingEntity) mother.getBukkitEntity(), (LivingEntity) father.getBukkitEntity(), breederEntity, bredWithStack, experience);
|
||||||
child.world.getServer().getPluginManager().callEvent(event);
|
child.world.getServer().getPluginManager().callEvent(event);
|
||||||
|
@ -25,12 +25,4 @@ public class NMSCraftItemStackTest extends AbstractTestingBase {
|
|||||||
assertThat(clone.getData(), is(itemStack.getData()));
|
assertThat(clone.getData(), is(itemStack.getData()));
|
||||||
assertThat(clone, is(itemStack));
|
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user