mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +01:00
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:
parent
3a10b2d83c
commit
af98c8eb59
@ -108,10 +108,6 @@ public class Repair {
|
||||
}
|
||||
}
|
||||
|
||||
if (quantity <= 0) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
return quantity;
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user