How did I not realize this would loop forever...

This commit is contained in:
GJ 2013-10-18 10:01:59 -04:00
parent 2662fee9fb
commit 2042e0cdbd
3 changed files with 27 additions and 21 deletions

View File

@ -52,12 +52,10 @@ public class CustomArmorConfig extends ConfigLoader {
protected void loadKeys() {
repairables = new ArrayList<Repairable>();
while (!needsUpdate) {
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<Material> materialList) {
if (needsUpdate) {
return;
}
ConfigurationSection armorSection = config.getConfigurationSection(armorType);
if (armorSection == null) {

View File

@ -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);
}
if (needsUpdate) {
needsUpdate = false;
@ -58,6 +56,10 @@ public class CustomBlockConfig extends ConfigLoader {
}
private void loadBlocks(String skillType, List<MaterialData> blockList) {
if (needsUpdate) {
return;
}
ConfigurationSection skillSection = config.getConfigurationSection(skillType);
if (skillSection == null) {

View File

@ -58,14 +58,12 @@ public class CustomToolConfig extends ConfigLoader {
protected void loadKeys() {
repairables = new ArrayList<Repairable>();
while (!needsUpdate) {
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<Material> materialList) {
if (needsUpdate) {
return;
}
ConfigurationSection toolSection = config.getConfigurationSection(toolType);
if (toolSection == null) {