mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-12-23 15:39:23 +01:00
backport 6a170a1ace
This commit is contained in:
parent
ae182423c1
commit
db58a7b105
1 changed files with 3 additions and 1 deletions
|
@ -169,8 +169,10 @@ public class CraftingModuleItem extends ModuleItem {
|
||||||
|
|
||||||
ItemEquality[] equalityTypes = ItemFilter.getEqualityTypes(tile);
|
ItemEquality[] equalityTypes = ItemFilter.getEqualityTypes(tile);
|
||||||
int resultAmount = this.getResultAmountPerCraft(module, stack, equalityTypes);
|
int resultAmount = this.getResultAmountPerCraft(module, stack, equalityTypes);
|
||||||
|
// calculate how many crafting *operations* to do (as opposed to how many *items* to craft)
|
||||||
int requiredCrafts = MathHelper.ceil(stack.getCount() / (float) resultAmount);
|
int requiredCrafts = MathHelper.ceil(stack.getCount() / (float) resultAmount);
|
||||||
int toCraft = Math.min(craftableAmount, requiredCrafts);
|
int craftableCrafts = MathHelper.ceil(craftableAmount / (float) resultAmount);
|
||||||
|
int toCraft = Math.min(craftableCrafts, requiredCrafts);
|
||||||
|
|
||||||
ItemStackHandler input = this.getInput(module);
|
ItemStackHandler input = this.getInput(module);
|
||||||
for (int i = 0; i < input.getSlots(); i++) {
|
for (int i = 0; i < input.getSlots(); i++) {
|
||||||
|
|
Loading…
Reference in a new issue