public void load(MagickElement element, ConfigurationSection spellSection) throws Exception { for (String spellKey : spellSection.getKeys(false)) { ConfigurationSection spell = spellSection.getConfigurationSection(spellKey); SpellEntry spellEntry = new SpellEntry(this.element); spellEntry.load(element, spell); spellRegistries.put(spellKey, spellEntry); } }
public void save(MagickElement element, ConfigurationSection spellSection) throws Exception { for (Entry<String, SpellEntry> spellRegistry : spellRegistries.entrySet()) { String spellKey = spellRegistry.getKey(); SpellEntry spellEntry = spellRegistry.getValue(); if (!spellSection.contains(spellKey)) spellSection.createSection(spellKey); ConfigurationSection spell = spellSection.getConfigurationSection(spellKey); spellEntry.save(element, spell); } }
@Override public void after(MagickElement element) { element.commands.put("spell", new SpellCommand()); for (SpellEntry entry : spellRegistries.values()) entry.after(element); }