Best way to handle minimum quantities.

Check repair function first, assuming the item isn't null, otherwise
check the config. If not found, check config.
This commit is contained in:
GJ 2013-11-04 11:01:14 -05:00
parent 3a10b2d83c
commit af98c8eb59
2 changed files with 2 additions and 6 deletions

View File

@ -108,10 +108,6 @@ public class Repair {
}
}
if (quantity <= 0) {
return 2;
}
return quantity;
}
}

View File

@ -132,10 +132,10 @@ public class RepairConfig extends ConfigLoader {
}
// Minimum Quantity
int minimumQuantity = (itemMaterial != null && repairMaterial != null ? Repair.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), repairMaterial, repairMetadata) : config.getInt("Repairables." + key + ".MinimumQuantity", 2));
int minimumQuantity = (itemMaterial != null ? Repair.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), repairMaterial, repairMetadata) : config.getInt("Repairables." + key + ".MinimumQuantity", 2));
if (minimumQuantity <= 0 && itemMaterial != null) {
minimumQuantity = Repair.getRepairAndSalvageQuantities(new ItemStack(itemMaterial));
minimumQuantity = config.getInt("Repairables." + key + ".MinimumQuantity", 2);
}
if (minimumQuantity <= 0) {