mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-12-22 15:39:22 +01:00
fixed crafting modules miscalculating the amount of items they can craft
Closes #111
This commit is contained in:
parent
bee6f7ef0b
commit
6a170a1ace
1 changed files with 3 additions and 1 deletions
|
@ -167,8 +167,10 @@ public class CraftingModuleItem extends ModuleItem {
|
|||
|
||||
var equalityTypes = ItemFilter.getEqualityTypes(tile);
|
||||
var resultAmount = this.getResultAmountPerCraft(module, stack, equalityTypes);
|
||||
// calculate how many crafting *operations* to do (as opposed to how many *items* to craft)
|
||||
var requiredCrafts = Mth.ceil(stack.getCount() / (float) resultAmount);
|
||||
var toCraft = Math.min(craftableAmount, requiredCrafts);
|
||||
var craftableCrafts = Mth.ceil(craftableAmount / (float) resultAmount);
|
||||
var toCraft = Math.min(craftableCrafts, requiredCrafts);
|
||||
|
||||
var input = this.getInput(module);
|
||||
for (var i = 0; i < input.getSlots(); i++) {
|
||||
|
|
Loading…
Reference in a new issue