This commit is contained in:
Ka0rX 2022-07-28 12:42:06 +02:00
parent b3d783dea4
commit 7141039485
4 changed files with 15 additions and 11 deletions

View File

@ -88,6 +88,7 @@ public class MMOCore extends JavaPlugin {
public final MMOLoadManager loadManager = new MMOLoadManager(); public final MMOLoadManager loadManager = new MMOLoadManager();
public final RestrictionManager restrictionManager = new RestrictionManager(); public final RestrictionManager restrictionManager = new RestrictionManager();
public final SkillTreeManager skillTreeManager = new SkillTreeManager(); public final SkillTreeManager skillTreeManager = new SkillTreeManager();
public final StatManager statManager = new StatManager();
// Profession managers // Profession managers
public final CustomBlockManager mineManager = new CustomBlockManager(); public final CustomBlockManager mineManager = new CustomBlockManager();
@ -142,7 +143,8 @@ public class MMOCore extends JavaPlugin {
loadManager.registerLoader(new MythicMobsMMOLoader()); loadManager.registerLoader(new MythicMobsMMOLoader());
} }
public void enable() { @Override
public void onEnable() {
new SpigotPlugin(70575, this).checkForUpdate(); new SpigotPlugin(70575, this).checkForUpdate();
new Metrics(this); new Metrics(this);
saveDefaultConfig(); saveDefaultConfig();
@ -419,7 +421,7 @@ public class MMOCore extends JavaPlugin {
// Drop tables must be loaded before professions // Drop tables must be loaded before professions
dropTableManager.initialize(clearBefore); dropTableManager.initialize(clearBefore);
statManager.initialize(clearBefore);
professionManager.initialize(clearBefore); professionManager.initialize(clearBefore);
classManager.initialize(clearBefore); classManager.initialize(clearBefore);

View File

@ -1,6 +1,6 @@
package net.Indyuce.mmocore.quest; package net.Indyuce.mmocore.quest;
import net.Indyuce.mmocore.quest.compat.BeautyQuestsModule; import net.Indyuce.mmocore.quest.compat.BeautyQuestModule;
import net.Indyuce.mmocore.quest.compat.BlackVeinQuestsModule; import net.Indyuce.mmocore.quest.compat.BlackVeinQuestsModule;
import net.Indyuce.mmocore.quest.compat.QuestCreatorModule; import net.Indyuce.mmocore.quest.compat.QuestCreatorModule;
import net.Indyuce.mmocore.quest.compat.QuestModule; import net.Indyuce.mmocore.quest.compat.QuestModule;
@ -11,7 +11,7 @@ import javax.inject.Provider;
public enum QuestModuleType { public enum QuestModuleType {
MMOCORE("MMOCore", MMOCoreQuestModule::new), MMOCORE("MMOCore", MMOCoreQuestModule::new),
QUESTS("Quests", BlackVeinQuestsModule::new), QUESTS("Quests", BlackVeinQuestsModule::new),
BEAUTY_QUEST("BeautyQuests", BeautyQuestsModule::new), BEAUTY_QUEST("BeautyQuests", BeautyQuestModule::new),
QUEST_CREATOR("QuestCreator", QuestCreatorModule::new); QUEST_CREATOR("QuestCreator", QuestCreatorModule::new);
private final String pluginName; private final String pluginName;

View File

@ -5,7 +5,6 @@ import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.MMOLineConfig; import io.lumine.mythic.lib.api.MMOLineConfig;
import io.lumine.mythic.lib.player.modifier.PlayerModifier; import io.lumine.mythic.lib.player.modifier.PlayerModifier;
import io.lumine.mythic.lib.util.configobject.ConfigObject; import io.lumine.mythic.lib.util.configobject.ConfigObject;
import io.lumine.mythic.lib.util.configobject.LineConfigObject;
import net.Indyuce.mmocore.MMOCore; import net.Indyuce.mmocore.MMOCore;
import net.Indyuce.mmocore.api.player.PlayerData; import net.Indyuce.mmocore.api.player.PlayerData;
import net.Indyuce.mmocore.api.quest.trigger.Trigger; import net.Indyuce.mmocore.api.quest.trigger.Trigger;
@ -80,11 +79,14 @@ public class SkillTreeNode implements Unlockable {
for (String level : section.getKeys(false)) { for (String level : section.getKeys(false)) {
int value = Integer.parseInt(level); int value = Integer.parseInt(level);
for (String str : section.getStringList(level)) { for (String str : section.getStringList(level)) {
Trigger trigger = MMOCore.plugin.loadManager.loadTrigger(new MMOLineConfig(str)); List<Trigger> triggerList = MMOCore.plugin.loadManager.loadTrigger(new MMOLineConfig(str));
if (!triggers.containsKey(value)) { for (Trigger trigger : triggerList) {
triggers.put(value, new ArrayList<>()); if (!triggers.containsKey(value)) {
triggers.put(value, new ArrayList<>());
}
triggers.get(value).add(trigger);
} }
triggers.get(value).add(trigger);
} }
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
@ -98,7 +100,7 @@ public class SkillTreeNode implements Unlockable {
for (String level : section.getKeys(false)) { for (String level : section.getKeys(false)) {
int value = Integer.parseInt(level); int value = Integer.parseInt(level);
for (String str : section.getStringList(level)) { for (String str : section.getStringList(level)) {
PlayerModifier modifier = MythicLib.plugin.getModifiers().loadPlayerModifier(new LineConfigObject(new MMOLineConfig(str))); PlayerModifier modifier = MythicLib.plugin.getModifiers().loadPlayerModifier(new MMOLineConfig(str));
if (!modifiers.containsKey(value)) { if (!modifiers.containsKey(value)) {
modifiers.put(value, new ArrayList<>()); modifiers.put(value, new ArrayList<>());
} }
@ -116,7 +118,7 @@ public class SkillTreeNode implements Unlockable {
maxChildren = config.contains("max-children") ? config.getInt("max-children") : 1; maxChildren = config.contains("max-children") ? config.getInt("max-children") : 1;
//If coordinates are precised adn we are not wiht an automaticTree we set them up //If coordinates are precised adn we are not wiht an automaticTree we set them up
if ((!(tree instanceof AutomaticSkillTree))) { if ((!(tree instanceof AutomaticSkillTree))) {
Validate.isTrue(config.contains("coordinates.x") && config.contains("coordinates.y"),"No coordinates specified"); Validate.isTrue(config.contains("coordinates.x") && config.contains("coordinates.y"), "No coordinates specified");
coordinates = new IntegerCoordinates(config.getInt("coordinates.x"), config.getInt("coordinates.y")); coordinates = new IntegerCoordinates(config.getInt("coordinates.x"), config.getInt("coordinates.y"));
} }
} }