fixed invalid crafting count issue
@@ -114,10 +114,13 @@ public class ConfigSchema implements UpgradeSchema {
return true;
}
- for (int i = 0; i < materials.length; i++) {
- if (i < definition.materialSlotCount
- && !acceptsMaterial(itemStack, i, materials[i])
- && materials[i].getCount() >= getOutcomeFromMaterial(materials[i], i).map(outcome -> outcome.material.count).orElse(0)) {
+ if (materials.length < definition.materialSlotCount) {
+ return false;
+ }
+
+ for (int i = 0; i < definition.materialSlotCount; i++) {
+ if (!acceptsMaterial(itemStack, i, materials[i])
+ || materials[i].getCount() < getOutcomeFromMaterial(materials[i], i).map(outcome -> outcome.material.count).orElse(0)) {
return false;
}
}
