mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-09 04:09:54 +01:00
Test cloning enchanted CraftItemStacks
This commit is contained in:
parent
18437f6819
commit
acfb4f2fbe
@ -0,0 +1,28 @@
|
||||
package org.bukkit.craftbukkit.inventory;
|
||||
|
||||
import net.minecraft.server.Enchantment;
|
||||
import net.minecraft.server.StatisticList;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
public class CraftItemStackTest {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
StatisticList.a();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCloneEnchantedItem() throws Exception {
|
||||
net.minecraft.server.ItemStack nmsItemStack = new net.minecraft.server.ItemStack(net.minecraft.server.Item.POTION);
|
||||
nmsItemStack.addEnchantment(Enchantment.DAMAGE_ALL, 1);
|
||||
ItemStack itemStack = new CraftItemStack(nmsItemStack);
|
||||
ItemStack clone = itemStack.clone();
|
||||
assert (clone.getType().equals(itemStack.getType()));
|
||||
assert (clone.getAmount() == itemStack.getAmount());
|
||||
assert (clone.getDurability() == itemStack.getDurability());
|
||||
assert (clone.getEnchantments().equals(itemStack.getEnchantments()));
|
||||
assert (clone.getTypeId() == itemStack.getTypeId());
|
||||
assert (clone.getData().equals(itemStack.getData()));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user