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:
parent
6f042e60ad
commit
4704b9fa8f
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user