removeItem now validates item quantities prior to attempting removal

This commit is contained in:
Ceikry
2023-07-09 04:51:10 +00:00
committed by Ryan
parent 6d96611d69
commit d58d4857b0
@@ -330,6 +330,8 @@ public class Container {
*/
@CheckReturnValue
public boolean remove(Item item, int slot, boolean fireListener) {
if (!contains(item.getId(), item.getAmount()))
return false;
Item oldItem = items[slot];
if (oldItem == null || oldItem.getId() != item.getId()) {
return false;