Fix loading of quest requirements with color-coded names, fixes #1198

This commit is contained in:
PikaMug 2020-04-15 15:40:08 -04:00
parent db030a6f12
commit 85d8131c34
2 changed files with 10 additions and 6 deletions

View File

@ -822,7 +822,7 @@ public class Quest {
} }
/** /**
* Checks if quester is in WorldGuard region * Checks if quester is in WorldGuard region start
* *
* @param quester The quester to check * @param quester The quester to check
* @return true if quester is in region * @return true if quester is in region
@ -832,7 +832,7 @@ public class Quest {
} }
/** /**
* Checks if player is in WorldGuard region * Checks if player is in WorldGuard region start
* *
* @param player The player to check * @param player The player to check
* @return true if player is in region * @return true if player is in region

View File

@ -1682,8 +1682,10 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
List<String> temp = new LinkedList<String>(); List<String> temp = new LinkedList<String>();
for (String name : names) { for (String name : names) {
boolean done = false; boolean done = false;
for (String string : questsSection.getKeys(false)) { for (String id : questsSection.getKeys(false)) {
if (config.getString("quests." + string + ".name").equalsIgnoreCase(name)) { String name2 = config.getString("quests." + id + ".name");
if (name2.equalsIgnoreCase(name)
|| ChatColor.stripColor(name2).equalsIgnoreCase(ChatColor.stripColor(name))) {
temp.add(name); temp.add(name);
done = true; done = true;
break; break;
@ -1711,8 +1713,10 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
List<String> temp = new LinkedList<String>(); List<String> temp = new LinkedList<String>();
for (String name : names) { for (String name : names) {
boolean done = false; boolean done = false;
for (String string : questsSection.getKeys(false)) { for (String id : questsSection.getKeys(false)) {
if (config.getString("quests." + string + ".name").equalsIgnoreCase(name)) { String name2 = config.getString("quests." + id + ".name");
if (name2.equalsIgnoreCase(name)
|| ChatColor.stripColor(name2).equalsIgnoreCase(ChatColor.stripColor(name))) {
temp.add(name); temp.add(name);
done = true; done = true;
break; break;