From 2042e0cdbd607d5569b7ea2b8ce1377d69ae3529 Mon Sep 17 00:00:00 2001 From: GJ Date: Fri, 18 Oct 2013 10:01:59 -0400 Subject: [PATCH] How did I not realize this would loop forever... --- .../nossr50/config/mods/CustomArmorConfig.java | 14 ++++++++------ .../nossr50/config/mods/CustomBlockConfig.java | 16 +++++++++------- .../nossr50/config/mods/CustomToolConfig.java | 18 ++++++++++-------- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/mods/CustomArmorConfig.java b/src/main/java/com/gmail/nossr50/config/mods/CustomArmorConfig.java index 8c8f5be92..92d843966 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/CustomArmorConfig.java +++ b/src/main/java/com/gmail/nossr50/config/mods/CustomArmorConfig.java @@ -52,12 +52,10 @@ public class CustomArmorConfig extends ConfigLoader { protected void loadKeys() { repairables = new ArrayList(); - while (!needsUpdate) { - loadArmor("Boots", customBoots); - loadArmor("Chestplates", customChestplates); - loadArmor("Helmets", customHelmets); - loadArmor("Leggings", customLeggings); - } + loadArmor("Boots", customBoots); + loadArmor("Chestplates", customChestplates); + loadArmor("Helmets", customHelmets); + loadArmor("Leggings", customLeggings); if (needsUpdate) { needsUpdate = false; @@ -66,6 +64,10 @@ public class CustomArmorConfig extends ConfigLoader { } private void loadArmor(String armorType, List materialList) { + if (needsUpdate) { + return; + } + ConfigurationSection armorSection = config.getConfigurationSection(armorType); if (armorSection == null) { diff --git a/src/main/java/com/gmail/nossr50/config/mods/CustomBlockConfig.java b/src/main/java/com/gmail/nossr50/config/mods/CustomBlockConfig.java index 1d64dd804..08211fc18 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/CustomBlockConfig.java +++ b/src/main/java/com/gmail/nossr50/config/mods/CustomBlockConfig.java @@ -43,13 +43,11 @@ public class CustomBlockConfig extends ConfigLoader { @Override protected void loadKeys() { - while (!needsUpdate) { - loadBlocks("Excavation", customExcavationBlocks); - loadBlocks("Herbalism", customHerbalismBlocks); - loadBlocks("Mining", customMiningBlocks); - loadBlocks("Woodcutting", customWoodcuttingBlocks); - loadBlocks("Ability_Blocks", customAbilityBlocks); - } + loadBlocks("Excavation", customExcavationBlocks); + loadBlocks("Herbalism", customHerbalismBlocks); + loadBlocks("Mining", customMiningBlocks); + loadBlocks("Woodcutting", customWoodcuttingBlocks); + loadBlocks("Ability_Blocks", customAbilityBlocks); if (needsUpdate) { needsUpdate = false; @@ -58,6 +56,10 @@ public class CustomBlockConfig extends ConfigLoader { } private void loadBlocks(String skillType, List blockList) { + if (needsUpdate) { + return; + } + ConfigurationSection skillSection = config.getConfigurationSection(skillType); if (skillSection == null) { diff --git a/src/main/java/com/gmail/nossr50/config/mods/CustomToolConfig.java b/src/main/java/com/gmail/nossr50/config/mods/CustomToolConfig.java index 364d7db9c..2592e1ade 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/CustomToolConfig.java +++ b/src/main/java/com/gmail/nossr50/config/mods/CustomToolConfig.java @@ -58,14 +58,12 @@ public class CustomToolConfig extends ConfigLoader { protected void loadKeys() { repairables = new ArrayList(); - while (!needsUpdate) { - loadTool("Axes", customAxes); - loadTool("Bows", customBows); - loadTool("Hoes", customHoes); - loadTool("Pickaxes", customPickaxes); - loadTool("Shovels", customShovels); - loadTool("Swords", customSwords); - } + loadTool("Axes", customAxes); + loadTool("Bows", customBows); + loadTool("Hoes", customHoes); + loadTool("Pickaxes", customPickaxes); + loadTool("Shovels", customShovels); + loadTool("Swords", customSwords); if (needsUpdate) { needsUpdate = false; @@ -74,6 +72,10 @@ public class CustomToolConfig extends ConfigLoader { } private void loadTool(String toolType, List materialList) { + if (needsUpdate) { + return; + } + ConfigurationSection toolSection = config.getConfigurationSection(toolType); if (toolSection == null) {