mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-26 04:36:06 +01:00
replace print/throw w/single statement
This commit is contained in:
parent
8add179b45
commit
f4c4f3895b
@ -2292,8 +2292,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
// TODO why have a name attr then path key can be guest name?
|
// TODO why have a name attr then path key can be guest name?
|
||||||
quest.name = parseString(config.getString("quests." + questName + ".name"), quest);
|
quest.name = parseString(config.getString("quests." + questName + ".name"), quest);
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] Quest block \'" + questName + "\' is missing " + RED + "name:");
|
skipQuestProcess("[Quests] Quest block \'" + questName + "\' is missing " + RED + "name:");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.contains("quests." + questName + ".npc-giver-id")) {
|
if (config.contains("quests." + questName + ".npc-giver-id")) {
|
||||||
@ -2303,8 +2302,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
questNPCs.add(CitizensAPI.getNPCRegistry().getById(config.getInt("quests." + questName + ".npc-giver-id")));
|
questNPCs.add(CitizensAPI.getNPCRegistry().getById(config.getInt("quests." + questName + ".npc-giver-id")));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] npc-giver-id: for Quest " + quest.name + " is not a valid NPC id!");
|
skipQuestProcess("[Quests] npc-giver-id: for Quest " + quest.name + " is not a valid NPC id!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2315,8 +2313,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
quest.blockStart = location;
|
quest.blockStart = location;
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] block-start: for Quest " + quest.name + " is not in proper location format!");
|
printSevere("[Quests] block-start: for Quest " + quest.name + " is not in proper location format!");
|
||||||
printSevere("[Quests] Proper location format is: \"WorldName x y z\"");
|
skipQuestProcess("[Quests] Proper location format is: \"WorldName x y z\"");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2327,8 +2324,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
boolean exists = regionFound(quest, region);
|
boolean exists = regionFound(quest, region);
|
||||||
|
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
printSevere("[Quests] region: for Quest " + quest.name + " is not a valid WorldGuard region!");
|
skipQuestProcess("[Quests] region: for Quest " + quest.name + " is not a valid WorldGuard region!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2345,8 +2341,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
if (config.getInt("quests." + questName + ".redo-delay", -999) != -999) {
|
if (config.getInt("quests." + questName + ".redo-delay", -999) != -999) {
|
||||||
quest.redoDelay = config.getInt("quests." + questName + ".redo-delay");
|
quest.redoDelay = config.getInt("quests." + questName + ".redo-delay");
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] redo-delay: for Quest " + quest.name + " is not a number!");
|
skipQuestProcess("[Quests] redo-delay: for Quest " + quest.name + " is not a number!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2354,15 +2349,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
if (config.contains("quests." + questName + ".finish-message")) {
|
if (config.contains("quests." + questName + ".finish-message")) {
|
||||||
quest.finished = parseString(config.getString("quests." + questName + ".finish-message"), quest);
|
quest.finished = parseString(config.getString("quests." + questName + ".finish-message"), quest);
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] Quest " + quest.name + " is missing finish-message:");
|
skipQuestProcess("[Quests] Quest " + quest.name + " is missing finish-message:");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.contains("quests." + questName + ".ask-message")) {
|
if (config.contains("quests." + questName + ".ask-message")) {
|
||||||
quest.description = parseString(config.getString("quests." + questName + ".ask-message"), quest);
|
quest.description = parseString(config.getString("quests." + questName + ".ask-message"), quest);
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] Quest " + quest.name + " is missing ask-message:");
|
skipQuestProcess("[Quests] Quest " + quest.name + " is missing ask-message:");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.contains("quests." + questName + ".event")) {
|
if (config.contains("quests." + questName + ".event")) {
|
||||||
@ -2372,8 +2365,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
if (evt != null) {
|
if (evt != null) {
|
||||||
quest.initialEvent = evt;
|
quest.initialEvent = evt;
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] Initial Event in Quest " + quest.name + " failed to load.");
|
skipQuestProcess("[Quests] Initial Event in Quest " + quest.name + " failed to load.");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2383,8 +2375,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
if (config.contains("quests." + questName + ".requirements.fail-requirement-message")) {
|
if (config.contains("quests." + questName + ".requirements.fail-requirement-message")) {
|
||||||
quest.failRequirements = parseString(config.getString("quests." + questName + ".requirements.fail-requirement-message"), quest);
|
quest.failRequirements = parseString(config.getString("quests." + questName + ".requirements.fail-requirement-message"), quest);
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] Requirements for Quest " + quest.name + " is missing fail-requirement-message:");
|
skipQuestProcess("[Quests] Requirements for Quest " + quest.name + " is missing fail-requirement-message:");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.contains("quests." + questName + ".requirements.items")) {
|
if (config.contains("quests." + questName + ".requirements.items")) {
|
||||||
@ -2405,13 +2396,11 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (failed == true) {
|
if (failed == true) {
|
||||||
printSevere("[Quests] items: Requirement for Quest " + quest.name + " is not formatted correctly!");
|
skipQuestProcess("[Quests] items: Requirement for Quest " + quest.name + " is not formatted correctly!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] items: Requirement for Quest " + quest.name + " is not formatted correctly!");
|
skipQuestProcess("[Quests] items: Requirement for Quest " + quest.name + " is not formatted correctly!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.contains("quests." + questName + ".requirements.remove-items")) {
|
if (config.contains("quests." + questName + ".requirements.remove-items")) {
|
||||||
@ -2420,13 +2409,11 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
quest.removeItems.clear();
|
quest.removeItems.clear();
|
||||||
quest.removeItems.addAll(config.getBooleanList("quests." + questName + ".requirements.remove-items"));
|
quest.removeItems.addAll(config.getBooleanList("quests." + questName + ".requirements.remove-items"));
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] remove-items: Requirement for Quest " + quest.name + " is not a list of true/false values!");
|
skipQuestProcess("[Quests] remove-items: Requirement for Quest " + quest.name + " is not a list of true/false values!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] Requirements for Quest " + quest.name + " is missing remove-items:");
|
skipQuestProcess("[Quests] Requirements for Quest " + quest.name + " is missing remove-items:");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2435,8 +2422,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
if (config.getInt("quests." + questName + ".requirements.money", -999) != -999) {
|
if (config.getInt("quests." + questName + ".requirements.money", -999) != -999) {
|
||||||
quest.moneyReq = config.getInt("quests." + questName + ".requirements.money");
|
quest.moneyReq = config.getInt("quests." + questName + ".requirements.money");
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] money: Requirement for Quest " + quest.name + " is not a number!");
|
skipQuestProcess("[Quests] money: Requirement for Quest " + quest.name + " is not a number!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2446,8 +2432,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
if (config.getInt("quests." + questName + ".requirements.quest-points", -999) != -999) {
|
if (config.getInt("quests." + questName + ".requirements.quest-points", -999) != -999) {
|
||||||
quest.questPointsReq = config.getInt("quests." + questName + ".requirements.quest-points");
|
quest.questPointsReq = config.getInt("quests." + questName + ".requirements.quest-points");
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] quest-points: Requirement for Quest " + quest.name + " is not a number!");
|
skipQuestProcess("[Quests] quest-points: Requirement for Quest " + quest.name + " is not a number!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2484,13 +2469,11 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
printSevere("[Quests] " + PINK + failedQuest + " inside quests: Requirement for Quest " + quest.name + " is not a valid Quest name!");
|
printSevere("[Quests] " + PINK + failedQuest + " inside quests: Requirement for Quest " + quest.name + " is not a valid Quest name!");
|
||||||
printSevere("Make sure you are using the Quest name: value, and not the block name.");
|
skipQuestProcess("Make sure you are using the Quest name: value, and not the block name.");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] quest-blocks: Requirement for Quest " + quest.name + " is not a list of Quest names!");
|
skipQuestProcess("[Quests] quest-blocks: Requirement for Quest " + quest.name + " is not a list of Quest names!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2527,13 +2510,11 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
printSevere("[Quests] " + failedQuest + " inside quests: Requirement for Quest " + quest.name + " is not a valid Quest name!");
|
printSevere("[Quests] " + failedQuest + " inside quests: Requirement for Quest " + quest.name + " is not a valid Quest name!");
|
||||||
printSevere("Make sure you are using the Quest name: value, and not the block name.");
|
skipQuestProcess("Make sure you are using the Quest name: value, and not the block name.");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] quests: Requirement for Quest " + quest.name + " is not a list of Quest names!");
|
skipQuestProcess("[Quests] quests: Requirement for Quest " + quest.name + " is not a list of Quest names!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2544,8 +2525,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
quest.permissionReqs.clear();
|
quest.permissionReqs.clear();
|
||||||
quest.permissionReqs.addAll(config.getStringList("quests." + questName + ".requirements.permissions"));
|
quest.permissionReqs.addAll(config.getStringList("quests." + questName + ".requirements.permissions"));
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] permissions: Requirement for Quest " + quest.name + " is not a list of permissions!");
|
skipQuestProcess("[Quests] permissions: Requirement for Quest " + quest.name + " is not a list of permissions!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2562,26 +2542,22 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
List<Integer> amounts = config.getIntegerList("quests." + questName + ".requirements.mcmmo-amounts");
|
List<Integer> amounts = config.getIntegerList("quests." + questName + ".requirements.mcmmo-amounts");
|
||||||
|
|
||||||
if (skills.size() != amounts.size()) {
|
if (skills.size() != amounts.size()) {
|
||||||
printSevere("[Quests] mcmmo-skills: and mcmmo-amounts: in requirements: for Quest " + quest.name + " are not the same size!");
|
skipQuestProcess("[Quests] mcmmo-skills: and mcmmo-amounts: in requirements: for Quest " + quest.name + " are not the same size!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
quest.mcMMOSkillReqs.addAll(skills);
|
quest.mcMMOSkillReqs.addAll(skills);
|
||||||
quest.mcMMOAmountReqs.addAll(amounts);
|
quest.mcMMOAmountReqs.addAll(amounts);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] mcmmo-amounts: Requirement for Quest " + quest.name + " is not a list of numbers!");
|
skipQuestProcess("[Quests] mcmmo-amounts: Requirement for Quest " + quest.name + " is not a list of numbers!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] Requirements for Quest " + quest.name + " is missing mcmmo-amounts:");
|
skipQuestProcess("[Quests] Requirements for Quest " + quest.name + " is missing mcmmo-amounts:");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] mcmmo-skills: Requirement for Quest " + quest.name + " is not a list of skills!");
|
skipQuestProcess("[Quests] mcmmo-skills: Requirement for Quest " + quest.name + " is not a list of skills!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2593,11 +2569,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
if (hc != null && hc.isPrimary()) {
|
if (hc != null && hc.isPrimary()) {
|
||||||
quest.heroesPrimaryClassReq = hc.getName();
|
quest.heroesPrimaryClassReq = hc.getName();
|
||||||
} else if (hc != null) {
|
} else if (hc != null) {
|
||||||
printSevere("[Quests] heroes-primary-class: Requirement for Quest " + quest.name + " is not a primary Heroes class!");
|
skipQuestProcess("[Quests] heroes-primary-class: Requirement for Quest " + quest.name + " is not a primary Heroes class!");
|
||||||
skipQuestProcess();
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] heroes-primary-class: Requirement for Quest " + quest.name + " is not a valid Heroes class!");
|
skipQuestProcess("[Quests] heroes-primary-class: Requirement for Quest " + quest.name + " is not a valid Heroes class!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2609,11 +2583,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
if (hc != null && hc.isSecondary()) {
|
if (hc != null && hc.isSecondary()) {
|
||||||
quest.heroesSecondaryClassReq = hc.getName();
|
quest.heroesSecondaryClassReq = hc.getName();
|
||||||
} else if (hc != null) {
|
} else if (hc != null) {
|
||||||
printSevere("[Quests] heroes-secondary-class: Requirement for Quest " + quest.name + " is not a secondary Heroes class!");
|
skipQuestProcess("[Quests] heroes-secondary-class: Requirement for Quest " + quest.name + " is not a secondary Heroes class!");
|
||||||
skipQuestProcess();
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] heroes-secondary-class: Requirement for Quest " + quest.name + " is not a valid Heroes class!");
|
skipQuestProcess("[Quests] heroes-secondary-class: Requirement for Quest " + quest.name + " is not a valid Heroes class!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2635,7 +2607,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
printWarning("[Quests] Custom requirement \"" + name + "\" for Quest \"" + quest.name + "\" could not be found!");
|
printWarning("[Quests] Custom requirement \"" + name + "\" for Quest \"" + quest.name + "\" could not be found!");
|
||||||
skipQuestProcess();
|
skipQuestProcess(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> data = new HashMap<String, Object>();
|
Map<String, Object> data = new HashMap<String, Object>();
|
||||||
@ -2663,7 +2635,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
|
|
||||||
if (Quests.checkList(config.getList("quests." + questName + ".rewards.items"), String.class)) {
|
if (Quests.checkList(config.getList("quests." + questName + ".rewards.items"), String.class)) {
|
||||||
|
|
||||||
boolean failed = false;
|
|
||||||
for (String item : config.getStringList("quests." + questName + ".rewards.items")) {
|
for (String item : config.getStringList("quests." + questName + ".rewards.items")) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -2672,20 +2643,14 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
quest.itemRewards.add(stack);
|
quest.itemRewards.add(stack);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
printSevere("[Quests] " + item + " in items: Reward in Quest " + quest.name + " is not properly formatted!");
|
skipQuestProcess("[Quests] " + item + " in items: Reward in Quest " + quest.name + " is not properly formatted!");
|
||||||
failed = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (failed) {
|
|
||||||
skipQuestProcess();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] items: Reward in Quest " + quest.name + " is not a list of strings!");
|
skipQuestProcess("[Quests] items: Reward in Quest " + quest.name + " is not a list of strings!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2695,8 +2660,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
if (config.getInt("quests." + questName + ".rewards.money", -999) != -999) {
|
if (config.getInt("quests." + questName + ".rewards.money", -999) != -999) {
|
||||||
quest.moneyReward = config.getInt("quests." + questName + ".rewards.money");
|
quest.moneyReward = config.getInt("quests." + questName + ".rewards.money");
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] money: Reward in Quest " + quest.name + " is not a number!");
|
skipQuestProcess("[Quests] money: Reward in Quest " + quest.name + " is not a number!");
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2706,8 +2670,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
if (config.getInt("quests." + questName + ".rewards.exp", -999) != -999) {
|
if (config.getInt("quests." + questName + ".rewards.exp", -999) != -999) {
|
||||||
quest.exp = config.getInt("quests." + questName + ".rewards.exp");
|
quest.exp = config.getInt("quests." + questName + ".rewards.exp");
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] exp: Reward in Quest " + quest.name + " is not a number!");
|
skipQuestProcess("[Quests] exp: Reward in Quest " + quest.name + " is not a number!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2718,8 +2681,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
quest.commands.clear();
|
quest.commands.clear();
|
||||||
quest.commands.addAll(config.getStringList("quests." + questName + ".rewards.commands"));
|
quest.commands.addAll(config.getStringList("quests." + questName + ".rewards.commands"));
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] commands: Reward in Quest " + quest.name + " is not a list of commands!");
|
skipQuestProcess("[Quests] commands: Reward in Quest " + quest.name + " is not a list of commands!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2730,8 +2692,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
quest.permissions.clear();
|
quest.permissions.clear();
|
||||||
quest.permissions.addAll(config.getStringList("quests." + questName + ".rewards.permissions"));
|
quest.permissions.addAll(config.getStringList("quests." + questName + ".rewards.permissions"));
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] permissions: Reward in Quest " + quest.name + " is not a list of permissions!");
|
skipQuestProcess("[Quests] permissions: Reward in Quest " + quest.name + " is not a list of permissions!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2742,8 +2703,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
quest.questPoints = config.getInt("quests." + questName + ".rewards.quest-points");
|
quest.questPoints = config.getInt("quests." + questName + ".rewards.quest-points");
|
||||||
totalQuestPoints += quest.questPoints;
|
totalQuestPoints += quest.questPoints;
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] quest-points: Reward in Quest " + quest.name + " is not a number!");
|
skipQuestProcess("[Quests] quest-points: Reward in Quest " + quest.name + " is not a number!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2756,19 +2716,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
|
|
||||||
if (Quests.checkList(config.getList("quests." + questName + ".rewards.mcmmo-levels"), Integer.class)) {
|
if (Quests.checkList(config.getList("quests." + questName + ".rewards.mcmmo-levels"), Integer.class)) {
|
||||||
|
|
||||||
boolean failed = false;
|
|
||||||
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.getMcMMOSkill(skill) == null) {
|
||||||
printSevere("[Quests] " + skill + " in mcmmo-skills: Reward in Quest " + quest.name + " is not a valid mcMMO skill name!");
|
skipQuestProcess("[Quests] " + skill + " in mcmmo-skills: Reward in Quest " + quest.name + " is not a valid mcMMO skill name!");
|
||||||
failed = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (failed) {
|
|
||||||
skipQuestProcess();
|
|
||||||
}
|
|
||||||
|
|
||||||
quest.mcmmoSkills.clear();
|
quest.mcmmoSkills.clear();
|
||||||
quest.mcmmoAmounts.clear();
|
quest.mcmmoAmounts.clear();
|
||||||
@ -2777,18 +2731,15 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
quest.mcmmoAmounts.addAll(config.getIntegerList("quests." + questName + ".rewards.mcmmo-levels"));
|
quest.mcmmoAmounts.addAll(config.getIntegerList("quests." + questName + ".rewards.mcmmo-levels"));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] mcmmo-levels: Reward in Quest " + quest.name + " is not a list of numbers!");
|
skipQuestProcess("[Quests] mcmmo-levels: Reward in Quest " + quest.name + " is not a list of numbers!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] Rewards for Quest " + quest.name + " is missing mcmmo-levels:");
|
skipQuestProcess("[Quests] Rewards for Quest " + quest.name + " is missing mcmmo-levels:");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] mcmmo-skills: Reward in Quest " + quest.name + " is not a list of mcMMO skill names!");
|
skipQuestProcess("[Quests] mcmmo-skills: Reward in Quest " + quest.name + " is not a list of mcMMO skill names!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2800,19 +2751,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
|
|
||||||
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)) {
|
||||||
|
|
||||||
boolean failed = false;
|
|
||||||
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.heroes.getClassManager().getClass(heroClass) == null) {
|
||||||
printSevere("[Quests] " + heroClass + " in heroes-exp-classes: Reward in Quest " + quest.name + " is not a valid Heroes class name!");
|
skipQuestProcess("[Quests] " + heroClass + " in heroes-exp-classes: Reward in Quest " + quest.name + " is not a valid Heroes class name!");
|
||||||
failed = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (failed) {
|
|
||||||
skipQuestProcess();
|
|
||||||
}
|
|
||||||
|
|
||||||
quest.heroesClasses.clear();
|
quest.heroesClasses.clear();
|
||||||
quest.heroesAmounts.clear();
|
quest.heroesAmounts.clear();
|
||||||
@ -2821,18 +2766,15 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
quest.heroesAmounts.addAll(config.getDoubleList("quests." + questName + ".rewards.heroes-exp-amounts"));
|
quest.heroesAmounts.addAll(config.getDoubleList("quests." + questName + ".rewards.heroes-exp-amounts"));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] heroes-exp-amounts: Reward in Quest " + quest.name + " is not a list of experience amounts (decimal numbers)!");
|
skipQuestProcess("[Quests] heroes-exp-amounts: Reward in Quest " + quest.name + " is not a list of experience amounts (decimal numbers)!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] Rewards for Quest " + quest.name + " is missing heroes-exp-amounts:");
|
skipQuestProcess("[Quests] Rewards for Quest " + quest.name + " is missing heroes-exp-amounts:");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] heroes-exp-classes: Reward in Quest " + quest.name + " is not a list of Heroes classes!");
|
skipQuestProcess("[Quests] heroes-exp-classes: Reward in Quest " + quest.name + " is not a list of Heroes classes!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2840,26 +2782,19 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
|
|
||||||
if (Quests.checkList(config.getList("quests." + questName + ".rewards.phat-loots"), String.class)) {
|
if (Quests.checkList(config.getList("quests." + questName + ".rewards.phat-loots"), String.class)) {
|
||||||
|
|
||||||
boolean failed = false;
|
|
||||||
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 (PhatLootsAPI.getPhatLoot(loot) == null) {
|
||||||
printSevere("[Quests] " + loot + " in phat-loots: Reward in Quest " + quest.name + " is not a valid PhatLoot name!");
|
skipQuestProcess("[Quests] " + loot + " in phat-loots: Reward in Quest " + quest.name + " is not a valid PhatLoot name!");
|
||||||
failed = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (failed) {
|
|
||||||
skipQuestProcess();
|
|
||||||
}
|
|
||||||
|
|
||||||
quest.phatLootRewards.clear();
|
quest.phatLootRewards.clear();
|
||||||
quest.phatLootRewards.addAll(config.getStringList("quests." + questName + ".rewards.phat-loots"));
|
quest.phatLootRewards.addAll(config.getStringList("quests." + questName + ".rewards.phat-loots"));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printSevere("[Quests] phat-loots: Reward in Quest " + quest.name + " is not a list of PhatLoots!");
|
skipQuestProcess("[Quests] phat-loots: Reward in Quest " + quest.name + " is not a list of PhatLoots!");
|
||||||
skipQuestProcess();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2898,7 +2833,8 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
} // for()
|
} // for()
|
||||||
}
|
}
|
||||||
|
|
||||||
private void skipQuestProcess() throws SkipQuest {
|
private void skipQuestProcess(String msg) throws SkipQuest {
|
||||||
|
printSevere(msg);
|
||||||
throw new SkipQuest();
|
throw new SkipQuest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user