mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
How did I not realize this would loop forever...
This commit is contained in:
parent
2662fee9fb
commit
2042e0cdbd
@ -52,12 +52,10 @@ public class CustomArmorConfig extends ConfigLoader {
|
|||||||
protected void loadKeys() {
|
protected void loadKeys() {
|
||||||
repairables = new ArrayList<Repairable>();
|
repairables = new ArrayList<Repairable>();
|
||||||
|
|
||||||
while (!needsUpdate) {
|
loadArmor("Boots", customBoots);
|
||||||
loadArmor("Boots", customBoots);
|
loadArmor("Chestplates", customChestplates);
|
||||||
loadArmor("Chestplates", customChestplates);
|
loadArmor("Helmets", customHelmets);
|
||||||
loadArmor("Helmets", customHelmets);
|
loadArmor("Leggings", customLeggings);
|
||||||
loadArmor("Leggings", customLeggings);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needsUpdate) {
|
if (needsUpdate) {
|
||||||
needsUpdate = false;
|
needsUpdate = false;
|
||||||
@ -66,6 +64,10 @@ public class CustomArmorConfig extends ConfigLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadArmor(String armorType, List<Material> materialList) {
|
private void loadArmor(String armorType, List<Material> materialList) {
|
||||||
|
if (needsUpdate) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ConfigurationSection armorSection = config.getConfigurationSection(armorType);
|
ConfigurationSection armorSection = config.getConfigurationSection(armorType);
|
||||||
|
|
||||||
if (armorSection == null) {
|
if (armorSection == null) {
|
||||||
|
@ -43,13 +43,11 @@ public class CustomBlockConfig extends ConfigLoader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void loadKeys() {
|
protected void loadKeys() {
|
||||||
while (!needsUpdate) {
|
loadBlocks("Excavation", customExcavationBlocks);
|
||||||
loadBlocks("Excavation", customExcavationBlocks);
|
loadBlocks("Herbalism", customHerbalismBlocks);
|
||||||
loadBlocks("Herbalism", customHerbalismBlocks);
|
loadBlocks("Mining", customMiningBlocks);
|
||||||
loadBlocks("Mining", customMiningBlocks);
|
loadBlocks("Woodcutting", customWoodcuttingBlocks);
|
||||||
loadBlocks("Woodcutting", customWoodcuttingBlocks);
|
loadBlocks("Ability_Blocks", customAbilityBlocks);
|
||||||
loadBlocks("Ability_Blocks", customAbilityBlocks);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needsUpdate) {
|
if (needsUpdate) {
|
||||||
needsUpdate = false;
|
needsUpdate = false;
|
||||||
@ -58,6 +56,10 @@ public class CustomBlockConfig extends ConfigLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadBlocks(String skillType, List<MaterialData> blockList) {
|
private void loadBlocks(String skillType, List<MaterialData> blockList) {
|
||||||
|
if (needsUpdate) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ConfigurationSection skillSection = config.getConfigurationSection(skillType);
|
ConfigurationSection skillSection = config.getConfigurationSection(skillType);
|
||||||
|
|
||||||
if (skillSection == null) {
|
if (skillSection == null) {
|
||||||
|
@ -58,14 +58,12 @@ public class CustomToolConfig extends ConfigLoader {
|
|||||||
protected void loadKeys() {
|
protected void loadKeys() {
|
||||||
repairables = new ArrayList<Repairable>();
|
repairables = new ArrayList<Repairable>();
|
||||||
|
|
||||||
while (!needsUpdate) {
|
loadTool("Axes", customAxes);
|
||||||
loadTool("Axes", customAxes);
|
loadTool("Bows", customBows);
|
||||||
loadTool("Bows", customBows);
|
loadTool("Hoes", customHoes);
|
||||||
loadTool("Hoes", customHoes);
|
loadTool("Pickaxes", customPickaxes);
|
||||||
loadTool("Pickaxes", customPickaxes);
|
loadTool("Shovels", customShovels);
|
||||||
loadTool("Shovels", customShovels);
|
loadTool("Swords", customSwords);
|
||||||
loadTool("Swords", customSwords);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needsUpdate) {
|
if (needsUpdate) {
|
||||||
needsUpdate = false;
|
needsUpdate = false;
|
||||||
@ -74,6 +72,10 @@ public class CustomToolConfig extends ConfigLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadTool(String toolType, List<Material> materialList) {
|
private void loadTool(String toolType, List<Material> materialList) {
|
||||||
|
if (needsUpdate) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ConfigurationSection toolSection = config.getConfigurationSection(toolType);
|
ConfigurationSection toolSection = config.getConfigurationSection(toolType);
|
||||||
|
|
||||||
if (toolSection == null) {
|
if (toolSection == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user