From af98c8eb59beed802479cd0b8c243b298e17d9b9 Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 4 Nov 2013 11:01:14 -0500 Subject: [PATCH] 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. --- src/main/java/com/gmail/nossr50/skills/repair/Repair.java | 4 ---- .../com/gmail/nossr50/skills/repair/config/RepairConfig.java | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java index 349a3e524..b91f9bd99 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java @@ -108,10 +108,6 @@ public class Repair { } } - if (quantity <= 0) { - return 2; - } - return quantity; } } diff --git a/src/main/java/com/gmail/nossr50/skills/repair/config/RepairConfig.java b/src/main/java/com/gmail/nossr50/skills/repair/config/RepairConfig.java index d5fcbcb73..767857f6f 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/config/RepairConfig.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/config/RepairConfig.java @@ -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) {