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:
Phoenix616 2017-12-04 16:39:23 +01:00
parent 0354258251
commit 8687b94e22

View File

@ -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};
}