mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-10-31 23:59:37 +01:00
Make sure the maxStackSize isn't zero (Fixes #87)
By returning an empty array here we completely stop the transaction if the max stack size somehow manages to be zero.
This commit is contained in:
parent
0354258251
commit
8687b94e22
@ -311,6 +311,9 @@ public class InventoryUtil {
|
||||
*/
|
||||
public static ItemStack[] getItemsStacked(ItemStack item) {
|
||||
int maxStackSize = getMaxStackSize(item);
|
||||
if (maxStackSize == 0) {
|
||||
return new ItemStack[]{};
|
||||
}
|
||||
if (item.getAmount() <= maxStackSize) {
|
||||
return new ItemStack[]{item};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user