mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Cleanup RepairConfig leftovers in SalvageConfig
Some copy/pasta I forgot to remove
This commit is contained in:
parent
5080c68dce
commit
2fd5d7aa81
@ -42,41 +42,41 @@ public class SalvageConfig extends ConfigLoader {
|
|||||||
reason.add("Invalid material: " + key);
|
reason.add("Invalid material: " + key);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Repair Material Type
|
// Salvage Material Type
|
||||||
MaterialType salvageMaterialType = MaterialType.OTHER;
|
MaterialType salvageMaterialType = MaterialType.OTHER;
|
||||||
String repairMaterialTypeString = config.getString("Salvageables." + key + ".MaterialType", "OTHER");
|
String salvageMaterialTypeString = config.getString("Salvageables." + key + ".MaterialType", "OTHER");
|
||||||
|
|
||||||
if (!config.contains("Salvageables." + key + ".MaterialType") && itemMaterial != null) {
|
if (!config.contains("Salvageables." + key + ".MaterialType") && itemMaterial != null) {
|
||||||
ItemStack repairItem = new ItemStack(itemMaterial);
|
ItemStack salvageItem = new ItemStack(itemMaterial);
|
||||||
|
|
||||||
if (ItemUtils.isWoodTool(repairItem)) {
|
if (ItemUtils.isWoodTool(salvageItem)) {
|
||||||
salvageMaterialType = MaterialType.WOOD;
|
salvageMaterialType = MaterialType.WOOD;
|
||||||
}
|
}
|
||||||
else if (ItemUtils.isStoneTool(repairItem)) {
|
else if (ItemUtils.isStoneTool(salvageItem)) {
|
||||||
salvageMaterialType = MaterialType.STONE;
|
salvageMaterialType = MaterialType.STONE;
|
||||||
}
|
}
|
||||||
else if (ItemUtils.isStringTool(repairItem)) {
|
else if (ItemUtils.isStringTool(salvageItem)) {
|
||||||
salvageMaterialType = MaterialType.STRING;
|
salvageMaterialType = MaterialType.STRING;
|
||||||
}
|
}
|
||||||
else if (ItemUtils.isLeatherArmor(repairItem)) {
|
else if (ItemUtils.isLeatherArmor(salvageItem)) {
|
||||||
salvageMaterialType = MaterialType.LEATHER;
|
salvageMaterialType = MaterialType.LEATHER;
|
||||||
}
|
}
|
||||||
else if (ItemUtils.isIronArmor(repairItem) || ItemUtils.isIronTool(repairItem)) {
|
else if (ItemUtils.isIronArmor(salvageItem) || ItemUtils.isIronTool(salvageItem)) {
|
||||||
salvageMaterialType = MaterialType.IRON;
|
salvageMaterialType = MaterialType.IRON;
|
||||||
}
|
}
|
||||||
else if (ItemUtils.isGoldArmor(repairItem) || ItemUtils.isGoldTool(repairItem)) {
|
else if (ItemUtils.isGoldArmor(salvageItem) || ItemUtils.isGoldTool(salvageItem)) {
|
||||||
salvageMaterialType = MaterialType.GOLD;
|
salvageMaterialType = MaterialType.GOLD;
|
||||||
}
|
}
|
||||||
else if (ItemUtils.isDiamondArmor(repairItem) || ItemUtils.isDiamondTool(repairItem)) {
|
else if (ItemUtils.isDiamondArmor(salvageItem) || ItemUtils.isDiamondTool(salvageItem)) {
|
||||||
salvageMaterialType = MaterialType.DIAMOND;
|
salvageMaterialType = MaterialType.DIAMOND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
salvageMaterialType = MaterialType.valueOf(repairMaterialTypeString);
|
salvageMaterialType = MaterialType.valueOf(salvageMaterialTypeString);
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException ex) {
|
catch (IllegalArgumentException ex) {
|
||||||
reason.add(key + " has an invalid MaterialType of " + repairMaterialTypeString);
|
reason.add(key + " has an invalid MaterialType of " + salvageMaterialTypeString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user