updates
This commit is contained in:
parent
1a64fa6daa
commit
82673d923f
@ -35,6 +35,10 @@ public class EntityPickupItemListener implements Listener {
|
|||||||
|
|
||||||
ItemStack itemStackOne = event.getItem().getItemStack();
|
ItemStack itemStackOne = event.getItem().getItemStack();
|
||||||
|
|
||||||
|
if (!this.isMaterialStackable(itemStackOne)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
event.getItem().remove();
|
event.getItem().remove();
|
||||||
|
|
||||||
@ -86,4 +90,12 @@ public class EntityPickupItemListener implements Listener {
|
|||||||
|
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isMaterialStackable(ItemStack itemStack) {
|
||||||
|
if (itemStack == null || itemStack.getType() == Material.AIR) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return itemStack.getMaxStackSize() > 1;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user