Show progress along with objective-overrides, fixes #980

This commit is contained in:
PikaMug 2019-11-08 19:04:04 -05:00
parent 75e7357929
commit e574654f53

View File

@ -645,51 +645,45 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
*/ */
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public void showObjectives(Quest quest, Quester quester, boolean ignoreOverrides) { public void showObjectives(Quest quest, Quester quester, boolean ignoreOverrides) {
if (!ignoreOverrides) {
if (quester.getCurrentStage(quest) != null) {
if (quester.getCurrentStage(quest).objectiveOverride != null) {
String message = ChatColor.GREEN + quester.getCurrentStage(quest).objectiveOverride;
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
return;
}
}
}
if (quester.getQuestData(quest) == null) { if (quester.getQuestData(quest) == null) {
getLogger().warning("Quest data was null when showing objectives for " + quest.getName()); getLogger().warning("Quest data was null when showing objectives for " + quest.getName());
return; return;
} }
if (quester.getCurrentStage(quest) == null) {
getLogger().warning("Current stage was null when showing objectives for " + quest.getName());
return;
}
if (!ignoreOverrides) {
if (quester.getCurrentStage(quest).objectiveOverride != null) {
String message = ChatColor.GREEN + quester.getCurrentStage(quest).objectiveOverride;
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
return;
}
}
QuestData data = quester.getQuestData(quest); QuestData data = quester.getQuestData(quest);
Stage stage = quester.getCurrentStage(quest); Stage stage = quester.getCurrentStage(quest);
for (ItemStack e : stage.blocksToBreak) { for (ItemStack e : stage.blocksToBreak) {
for (ItemStack e2 : data.blocksBroken) { for (ItemStack e2 : data.blocksBroken) {
if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) {
if (e2.getAmount() < e.getAmount()) { ChatColor color = e2.getAmount() < e.getAmount() ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "break") + " <item>" String message = "";
+ ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount(); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); + color + ": " + e2.getAmount() + "/" + e.getAmount();
}
if (getSettings().canTranslateItems() && !e.hasItemMeta()
&& !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
}
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "break") + " <item>" message = color + Lang.get(quester.getPlayer(), "break") + " <item>"
+ ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount(); + color + ": " + e2.getAmount() + "/" + e.getAmount();
if (depends.getPlaceholderApi() != null) { }
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); if (depends.getPlaceholderApi() != null) {
} message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
if (getSettings().canTranslateItems() && !e.hasItemMeta() }
&& !e.getItemMeta().hasDisplayName()) { if (getSettings().canTranslateItems() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null); localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else { } else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e))); quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
}
} }
} }
} }
@ -697,30 +691,22 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
for (ItemStack e : stage.blocksToDamage) { for (ItemStack e : stage.blocksToDamage) {
for (ItemStack e2 : data.blocksDamaged) { for (ItemStack e2 : data.blocksDamaged) {
if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) {
if (e2.getAmount() < e.getAmount()) { ChatColor color = e2.getAmount() < e.getAmount() ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "damage") + " <item>" String message = "";
+ ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount(); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); + color + ": " + e2.getAmount() + "/" + e.getAmount();
}
if (getSettings().canTranslateItems() && !e.hasItemMeta()
&& !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
}
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "damage") + " <item>" message = color + Lang.get(quester.getPlayer(), "damage") + " <item>"
+ ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount(); + color + ": " + e2.getAmount() + "/" + e.getAmount();
if (depends.getPlaceholderApi() != null) { }
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); if (depends.getPlaceholderApi() != null) {
} message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
if (getSettings().canTranslateItems() && !e.hasItemMeta() }
&& !e.getItemMeta().hasDisplayName()) { if (getSettings().canTranslateItems() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null); localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else { } else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e))); quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
}
} }
} }
} }
@ -728,30 +714,22 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
for (ItemStack e : stage.blocksToPlace) { for (ItemStack e : stage.blocksToPlace) {
for (ItemStack e2 : data.blocksPlaced) { for (ItemStack e2 : data.blocksPlaced) {
if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) {
if (e2.getAmount() < e.getAmount()) { ChatColor color = e2.getAmount() < e.getAmount() ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "place") + " <item>" String message = "";
+ ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount(); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); + color + ": " + e2.getAmount() + "/" + e.getAmount();
}
if (getSettings().canTranslateItems() && !e.hasItemMeta()
&& !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
}
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "place") + " <item>" message = color + Lang.get(quester.getPlayer(), "place") + " <item>"
+ ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount(); + color + ": " + e2.getAmount() + "/" + e.getAmount();
if (depends.getPlaceholderApi() != null) { }
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); if (depends.getPlaceholderApi() != null) {
} message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
if (getSettings().canTranslateItems() && !e.hasItemMeta() }
&& !e.getItemMeta().hasDisplayName()) { if (getSettings().canTranslateItems() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null); localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else { } else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e))); quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
}
} }
} }
} }
@ -759,30 +737,22 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
for (ItemStack e : stage.blocksToUse) { for (ItemStack e : stage.blocksToUse) {
for (ItemStack e2 : data.blocksUsed) { for (ItemStack e2 : data.blocksUsed) {
if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) {
if (e2.getAmount() < e.getAmount()) { ChatColor color = e2.getAmount() < e.getAmount() ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "use") + " <item>" String message = "";
+ ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount(); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); + color + ": " + e2.getAmount() + "/" + e.getAmount();
}
if (getSettings().canTranslateItems() && !e.hasItemMeta()
&& !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
}
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "use") + " <item>" message = color + Lang.get(quester.getPlayer(), "use") + " <item>"
+ ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount(); + color + ": " + e2.getAmount() + "/" + e.getAmount();
if (depends.getPlaceholderApi() != null) { }
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); if (depends.getPlaceholderApi() != null) {
} message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
if (getSettings().canTranslateItems() && !e.hasItemMeta() }
&& !e.getItemMeta().hasDisplayName()) { if (getSettings().canTranslateItems() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null); localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else { } else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e))); quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
}
} }
} }
} }
@ -790,30 +760,22 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
for (ItemStack e : stage.blocksToCut) { for (ItemStack e : stage.blocksToCut) {
for (ItemStack e2 : data.blocksCut) { for (ItemStack e2 : data.blocksCut) {
if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) {
if (e2.getAmount() < e.getAmount()) { ChatColor color = e2.getAmount() < e.getAmount() ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "cut") + " <item>" String message = "";
+ ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount(); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); + color + ": " + e2.getAmount() + "/" + e.getAmount();
}
if (getSettings().canTranslateItems() && !e.hasItemMeta()
&& !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
}
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "cut") + " <item>" message = color + Lang.get(quester.getPlayer(), "cut") + " <item>"
+ ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount(); + color + ": " + e2.getAmount() + "/" + e.getAmount();
if (depends.getPlaceholderApi() != null) { }
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); if (depends.getPlaceholderApi() != null) {
} message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
if (getSettings().canTranslateItems() && !e.hasItemMeta() }
&& !e.getItemMeta().hasDisplayName()) { if (getSettings().canTranslateItems() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null); localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else { } else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e))); quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
}
} }
} }
} }
@ -824,30 +786,23 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
crafted = data.itemsCrafted.get(is); crafted = data.itemsCrafted.get(is);
} }
int amt = is.getAmount(); int amt = is.getAmount();
if (crafted < amt) { ChatColor color = crafted < amt ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "craft") + " <item>" String message = "";
+ ChatColor.GREEN + ": " + crafted + "/" + is.getAmount(); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); + color + ": " + crafted + "/" + is.getAmount();
}
if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
is.getEnchantments());
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is)));
}
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "craft") + " <item>" message = color + Lang.get(quester.getPlayer(), "craft") + " <item>"
+ ChatColor.GRAY + ": " + crafted + "/" + is.getAmount(); + color + ": " + crafted + "/" + is.getAmount();
if (depends.getPlaceholderApi() != null) { }
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); if (depends.getPlaceholderApi() != null) {
} message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) { }
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(), if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
is.getEnchantments()); localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
} else { is.getEnchantments());
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is))); } else {
} quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is)));
} }
} }
for (ItemStack is : stage.itemsToSmelt) { for (ItemStack is : stage.itemsToSmelt) {
@ -856,30 +811,23 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
smelted = data.itemsSmelted.get(is); smelted = data.itemsSmelted.get(is);
} }
int amt = is.getAmount(); int amt = is.getAmount();
if (smelted < amt) { ChatColor color = smelted < amt ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "smelt") + " <item>" String message = "";
+ ChatColor.GREEN + ": " + smelted + "/" + is.getAmount(); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); + color + ": " + smelted + "/" + is.getAmount();
}
if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
is.getEnchantments());
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is)));
}
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "smelt") + " <item>" message = color + Lang.get(quester.getPlayer(), "smelt") + " <item>"
+ ChatColor.GRAY + ": " + smelted + "/" + is.getAmount(); + color + ": " + smelted + "/" + is.getAmount();
if (depends.getPlaceholderApi() != null) { }
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); if (depends.getPlaceholderApi() != null) {
} message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) { }
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(), if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
is.getEnchantments()); localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
} else { is.getEnchantments());
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is))); } else {
} quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is)));
} }
} }
Map<Enchantment, Material> set; Map<Enchantment, Material> set;
@ -911,36 +859,26 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
mat = (Material) o; mat = (Material) o;
} }
if (enchantment2 == enchantment) { if (enchantment2 == enchantment) {
if (num1 < num2) { ChatColor color = num1 < num2 ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "enchantItem") String message = "";
+ ChatColor.GREEN + ": " + num1 + "/" + num2; if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); + color + ": " + num1 + "/" + num2;
}
Map<Enchantment, Integer> enchs = new HashMap<Enchantment, Integer>();
enchs.put(enchantment, 1);
if (getSettings().canTranslateItems()) {
localeQuery.sendMessage(quester.getPlayer(), message, mat, (short) 0, enchs);
} else {
quester.getPlayer().sendMessage(message
.replace("<item>", ItemUtil.getName(new ItemStack(mat)))
.replace("<enchantment>", enchantment.getName()));
}
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "enchantItem") message = color + Lang.get(quester.getPlayer(), "enchantItem")
+ ChatColor.GRAY + ": " + num1 + "/" + num2; + color + ": " + num1 + "/" + num2;
if (depends.getPlaceholderApi() != null) { }
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); if (depends.getPlaceholderApi() != null) {
} message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
Map<Enchantment, Integer> enchs = new HashMap<Enchantment, Integer>(); }
enchs.put(enchantment, 1); Map<Enchantment, Integer> enchs = new HashMap<Enchantment, Integer>();
if (getSettings().canTranslateItems()) { enchs.put(enchantment, 1);
localeQuery.sendMessage(quester.getPlayer(), message, mat, (short) 0, enchs); if (getSettings().canTranslateItems()) {
} else { localeQuery.sendMessage(quester.getPlayer(), message, mat, (short) 0, enchs);
quester.getPlayer().sendMessage(message } else {
.replace("<item>", ItemUtil.getName(new ItemStack(mat))) quester.getPlayer().sendMessage(message
.replace("<enchantment>", enchantment.getName())); .replace("<item>", ItemUtil.getName(new ItemStack(mat)))
} .replace("<enchantment>", enchantment.getName()));
} }
} }
} }
@ -951,154 +889,100 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
brewed = data.itemsBrewed.get(is); brewed = data.itemsBrewed.get(is);
} }
int amt = is.getAmount(); int amt = is.getAmount();
if (brewed < amt) { ChatColor color = brewed < amt ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "brew") + " <item>" String message = "";
+ ChatColor.GREEN + ": " + brewed + "/" + is.getAmount(); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); + color + ": " + brewed + "/" + is.getAmount();
}
if (getSettings().canTranslateItems()) {
if (is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
// Bukkit version is 1.9+
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
is.getEnchantments(), is.getItemMeta());
} else if (Material.getMaterial("LINGERING_POTION") == null && !is.hasItemMeta() ) {
// Bukkit version is below 1.9
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
is.getEnchantments());
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is)));
}
}
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "brew") + " <item>" message = color + Lang.get(quester.getPlayer(), "brew") + " <item>"
+ ChatColor.GRAY + ": " + brewed + "/" + is.getAmount(); + color + ": " + brewed + "/" + is.getAmount();
if (depends.getPlaceholderApi() != null) { }
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); if (depends.getPlaceholderApi() != null) {
} message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
if (getSettings().canTranslateItems()) { }
if (is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) { if (getSettings().canTranslateItems()) {
// Bukkit version is 1.9+ if (is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(), // Bukkit version is 1.9+
is.getEnchantments(), is.getItemMeta()); localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
} else if (Material.getMaterial("LINGERING_POTION") == null && !is.hasItemMeta() ) { is.getEnchantments(), is.getItemMeta());
// Bukkit version is below 1.9 } else if (Material.getMaterial("LINGERING_POTION") == null && !is.hasItemMeta() ) {
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(), // Bukkit version is below 1.9
is.getEnchantments()); localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
} else { is.getEnchantments());
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is))); } else {
} quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is)));
} }
} }
} }
if (stage.fishToCatch != null) { if (stage.fishToCatch != null) {
if (data.getFishCaught() < stage.fishToCatch) { ChatColor color = data.getFishCaught() < stage.fishToCatch ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "catchFish") String message = "";
+ ChatColor.GREEN + ": " + data.getFishCaught() + "/" + stage.fishToCatch; if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); + color + ": " + data.getFishCaught() + "/" + stage.fishToCatch;
}
quester.getPlayer().sendMessage(message);
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "catchFish") message = color + Lang.get(quester.getPlayer(), "catchFish")
+ ChatColor.GRAY + ": " + data.getFishCaught() + "/" + stage.fishToCatch; + color + ": " + data.getFishCaught() + "/" + stage.fishToCatch;
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
} }
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
} }
for (EntityType e : stage.mobsToKill) { for (EntityType e : stage.mobsToKill) {
for (EntityType e2 : data.mobsKilled) { for (EntityType e2 : data.mobsKilled) {
if (e == e2) { if (e == e2) {
if (data.mobNumKilled.size() > data.mobsKilled.indexOf(e2) if (data.mobNumKilled.size() > data.mobsKilled.indexOf(e2)
&& stage.mobNumToKill.size() > stage.mobsToKill.indexOf(e)) { && stage.mobNumToKill.size() > stage.mobsToKill.indexOf(e)) {
if (data.mobNumKilled.get(data.mobsKilled.indexOf(e2)) ChatColor color = data.mobNumKilled.get(data.mobsKilled.indexOf(e2))
< stage.mobNumToKill.get(stage.mobsToKill.indexOf(e))) { < stage.mobNumToKill.get(stage.mobsToKill.indexOf(e))
if (stage.locationsToKillWithin.isEmpty()) { ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "kill") + " " String message = "";
+ ChatColor.AQUA + "<mob>" + ChatColor.GREEN + ": " if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
+ (data.mobNumKilled.get(data.mobsKilled.indexOf(e2))) message = color + quester.getCurrentStage(quest).objectiveOverride
+ "/" + (stage.mobNumToKill.get(stage.mobsToKill.indexOf(e))); + color + ": " + (data.mobNumKilled.get(data.mobsKilled.indexOf(e2)))
if (depends.getPlaceholderApi() != null) { + "/" + (stage.mobNumToKill.get(stage.mobsToKill.indexOf(e)));
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems()) {
localeQuery.sendMessage(quester.getPlayer(), message, e, null);
} else {
quester.getPlayer().sendMessage(message.replace("<mob>",
MiscUtil.getProperMobName(e)));
}
} else {
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "killAtLocation") + " "
+ ChatColor.AQUA + "<mob>" + ChatColor.GREEN + ": "
+ (data.mobNumKilled.get(data.mobsKilled.indexOf(e2)))
+ "/" + (stage.mobNumToKill.get(stage.mobsToKill.indexOf(e)));
message = message.replace("<location>",
stage.killNames.get(stage.mobsToKill.indexOf(e)));
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems()) {
localeQuery.sendMessage(quester.getPlayer(), message, e, null);
} else {
quester.getPlayer().sendMessage(message.replace("<mob>",
MiscUtil.getProperMobName(e)));
}
}
} else { } else {
if (stage.locationsToKillWithin.isEmpty()) { if (stage.locationsToKillWithin.isEmpty()) {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "kill") + " " message = color + Lang.get(quester.getPlayer(), "kill") + " "
+ ChatColor.AQUA + "<mob>" + ChatColor.GRAY + ": " + ChatColor.AQUA + "<mob>" + color + ": "
+ (data.mobNumKilled.get(data.mobsKilled.indexOf(e2))) + (data.mobNumKilled.get(data.mobsKilled.indexOf(e2)))
+ "/" + (stage.mobNumToKill.get(stage.mobsToKill.indexOf(e))); + "/" + (stage.mobNumToKill.get(stage.mobsToKill.indexOf(e)));
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems()) {
localeQuery.sendMessage(quester.getPlayer(), message, e, null);
} else {
quester.getPlayer().sendMessage(message.replace("<mob>",
MiscUtil.getProperMobName(e)));
}
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "killAtLocation") + " " message = color + Lang.get(quester.getPlayer(), "killAtLocation") + " "
+ ChatColor.AQUA + "<mob>" + ChatColor.GRAY + ": " + ChatColor.AQUA + "<mob>" + color + ": "
+ (data.mobNumKilled.get(data.mobsKilled.indexOf(e2))) + (data.mobNumKilled.get(data.mobsKilled.indexOf(e2)))
+ "/" + (stage.mobNumToKill.get(stage.mobsToKill.indexOf(e))); + "/" + (stage.mobNumToKill.get(stage.mobsToKill.indexOf(e)));
message = message.replace("<location>",
stage.killNames.get(stage.mobsToKill.indexOf(e)));
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems()) {
localeQuery.sendMessage(quester.getPlayer(), message, e, null);
} else {
quester.getPlayer().sendMessage(message.replace("<mob>",
MiscUtil.getProperMobName(e)));
}
} }
} }
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems()) {
localeQuery.sendMessage(quester.getPlayer(), message, e, null);
} else {
quester.getPlayer().sendMessage(message.replace("<mob>",
MiscUtil.getProperMobName(e)));
}
} }
} }
} }
} }
if (stage.playersToKill != null) { if (stage.playersToKill != null) {
if (data.getPlayersKilled() < stage.playersToKill) { ChatColor color = data.getPlayersKilled() < stage.playersToKill ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "killPlayer") String message = "";
+ ChatColor.GREEN + ": " + data.getPlayersKilled() + "/" + stage.playersToKill; if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); + color + ": " + data.getPlayersKilled() + "/" + stage.playersToKill;
}
quester.getPlayer().sendMessage(message);
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "killPlayer") message = color + Lang.get(quester.getPlayer(), "killPlayer")
+ ChatColor.GRAY + ": " + data.getPlayersKilled() + "/" + stage.playersToKill; + color + ": " + data.getPlayersKilled() + "/" + stage.playersToKill;
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
} }
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
} }
int index = 0; int index = 0;
for (ItemStack is : stage.itemsToDeliver) { for (ItemStack is : stage.itemsToDeliver) {
@ -1109,52 +993,41 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
int amt = is.getAmount(); int amt = is.getAmount();
Integer npc = stage.itemDeliveryTargets.get(index); Integer npc = stage.itemDeliveryTargets.get(index);
index++; index++;
if (delivered < amt) { ChatColor color = delivered < amt ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "deliver") String message = "";
+ ChatColor.GREEN + ": " + delivered + "/" + is.getAmount(); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
message = message.replace("<npc>", getNPCName(npc)); message = color + quester.getCurrentStage(quest).objectiveOverride
if (depends.getPlaceholderApi() != null) { + color + ": " + delivered + "/" + is.getAmount();
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
is.getEnchantments());
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is)));
}
} else { } else {
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "deliver") message = color + Lang.get(quester.getPlayer(), "deliver")
+ ChatColor.GREEN + ": " + delivered + "/" + is.getAmount(); + color + ": " + delivered + "/" + is.getAmount();
message = message.replace("<npc>", getNPCName(npc)); }
if (depends.getPlaceholderApi() != null) { message = message.replace("<npc>", depends.getNPCName(npc));
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message); if (depends.getPlaceholderApi() != null) {
} message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) { }
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(), if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
is.getEnchantments()); localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
} else { is.getEnchantments());
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is))); } else {
} quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(is)));
} }
} }
for (Integer n : stage.citizensToInteract) { for (Integer n : stage.citizensToInteract) {
for (Entry<Integer, Boolean> e : data.citizensInteracted.entrySet()) { for (Entry<Integer, Boolean> e : data.citizensInteracted.entrySet()) {
if (e.getKey().equals(n)) { if (e.getKey().equals(n)) {
if (e.getValue() == false) { ChatColor color = e.getValue() == false ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "talkTo"); String message = "";
message = message.replace("<npc>", getNPCName(n)); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (depends.getPlaceholderApi() != null) { message = color + quester.getCurrentStage(quest).objectiveOverride;
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "talkTo"); message = color + Lang.get(quester.getPlayer(), "talkTo");
message = message.replace("<npc>", getNPCName(n));
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
} }
message = message.replace("<npc>", getNPCName(n));
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
} }
} }
} }
@ -1163,26 +1036,23 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (n.equals(n2)) { if (n.equals(n2)) {
if (data.citizenNumKilled.size() > data.citizensKilled.indexOf(n2) if (data.citizenNumKilled.size() > data.citizensKilled.indexOf(n2)
&& stage.citizenNumToKill.size() > stage.citizensToKill.indexOf(n)) { && stage.citizenNumToKill.size() > stage.citizensToKill.indexOf(n)) {
if (data.citizenNumKilled.get(data.citizensKilled.indexOf(n2)) ChatColor color = data.citizenNumKilled.get(data.citizensKilled.indexOf(n2))
< stage.citizenNumToKill.get(stage.citizensToKill.indexOf(n))) { < stage.citizenNumToKill.get(stage.citizensToKill.indexOf(n)) == false
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "kill") + " " ? ChatColor.GREEN : ChatColor.GRAY;
+ getNPCName(n) + ChatColor.GREEN + " " String message = "";
+ data.citizenNumKilled.get(stage.citizensToKill.indexOf(n)) + "/" if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
message = color + quester.getCurrentStage(quest).objectiveOverride
+ color + " " + data.citizenNumKilled.get(stage.citizensToKill.indexOf(n)) + "/"
+ stage.citizenNumToKill.get(stage.citizensToKill.indexOf(n)); + stage.citizenNumToKill.get(stage.citizensToKill.indexOf(n));
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "kill") + " " message = color + Lang.get(quester.getPlayer(), "kill") + " " + depends.getNPCName(n)
+ getNPCName(n) + ChatColor.GRAY + " " + color + " " + data.citizenNumKilled.get(stage.citizensToKill.indexOf(n)) + "/"
+ data.citizenNumKilled.get(stage.citizensToKill.indexOf(n)) + "/"
+ stage.citizenNumToKill.get(stage.citizensToKill.indexOf(n)); + stage.citizenNumToKill.get(stage.citizensToKill.indexOf(n));
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
} }
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
quester.getPlayer().sendMessage(message);
} }
} }
} }
@ -1190,24 +1060,20 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
for (Entry<EntityType, Integer> e : stage.mobsToTame.entrySet()) { for (Entry<EntityType, Integer> e : stage.mobsToTame.entrySet()) {
for (Entry<EntityType, Integer> e2 : data.mobsTamed.entrySet()) { for (Entry<EntityType, Integer> e2 : data.mobsTamed.entrySet()) {
if (e.getKey().equals(e2.getKey())) { if (e.getKey().equals(e2.getKey())) {
if (e2.getValue() < e.getValue()) { ChatColor color = e2.getValue() < e.getValue() == false ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "tame") + " " + "<mob>" String message = "";
+ ChatColor.GREEN + ": " + e2.getValue() + "/" + e.getValue(); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
if (getSettings().canTranslateItems()) { message = color + quester.getCurrentStage(quest).objectiveOverride
localeQuery.sendMessage(quester.getPlayer(), message, e.getKey(), null); + color + ": " + e2.getValue() + "/" + e.getValue();
} else {
quester.getPlayer().sendMessage(message.replace("<mob>",
MiscUtil.getProperMobName(e.getKey())));
}
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "tame") + " " + "<mob>" message = color + Lang.get(quester.getPlayer(), "tame") + " " + "<mob>"
+ ChatColor.GRAY + ": " + e2.getValue() + "/" + e.getValue(); + color + ": " + e2.getValue() + "/" + e.getValue();
if (getSettings().canTranslateItems()) { }
localeQuery.sendMessage(quester.getPlayer(), message, e.getKey(), null); if (getSettings().canTranslateItems()) {
} else { localeQuery.sendMessage(quester.getPlayer(), message, e.getKey(), null);
quester.getPlayer().sendMessage(message.replace("<mob>", } else {
MiscUtil.getProperMobName(e.getKey()))); quester.getPlayer().sendMessage(message.replace("<mob>",
} MiscUtil.getProperMobName(e.getKey())));
} }
} }
} }
@ -1215,17 +1081,17 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
for (Entry<DyeColor, Integer> e : stage.sheepToShear.entrySet()) { for (Entry<DyeColor, Integer> e : stage.sheepToShear.entrySet()) {
for (Entry<DyeColor, Integer> e2 : data.sheepSheared.entrySet()) { for (Entry<DyeColor, Integer> e2 : data.sheepSheared.entrySet()) {
if (e.getKey().equals(e2.getKey())) { if (e.getKey().equals(e2.getKey())) {
if (e2.getValue() < e.getValue()) { ChatColor color = e2.getValue() < e.getValue() == false ? ChatColor.GREEN : ChatColor.GRAY;
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "shearSheep") String message = "";
+ ChatColor.GREEN + ": " + e2.getValue() + "/" + e.getValue(); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
message = message.replace("<color>", e.getKey().name().toLowerCase()); message = color + quester.getCurrentStage(quest).objectiveOverride
quester.getPlayer().sendMessage(message); + color + ": " + e2.getValue() + "/" + e.getValue();
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "shearSheep") message = color + Lang.get(quester.getPlayer(), "shearSheep")
+ ChatColor.GRAY + ": " + e2.getValue() + "/" + e.getValue(); + color + ": " + e2.getValue() + "/" + e.getValue();
message = message.replace("<color>", e.getKey().name().toLowerCase());
quester.getPlayer().sendMessage(message);
} }
message = message.replace("<color>", e.getKey().name().toLowerCase());
quester.getPlayer().sendMessage(message);
} }
} }
} }
@ -1233,17 +1099,17 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
for (Location l2 : data.locationsReached) { for (Location l2 : data.locationsReached) {
if (l.equals(l2)) { if (l.equals(l2)) {
if (!data.hasReached.isEmpty()) { if (!data.hasReached.isEmpty()) {
if (data.hasReached.get(data.locationsReached.indexOf(l2)) == false) { ChatColor color = data.hasReached.get(data.locationsReached.indexOf(l2)) == false
String message = ChatColor.GREEN + Lang.get(quester.getPlayer(), "goTo"); ? ChatColor.GREEN : ChatColor.GRAY;
message = message.replace("<location>", String message = "";
stage.locationNames.get(stage.locationsToReach.indexOf(l))); if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
quester.getPlayer().sendMessage(message); message = color + quester.getCurrentStage(quest).objectiveOverride;
} else { } else {
String message = ChatColor.GRAY + Lang.get(quester.getPlayer(), "goTo"); message = color + Lang.get(quester.getPlayer(), "goTo");
message = message.replace("<location>",
stage.locationNames.get(stage.locationsToReach.indexOf(l)));
quester.getPlayer().sendMessage(message);
} }
message = message.replace("<location>",
stage.locationNames.get(stage.locationsToReach.indexOf(l)));
quester.getPlayer().sendMessage(message);
} }
} }
} }
@ -1251,11 +1117,14 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
for (String s : stage.passwordDisplays) { for (String s : stage.passwordDisplays) {
if (data.passwordsSaid.containsKey(s)) { if (data.passwordsSaid.containsKey(s)) {
Boolean b = data.passwordsSaid.get(s); Boolean b = data.passwordsSaid.get(s);
if (b != null && !b) { ChatColor color = b != null && !b == false ? ChatColor.GREEN : ChatColor.GRAY;
quester.getPlayer().sendMessage(ChatColor.GREEN + s); String message = "";
if (!ignoreOverrides && quester.getCurrentStage(quest).objectiveOverride != null) {
message = color + quester.getCurrentStage(quest).objectiveOverride;
} else { } else {
quester.getPlayer().sendMessage(ChatColor.GRAY + s); message = color + s;
} }
quester.getPlayer().sendMessage(message);
} }
} }
for (CustomObjective co : stage.customObjectives) { for (CustomObjective co : stage.customObjectives) {