diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/FromExperienceSource.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/FromExperienceSource.java index d1375c6c..073a89c2 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/FromExperienceSource.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/FromExperienceSource.java @@ -2,40 +2,38 @@ package net.Indyuce.mmocore.experience.source; import io.lumine.mythic.lib.api.MMOLineConfig; import net.Indyuce.mmocore.MMOCore; -import net.Indyuce.mmocore.api.player.PlayerData; -import net.Indyuce.mmocore.experience.source.type.ExperienceSource; -import net.Indyuce.mmocore.experience.source.type.SpecificExperienceSource; -import net.Indyuce.mmocore.manager.profession.ExperienceSourceManager; import net.Indyuce.mmocore.api.ConfigFile; +import net.Indyuce.mmocore.api.player.PlayerData; import net.Indyuce.mmocore.experience.dispenser.ExperienceDispenser; +import net.Indyuce.mmocore.experience.source.type.ExperienceSource; +import net.Indyuce.mmocore.manager.profession.ExperienceSourceManager; import org.apache.commons.lang.Validate; import java.util.ArrayList; import java.util.List; -public class FromExperienceSource extends SpecificExperienceSource { +public class FromExperienceSource extends ExperienceSource { + /** * Register all the children experience sources defined in experience-source.yml. */ - private final ArrayList experienceSources = new ArrayList<>(); - + private final List experienceSources = new ArrayList<>(); public FromExperienceSource(ExperienceDispenser dispenser, MMOLineConfig config) { - super(dispenser, config); - List list = new ConfigFile("exp-sources") - .getConfig().getStringList(config.getString("source")); + super(dispenser); + + List list = new ConfigFile("exp-sources").getConfig().getStringList(config.getString("source")); Validate.isTrue(list.size() != 0, "There is no source matching " + config.getString("key")); list.stream() .map(MMOLineConfig::new) .forEach(mmoLineConfig -> experienceSources.add(MMOCore.plugin.loadManager.loadExperienceSource(mmoLineConfig, dispenser))); - - } @Override public ExperienceSourceManager newManager() { - return new ExperienceSourceManager() { + return new ExperienceSourceManager<>() { + /** * Used to register all the children experience sources. */