Skip to content

Commit

Permalink
Improve performance
Browse files Browse the repository at this point in the history
Co-authored-by: TheBusyBiscuit <[email protected]>
  • Loading branch information
EpicPlayerA10 and TheBusyBiscuit authored Jul 12, 2021
1 parent 407d5de commit df25a9e
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,13 @@ protected void handleCraftedItem(ItemStack outputItem, Block block, Inventory bl

if (outputInv != null) {
outputInv.addItem(outputItem);
} else if (InvUtils.fits(blockInv, outputItem)) {
blockInv.addItem(outputItem);
} else {
// fallback
SlimefunUtils.spawnItem(block.getLocation(), outputItem, ItemSpawnReason.MULTIBLOCK_MACHINE_OVERFLOW, true);
ItemStack rest = blockInv.addItem(outputItem).get(0);

// fallback: drop item
if (rest != null) {
SlimefunUtils.spawnItem(block.getLocation(), rest, ItemSpawnReason.MULTIBLOCK_MACHINE_OVERFLOW, true);
}
}
}

Expand Down

0 comments on commit df25a9e

Please sign in to comment.