mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-26 04:36:06 +01:00
Update quest completion messages to adhere to modern strings
This commit is contained in:
parent
1882ffdc32
commit
33f53917f5
@ -2709,8 +2709,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
final String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + pass;
|
final String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + pass;
|
||||||
p.sendMessage(message);
|
p.sendMessage(message);
|
||||||
} else if (type.equals(ObjectiveType.BREAK_BLOCK)) {
|
} else if (type.equals(ObjectiveType.BREAK_BLOCK)) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "break") + " <item>";
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "break");
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += " <item>" + ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
|
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
|
||||||
@ -2718,9 +2723,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
p.sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
|
p.sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
|
||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.DAMAGE_BLOCK)) {
|
} else if (type.equals(ObjectiveType.DAMAGE_BLOCK)) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "damage")
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "damage");
|
||||||
+ " <item>";
|
if (message.contains("<count>")) {
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += " <item>" + ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
|
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
|
||||||
@ -2728,8 +2737,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
p.sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
|
p.sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
|
||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.PLACE_BLOCK)) {
|
} else if (type.equals(ObjectiveType.PLACE_BLOCK)) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "place") + " <item>";
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "place");
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += " <item>" + ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
|
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
|
||||||
@ -2737,8 +2751,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
p.sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
|
p.sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
|
||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.USE_BLOCK)) {
|
} else if (type.equals(ObjectiveType.USE_BLOCK)) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "use") + " <item>";
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "use");
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += " <item>" + ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
|
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
|
||||||
@ -2746,8 +2765,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
p.sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
|
p.sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
|
||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.CUT_BLOCK)) {
|
} else if (type.equals(ObjectiveType.CUT_BLOCK)) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "cut") + " <item>";
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "cut");
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += " <item>" + ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
|
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
|
||||||
@ -2756,8 +2780,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.CRAFT_ITEM)) {
|
} else if (type.equals(ObjectiveType.CRAFT_ITEM)) {
|
||||||
final ItemStack is = getCurrentStage(quest).itemsToCraft.get(getCurrentStage(quest).itemsToCraft.indexOf(goal));
|
final ItemStack is = getCurrentStage(quest).itemsToCraft.get(getCurrentStage(quest).itemsToCraft.indexOf(goal));
|
||||||
final String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "craftItem")
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "craftItem");
|
||||||
+ " " + is.getAmount() + "/" + is.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + is.getAmount() + "/" + is.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.GREEN + ": " + is.getAmount() + "/" + is.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null);
|
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null);
|
||||||
@ -2766,8 +2795,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.SMELT_ITEM)) {
|
} else if (type.equals(ObjectiveType.SMELT_ITEM)) {
|
||||||
final ItemStack is = getCurrentStage(quest).itemsToSmelt.get(getCurrentStage(quest).itemsToSmelt.indexOf(goal));
|
final ItemStack is = getCurrentStage(quest).itemsToSmelt.get(getCurrentStage(quest).itemsToSmelt.indexOf(goal));
|
||||||
final String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "smeltItem")
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "smeltItem");
|
||||||
+ " " + is.getAmount() + "/" + is.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + is.getAmount() + "/" + is.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.GREEN + ": " + is.getAmount() + "/" + is.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null);
|
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null);
|
||||||
@ -2776,8 +2810,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.ENCHANT_ITEM)) {
|
} else if (type.equals(ObjectiveType.ENCHANT_ITEM)) {
|
||||||
final ItemStack is = getCurrentStage(quest).itemsToEnchant.get(getCurrentStage(quest).itemsToEnchant.indexOf(goal));
|
final ItemStack is = getCurrentStage(quest).itemsToEnchant.get(getCurrentStage(quest).itemsToEnchant.indexOf(goal));
|
||||||
final String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "enchItem")
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "enchItem");
|
||||||
+ " " + is.getAmount() + "/" + is.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + is.getAmount() + "/" + is.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.GREEN + ": " + is.getAmount() + "/" + is.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null);
|
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null);
|
||||||
@ -2786,8 +2825,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.BREW_ITEM)) {
|
} else if (type.equals(ObjectiveType.BREW_ITEM)) {
|
||||||
final ItemStack is = getCurrentStage(quest).itemsToBrew.get(getCurrentStage(quest).itemsToBrew.indexOf(goal));
|
final ItemStack is = getCurrentStage(quest).itemsToBrew.get(getCurrentStage(quest).itemsToBrew.indexOf(goal));
|
||||||
final String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "brewItem")
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "brewItem");
|
||||||
+ " " + is.getAmount() + "/" + is.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + is.getAmount() + "/" + is.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.GREEN + ": " + is.getAmount() + "/" + is.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null,
|
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null,
|
||||||
@ -2798,8 +2842,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
} else if (type.equals(ObjectiveType.CONSUME_ITEM)) {
|
} else if (type.equals(ObjectiveType.CONSUME_ITEM)) {
|
||||||
final ItemStack is = getCurrentStage(quest).itemsToConsume.get(getCurrentStage(quest).itemsToConsume
|
final ItemStack is = getCurrentStage(quest).itemsToConsume.get(getCurrentStage(quest).itemsToConsume
|
||||||
.indexOf(goal));
|
.indexOf(goal));
|
||||||
final String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "consumeItem")
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "consumeItem");
|
||||||
+ " " + is.getAmount() + "/" + is.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + is.getAmount() + "/" + is.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.GREEN + ": " + is.getAmount() + "/" + is.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null);
|
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null);
|
||||||
@ -2807,12 +2856,17 @@ public class Quester implements Comparable<Quester> {
|
|||||||
p.sendMessage(message.replace("<item>", ItemUtil.getName(is)));
|
p.sendMessage(message.replace("<item>", ItemUtil.getName(is)));
|
||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.DELIVER_ITEM)) {
|
} else if (type.equals(ObjectiveType.DELIVER_ITEM)) {
|
||||||
String obj = Lang.get(p, "deliver");
|
|
||||||
obj = obj.replace("<npc>", plugin.getDependencies().getNPCName(getCurrentStage(quest).itemDeliveryTargets
|
|
||||||
.get(getCurrentStage(quest).itemsToDeliver.indexOf(goal))));
|
|
||||||
final String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + obj;
|
|
||||||
final ItemStack is = getCurrentStage(quest).itemsToDeliver.get(getCurrentStage(quest).itemsToDeliver
|
final ItemStack is = getCurrentStage(quest).itemsToDeliver.get(getCurrentStage(quest).itemsToDeliver
|
||||||
.indexOf(goal));
|
.indexOf(goal));
|
||||||
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "deliver")
|
||||||
|
.replace("<npc>", plugin.getDependencies().getNPCName(getCurrentStage(quest).itemDeliveryTargets
|
||||||
|
.get(getCurrentStage(quest).itemsToDeliver.indexOf(goal))));
|
||||||
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + is.getAmount() + "/" + is.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.GREEN + ": " + is.getAmount() + "/" + is.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, is.getType(), is.getDurability(), null);
|
plugin.getLocaleQuery().sendMessage(p, message, is.getType(), is.getDurability(), null);
|
||||||
@ -2820,16 +2874,32 @@ public class Quester implements Comparable<Quester> {
|
|||||||
p.sendMessage(message.replace("<item>", ItemUtil.getName(is)));
|
p.sendMessage(message.replace("<item>", ItemUtil.getName(is)));
|
||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.MILK_COW)) {
|
} else if (type.equals(ObjectiveType.MILK_COW)) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "milkCow") + " ";
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "milkCow");
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount();
|
||||||
|
}
|
||||||
p.sendMessage(message);
|
p.sendMessage(message);
|
||||||
} else if (type.equals(ObjectiveType.CATCH_FISH)) {
|
} else if (type.equals(ObjectiveType.CATCH_FISH)) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "catchFish") + " ";
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "catchFish");
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount();
|
||||||
|
}
|
||||||
p.sendMessage(message);
|
p.sendMessage(message);
|
||||||
} else if (type.equals(ObjectiveType.KILL_MOB)) {
|
} else if (type.equals(ObjectiveType.KILL_MOB)) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "kill") + " <mob>";
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "kill");
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.AQUA + " <mob>" + ChatColor.GREEN + ": " + goal.getAmount() + "/"
|
||||||
|
+ goal.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames()) {
|
if (plugin.getSettings().canTranslateNames()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, mob, extra);
|
plugin.getLocaleQuery().sendMessage(p, message, mob, extra);
|
||||||
} else {
|
} else {
|
||||||
@ -2837,31 +2907,52 @@ public class Quester implements Comparable<Quester> {
|
|||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.KILL_PLAYER)) {
|
} else if (type.equals(ObjectiveType.KILL_PLAYER)) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "killPlayer");
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "killPlayer");
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount();
|
||||||
|
}
|
||||||
p.sendMessage(message);
|
p.sendMessage(message);
|
||||||
} else if (type.equals(ObjectiveType.TALK_TO_NPC)) {
|
} else if (type.equals(ObjectiveType.TALK_TO_NPC)) {
|
||||||
String obj = Lang.get(p, "talkTo");
|
final String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "talkTo")
|
||||||
obj = obj.replace("<npc>", plugin.getDependencies().getNPCName(npc.getId()));
|
.replace("<npc>", plugin.getDependencies().getNPCName(npc.getId()));
|
||||||
final String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + obj;
|
|
||||||
p.sendMessage(message);
|
p.sendMessage(message);
|
||||||
} else if (type.equals(ObjectiveType.KILL_NPC)) {
|
} else if (type.equals(ObjectiveType.KILL_NPC)) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "kill") + " "
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "kill");
|
||||||
+ npc.getName();
|
if (message.contains("<count>")) {
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
p.sendMessage(message);
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.AQUA + " <mob>" + ChatColor.GREEN + ": " + goal.getAmount() + "/"
|
||||||
|
+ goal.getAmount();
|
||||||
|
}
|
||||||
|
p.sendMessage(message.replace("<mob>", plugin.getDependencies().getNPCName(npc.getId())));
|
||||||
} else if (type.equals(ObjectiveType.TAME_MOB)) {
|
} else if (type.equals(ObjectiveType.TAME_MOB)) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "tame") + " <mob>";
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "tame");
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
if (!message.contains("<mob>")) {
|
||||||
|
message += " <mob>";
|
||||||
|
}
|
||||||
|
if (message.contains("<count>")) {
|
||||||
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount();
|
||||||
|
}
|
||||||
if (plugin.getSettings().canTranslateNames()) {
|
if (plugin.getSettings().canTranslateNames()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, mob, extra);
|
plugin.getLocaleQuery().sendMessage(p, message, mob, extra);
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage(message.replace("<mob>", MiscUtil.snakeCaseToUpperCamelCase(mob.name())));
|
p.sendMessage(message.replace("<mob>", MiscUtil.snakeCaseToUpperCamelCase(mob.name())));
|
||||||
}
|
}
|
||||||
} else if (type.equals(ObjectiveType.SHEAR_SHEEP)) {
|
} else if (type.equals(ObjectiveType.SHEAR_SHEEP)) {
|
||||||
String obj = Lang.get(p, "shearSheep");
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "shearSheep");
|
||||||
obj = obj.replace("<color>", color.name().toLowerCase());
|
message = message.replace("<color>", MiscUtil.getPrettyDyeColorName(color));
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + obj;
|
if (message.contains("<count>")) {
|
||||||
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
|
} else {
|
||||||
|
// Legacy
|
||||||
|
message += ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount();
|
||||||
|
}
|
||||||
p.sendMessage(message);
|
p.sendMessage(message);
|
||||||
} else if (type.equals(ObjectiveType.REACH_LOCATION)) {
|
} else if (type.equals(ObjectiveType.REACH_LOCATION)) {
|
||||||
String obj = Lang.get(p, "goTo");
|
String obj = Lang.get(p, "goTo");
|
||||||
|
@ -1018,6 +1018,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
if (message.contains("<count>")) {
|
if (message.contains("<count>")) {
|
||||||
message = message.replace("<count>", "" + color + crafted + "/" + is.getAmount());
|
message = message.replace("<count>", "" + color + crafted + "/" + is.getAmount());
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + crafted + "/" + is.getAmount();
|
message += color + ": " + crafted + "/" + is.getAmount();
|
||||||
}
|
}
|
||||||
if (depends.getPlaceholderApi() != null) {
|
if (depends.getPlaceholderApi() != null) {
|
||||||
@ -1041,6 +1042,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
if (message.contains("<count>")) {
|
if (message.contains("<count>")) {
|
||||||
message = message.replace("<count>", "" + color + smelted + "/" + is.getAmount());
|
message = message.replace("<count>", "" + color + smelted + "/" + is.getAmount());
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + smelted + "/" + is.getAmount();
|
message += color + ": " + smelted + "/" + is.getAmount();
|
||||||
}
|
}
|
||||||
if (depends.getPlaceholderApi() != null) {
|
if (depends.getPlaceholderApi() != null) {
|
||||||
@ -1064,6 +1066,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
if (message.contains("<count>")) {
|
if (message.contains("<count>")) {
|
||||||
message = message.replace("<count>", "" + color + enchanted + "/" + is.getAmount());
|
message = message.replace("<count>", "" + color + enchanted + "/" + is.getAmount());
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + enchanted + "/" + is.getAmount();
|
message += color + ": " + enchanted + "/" + is.getAmount();
|
||||||
}
|
}
|
||||||
if (depends.getPlaceholderApi() != null) {
|
if (depends.getPlaceholderApi() != null) {
|
||||||
@ -1094,6 +1097,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
if (message.contains("<count>")) {
|
if (message.contains("<count>")) {
|
||||||
message = message.replace("<count>", "" + color + brewed + "/" + is.getAmount());
|
message = message.replace("<count>", "" + color + brewed + "/" + is.getAmount());
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + brewed + "/" + is.getAmount();
|
message += color + ": " + brewed + "/" + is.getAmount();
|
||||||
}
|
}
|
||||||
if (depends.getPlaceholderApi() != null) {
|
if (depends.getPlaceholderApi() != null) {
|
||||||
@ -1124,6 +1128,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
if (message.contains("<count>")) {
|
if (message.contains("<count>")) {
|
||||||
message = message.replace("<count>", "" + color + consumed + "/" + is.getAmount());
|
message = message.replace("<count>", "" + color + consumed + "/" + is.getAmount());
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + consumed + "/" + is.getAmount();
|
message += color + ": " + consumed + "/" + is.getAmount();
|
||||||
}
|
}
|
||||||
if (depends.getPlaceholderApi() != null) {
|
if (depends.getPlaceholderApi() != null) {
|
||||||
@ -1142,6 +1147,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
if (message.contains("<count>")) {
|
if (message.contains("<count>")) {
|
||||||
message = message.replace("<count>", "" + color + data.getCowsMilked() + "/" + stage.cowsToMilk);
|
message = message.replace("<count>", "" + color + data.getCowsMilked() + "/" + stage.cowsToMilk);
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + data.getCowsMilked() + "/" + stage.cowsToMilk;
|
message += color + ": " + data.getCowsMilked() + "/" + stage.cowsToMilk;
|
||||||
}
|
}
|
||||||
if (depends.getPlaceholderApi() != null) {
|
if (depends.getPlaceholderApi() != null) {
|
||||||
@ -1155,6 +1161,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
if (message.contains("<count>")) {
|
if (message.contains("<count>")) {
|
||||||
message = message.replace("<count>", "" + color + data.getFishCaught() + "/" + stage.fishToCatch);
|
message = message.replace("<count>", "" + color + data.getFishCaught() + "/" + stage.fishToCatch);
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + data.getFishCaught() + "/" + stage.fishToCatch;
|
message += color + ": " + data.getFishCaught() + "/" + stage.fishToCatch;
|
||||||
}
|
}
|
||||||
if (depends.getPlaceholderApi() != null) {
|
if (depends.getPlaceholderApi() != null) {
|
||||||
@ -1214,6 +1221,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
if (message.contains("<count>")) {
|
if (message.contains("<count>")) {
|
||||||
message = message.replace("<count>", "" + color + data.getPlayersKilled() + "/" + stage.playersToKill);
|
message = message.replace("<count>", "" + color + data.getPlayersKilled() + "/" + stage.playersToKill);
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + data.getPlayersKilled() + "/" + stage.playersToKill;
|
message += color + ": " + data.getPlayersKilled() + "/" + stage.playersToKill;
|
||||||
}
|
}
|
||||||
if (depends.getPlaceholderApi() != null) {
|
if (depends.getPlaceholderApi() != null) {
|
||||||
@ -1235,6 +1243,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
if (message.contains("<count>")) {
|
if (message.contains("<count>")) {
|
||||||
message = message.replace("<count>", "" + color + delivered + "/" + toDeliver);
|
message = message.replace("<count>", "" + color + delivered + "/" + toDeliver);
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + delivered + "/" + toDeliver;
|
message += color + ": " + delivered + "/" + toDeliver;
|
||||||
}
|
}
|
||||||
if (depends.getPlaceholderApi() != null) {
|
if (depends.getPlaceholderApi() != null) {
|
||||||
@ -1279,6 +1288,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
+ 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)));
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + data.citizenNumKilled.get(stage.citizensToKill.indexOf(n)) + "/"
|
message += color + ": " + data.citizenNumKilled.get(stage.citizensToKill.indexOf(n)) + "/"
|
||||||
+ stage.citizenNumToKill.get(stage.citizensToKill.indexOf(n));
|
+ stage.citizenNumToKill.get(stage.citizensToKill.indexOf(n));
|
||||||
}
|
}
|
||||||
@ -1293,7 +1303,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
for (final Entry<EntityType, Integer> e : stage.mobsToTame.entrySet()) {
|
for (final Entry<EntityType, Integer> e : stage.mobsToTame.entrySet()) {
|
||||||
for (final Entry<EntityType, Integer> e2 : data.mobsTamed.entrySet()) {
|
for (final Entry<EntityType, Integer> e2 : data.mobsTamed.entrySet()) {
|
||||||
if (e.getKey().equals(e2.getKey())) {
|
if (e.getKey().equals(e2.getKey())) {
|
||||||
final ChatColor color = e2.getValue() < e.getValue() == false ? ChatColor.GREEN : ChatColor.GRAY;
|
final ChatColor color = e2.getValue() < e.getValue() ? ChatColor.GREEN : ChatColor.GRAY;
|
||||||
String message = color + Lang.get(quester.getPlayer(), "tame");
|
String message = color + Lang.get(quester.getPlayer(), "tame");
|
||||||
if (!message.contains("<mob>")) {
|
if (!message.contains("<mob>")) {
|
||||||
message += " <mob>";
|
message += " <mob>";
|
||||||
@ -1301,6 +1311,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
if (message.contains("<count>")) {
|
if (message.contains("<count>")) {
|
||||||
message = message.replace("<count>", "" + color + e2.getValue() + "/" + e.getValue());
|
message = message.replace("<count>", "" + color + e2.getValue() + "/" + e.getValue());
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + e2.getValue() + "/" + e.getValue();
|
message += color + ": " + e2.getValue() + "/" + e.getValue();
|
||||||
}
|
}
|
||||||
if (getSettings().canTranslateNames()) {
|
if (getSettings().canTranslateNames()) {
|
||||||
@ -1315,13 +1326,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
for (final Entry<DyeColor, Integer> e : stage.sheepToShear.entrySet()) {
|
for (final Entry<DyeColor, Integer> e : stage.sheepToShear.entrySet()) {
|
||||||
for (final Entry<DyeColor, Integer> e2 : data.sheepSheared.entrySet()) {
|
for (final Entry<DyeColor, Integer> e2 : data.sheepSheared.entrySet()) {
|
||||||
if (e.getKey().equals(e2.getKey())) {
|
if (e.getKey().equals(e2.getKey())) {
|
||||||
final ChatColor color = e2.getValue() < e.getValue() == false ? ChatColor.GREEN : ChatColor.GRAY;
|
final ChatColor color = e2.getValue() < e.getValue() ? ChatColor.GREEN : ChatColor.GRAY;
|
||||||
String message = color + Lang.get(quester.getPlayer(), "shearSheep");
|
String message = color + Lang.get(quester.getPlayer(), "shearSheep");
|
||||||
message = message.replace("<color>",
|
message = message.replace("<color>", MiscUtil.getPrettyDyeColorName(e.getKey()));
|
||||||
MiscUtil.getPrettyDyeColorName(MiscUtil.getProperDyeColor(e.getKey().name())));
|
|
||||||
if (message.contains("<count>")) {
|
if (message.contains("<count>")) {
|
||||||
message = message.replace("<count>", "" + color + e2.getValue() + "/" + e.getValue());
|
message = message.replace("<count>", "" + color + e2.getValue() + "/" + e.getValue());
|
||||||
} else {
|
} else {
|
||||||
|
// Legacy
|
||||||
message += color + ": " + e2.getValue() + "/" + e.getValue();
|
message += color + ": " + e2.getValue() + "/" + e.getValue();
|
||||||
}
|
}
|
||||||
quester.getPlayer().sendMessage(message);
|
quester.getPlayer().sendMessage(message);
|
||||||
|
Loading…
Reference in New Issue
Block a user