mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-11-14 01:14:11 +00:00
Fix crafting calculation aborted by NPE (#747)
Co-authored-by: Maya <[email protected]>
This commit is contained in:
1 parent
388c04cada
commit
08707e61ab
1 file changed
+5
-3
@@ -193,9 +193,11 @@ public class ContainerCraftConfirm extends AEBaseContainer implements ICraftingC
|
||||
|
||||
if (toExtract.getStackSize() > 0 && toCraft.getStackSize() <= 0
|
||||
&& (missing == null || missing.getStackSize() <= 0)) {
|
||||
long available = items.getAvailableItem(toExtract, IterationCounter.fetchNewId())
|
||||
.getStackSize();
|
||||
toExtract.setUsedPercent(toExtract.getStackSize() / (available / 100f));
|
||||
IAEItemStack availableStack = items
|
||||
.getAvailableItem(toExtract, IterationCounter.fetchNewId());
|
||||
long available = (availableStack == null) ? 0 : availableStack.getStackSize();
|
||||
if (available > 0) toExtract.setUsedPercent(toExtract.getStackSize() / (available / 100f));
|
||||
else toExtract.setUsedPercent(0f);
|
||||
}
|
||||
|
||||
if (toExtract.getStackSize() > 0) {
|
||||
|
||||
Reference in new issue
Block a user