Check if mcMMO is still installed on reload, fixes #526

This commit is contained in:
BuildTools 2018-11-17 19:43:51 -05:00
parent 447eaff49c
commit 4f70cb6aea

View File

@ -2263,7 +2263,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (config.contains("quests." + questName + ".rewards.mcmmo-levels")) { if (config.contains("quests." + questName + ".rewards.mcmmo-levels")) {
if (Quests.checkList(config.getList("quests." + questName + ".rewards.mcmmo-levels"), Integer.class)) { if (Quests.checkList(config.getList("quests." + questName + ".rewards.mcmmo-levels"), Integer.class)) {
for (String skill : config.getStringList("quests." + questName + ".rewards.mcmmo-skills")) { for (String skill : config.getStringList("quests." + questName + ".rewards.mcmmo-skills")) {
if (Quests.getMcMMOSkill(skill) == null) { if (Quests.mcmmo == null) {
skipQuestProcess("" + skill + " in mcmmo-skills: Reward in Quest " + quest.name + " requires the mcMMO plugin!");
} else if (Quests.getMcMMOSkill(skill) == null) {
skipQuestProcess("" + skill + " in mcmmo-skills: Reward in Quest " + quest.name + " is not a valid mcMMO skill name!"); skipQuestProcess("" + skill + " in mcmmo-skills: Reward in Quest " + quest.name + " is not a valid mcMMO skill name!");
} }
} }
@ -2286,7 +2288,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (config.contains("quests." + questName + ".rewards.heroes-exp-amounts")) { if (config.contains("quests." + questName + ".rewards.heroes-exp-amounts")) {
if (Quests.checkList(config.getList("quests." + questName + ".rewards.heroes-exp-amounts"), Double.class)) { if (Quests.checkList(config.getList("quests." + questName + ".rewards.heroes-exp-amounts"), Double.class)) {
for (String heroClass : config.getStringList("quests." + questName + ".rewards.heroes-exp-classes")) { for (String heroClass : config.getStringList("quests." + questName + ".rewards.heroes-exp-classes")) {
if (Quests.heroes.getClassManager().getClass(heroClass) == null) { if (Quests.mcmmo == null) {
skipQuestProcess("" + heroClass + " in heroes-exp-classes: Reward in Quest " + quest.name + " requires the mcMMO plugin!");
} else if (Quests.heroes.getClassManager().getClass(heroClass) == null) {
skipQuestProcess("" + heroClass + " in heroes-exp-classes: Reward in Quest " + quest.name + " is not a valid Heroes class name!"); skipQuestProcess("" + heroClass + " in heroes-exp-classes: Reward in Quest " + quest.name + " is not a valid Heroes class name!");
} }
} }
@ -2308,7 +2312,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (config.contains("quests." + questName + ".rewards.phat-loots")) { if (config.contains("quests." + questName + ".rewards.phat-loots")) {
if (Quests.checkList(config.getList("quests." + questName + ".rewards.phat-loots"), String.class)) { if (Quests.checkList(config.getList("quests." + questName + ".rewards.phat-loots"), String.class)) {
for (String loot : config.getStringList("quests." + questName + ".rewards.phat-loots")) { for (String loot : config.getStringList("quests." + questName + ".rewards.phat-loots")) {
if (PhatLootsAPI.getPhatLoot(loot) == null) { if (Quests.phatLoots == null) {
skipQuestProcess("" + loot + " in phat-loots: Reward in Quest " + quest.name + " requires the PhatLoots plugin!");
} else if (PhatLootsAPI.getPhatLoot(loot) == null) {
skipQuestProcess("" + loot + " in phat-loots: Reward in Quest " + quest.name + " is not a valid PhatLoot name!"); skipQuestProcess("" + loot + " in phat-loots: Reward in Quest " + quest.name + " is not a valid PhatLoot name!");
} }
} }