1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Check for ItemStackWrappers in ItemStackAndInteger

This commit is contained in:
Andrew Wong 2021-05-18 12:05:38 +02:00
parent 6f042e60ad
commit 4704b9fa8f
No known key found for this signature in database
GPG Key ID: F59F2C3DA0936DE4

View File

@ -12,7 +12,14 @@ class ItemStackAndInteger {
ItemStackAndInteger(ItemStack item, int amount) {
this.number = amount;
this.item = item;
if (item instanceof ItemStackWrapper) {
this.item = new ItemStack(item.getType(), item.getAmount());
if (item.hasItemMeta()) {
this.item.setItemMeta(item.getItemMeta());
}
} else {
this.item = item;
}
}
public int getInt() {