mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Added error message for missing Repairables section (rather than throw NPE)
This commit is contained in:
parent
188b0f9813
commit
7eab20ef56
@ -3,6 +3,7 @@ package com.gmail.nossr50.config.skills.repair;
|
|||||||
import com.gmail.nossr50.config.ConfigLoader;
|
import com.gmail.nossr50.config.ConfigLoader;
|
||||||
import com.gmail.nossr50.datatypes.skills.ItemType;
|
import com.gmail.nossr50.datatypes.skills.ItemType;
|
||||||
import com.gmail.nossr50.datatypes.skills.MaterialType;
|
import com.gmail.nossr50.datatypes.skills.MaterialType;
|
||||||
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
||||||
import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
|
import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
|
||||||
import com.gmail.nossr50.util.ItemUtils;
|
import com.gmail.nossr50.util.ItemUtils;
|
||||||
@ -26,7 +27,13 @@ public class RepairConfig extends ConfigLoader {
|
|||||||
protected void loadKeys() {
|
protected void loadKeys() {
|
||||||
repairables = new ArrayList<Repairable>();
|
repairables = new ArrayList<Repairable>();
|
||||||
|
|
||||||
|
if (!config.isConfigurationSection("Repairables")) {
|
||||||
|
mcMMO.p.getLogger().severe("Could not find Repairables section in " + fileName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ConfigurationSection section = config.getConfigurationSection("Repairables");
|
ConfigurationSection section = config.getConfigurationSection("Repairables");
|
||||||
|
|
||||||
Set<String> keys = section.getKeys(false);
|
Set<String> keys = section.getKeys(false);
|
||||||
|
|
||||||
for (String key : keys) {
|
for (String key : keys) {
|
||||||
|
Loading…
Reference in New Issue
Block a user