Skip to content

Commit

Permalink
fixed method in Utils not accounting for an empty itemstack
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Sep 15, 2023
1 parent 636783d commit 5d86571
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/src/main/java/muramasa/antimatter/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,12 @@ public static boolean transferItems(PlatformItemHandler from, PlatformItemHandle
continue;
}
ItemStack inserted = insertItem(to, toInsert, true);
if (inserted.getCount() < toInsert.getCount()) {
if (inserted.isEmpty()){
insertItem(to, toInsert, false);
from.extractItem(i, toInsert.getCount(), false);
if (!successful) successful = true;
if (once) break;
} else if (inserted.getCount() < toInsert.getCount()) {
int actual = toInsert.getCount() - inserted.getCount();
toInsert.setCount(toInsert.getCount() - inserted.getCount());
insertItem(to, toInsert, false);
Expand Down

0 comments on commit 5d86571

Please sign in to comment.