Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Test cloning enchanted CraftItemStacks
Dieser Commit ist enthalten in:
Ursprung
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()));
|
||||
}
|
||||
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren