Divert tag color to lang files, part 1. See #2202

This commit is contained in:
PikaMug 2024-05-03 10:11:48 -04:00
parent c31362baa7
commit a6635bb79c
28 changed files with 177 additions and 172 deletions

View File

@ -401,8 +401,7 @@ public class BukkitAction implements Action {
} }
if (timer > 0) { if (timer > 0) {
player.sendMessage(ChatColor.GREEN + BukkitLang.get(player, "timerStart") player.sendMessage(ChatColor.GREEN + BukkitLang.get(player, "timerStart")
.replace("<time>", ChatColor.RED + BukkitMiscUtil.getTime(timer * 1000L) + ChatColor.GREEN) .replace("<time>", BukkitMiscUtil.getTime(timer * 1000L)).replace("<quest>", quest.getName()));
.replace("<quest>", ChatColor.GOLD + quest.getName() + ChatColor.GREEN));
final List<Integer> toNotify = Arrays.asList(60, 30, 10, 5, 4, 3, 2, 1); final List<Integer> toNotify = Arrays.asList(60, 30, 10, 5, 4, 3, 2, 1);
for (final int seconds : toNotify) { for (final int seconds : toNotify) {
if (timer > seconds) { if (timer > seconds) {

View File

@ -210,13 +210,11 @@ public class BukkitQuestCommandHandler {
for (final String questId : reqs.getBlockQuestIds()) { for (final String questId : reqs.getBlockQuestIds()) {
if (completed.containsKey(questId)) { if (completed.containsKey(questId)) {
String msg = BukkitLang.get("haveCompleted"); String msg = BukkitLang.get("haveCompleted");
msg = msg.replace("<quest>", ChatColor.ITALIC + "" + ChatColor.DARK_PURPLE msg = msg.replace("<quest>", completed.get(questId));
+ completed.get(questId) + ChatColor.RED);
cs.sendMessage(ChatColor.GRAY + "- " + ChatColor.RED + msg); cs.sendMessage(ChatColor.GRAY + "- " + ChatColor.RED + msg);
} else { } else {
String msg = BukkitLang.get("cannotComplete"); String msg = BukkitLang.get("cannotComplete");
msg = msg.replace("<quest>", ChatColor.ITALIC + "" + ChatColor.DARK_PURPLE msg = msg.replace("<quest>", plugin.getQuestById(questId).getName());
+ plugin.getQuestById(questId).getName() + ChatColor.GREEN);
cs.sendMessage(ChatColor.GRAY + "- " + ChatColor.GREEN + msg); cs.sendMessage(ChatColor.GRAY + "- " + ChatColor.GREEN + msg);
} }
} }

View File

@ -104,71 +104,62 @@ public class BukkitQuestadminCommandHandler {
final boolean translateSubCommands = plugin.getConfigSettings().canTranslateSubCommands(); final boolean translateSubCommands = plugin.getConfigSettings().canTranslateSubCommands();
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.stats")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.stats")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED + BukkitLang.get("COMMAND_QUESTADMIN_STATS_HELP") cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED + BukkitLang.get("COMMAND_QUESTADMIN_STATS_HELP")
.replace("<command>", ChatColor.GOLD + (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_STATS") .replace("<command>", translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_STATS") : "stats"));
: "stats") + ChatColor.RED));
} }
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.give")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.give")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED + BukkitLang.get("COMMAND_QUESTADMIN_GIVE_HELP") cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED + BukkitLang.get("COMMAND_QUESTADMIN_GIVE_HELP")
.replace("<command>", ChatColor.GOLD + (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_GIVE") .replace("<command>", translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_GIVE") : "give"));
: "give") + ChatColor.RED));
} }
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.quit")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.quit")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED + BukkitLang.get("COMMAND_QUESTADMIN_QUIT_HELP") cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED + BukkitLang.get("COMMAND_QUESTADMIN_QUIT_HELP")
.replace("<command>", ChatColor.GOLD + (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_QUIT") .replace("<command>", translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_QUIT") : "quit"));
: "quit") + ChatColor.RED));
} }
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.points")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.points")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
+ BukkitLang.get("COMMAND_QUESTADMIN_POINTS_HELP") + BukkitLang.get("COMMAND_QUESTADMIN_POINTS_HELP")
.replace("<points>", BukkitLang.get("questPoints")) .replace("<points>", BukkitLang.get("questPoints"))
.replace("<command>", ChatColor.GOLD .replace("<command>", translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_POINTS") : "points"));
+ (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_POINTS") : "points") + ChatColor.RED));
} }
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.takepoints")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.takepoints")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
+ BukkitLang.get("COMMAND_QUESTADMIN_TAKEPOINTS_HELP") + BukkitLang.get("COMMAND_QUESTADMIN_TAKEPOINTS_HELP")
.replace("<points>", BukkitLang.get("questPoints")) .replace("<points>", BukkitLang.get("questPoints"))
.replace("<command>", ChatColor.GOLD .replace("<command>", translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_TAKEPOINTS") : "takepoints"));
+ (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_TAKEPOINTS") : "takepoints")
+ ChatColor.RED));
} }
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.givepoints")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.givepoints")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
+ BukkitLang.get("COMMAND_QUESTADMIN_GIVEPOINTS_HELP") + BukkitLang.get("COMMAND_QUESTADMIN_GIVEPOINTS_HELP")
.replace("<points>", BukkitLang.get("questPoints")) .replace("<points>", BukkitLang.get("questPoints"))
.replace("<command>", ChatColor.GOLD .replace("<command>", translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_GIVEPOINTS") : "givepoints"));
+ (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_GIVEPOINTS") : "givepoints")
+ ChatColor.RED));
} }
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.finish")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.finish")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
+ BukkitLang.get("COMMAND_QUESTADMIN_FINISH_HELP").replace("<command>", ChatColor.GOLD + BukkitLang.get("COMMAND_QUESTADMIN_FINISH_HELP").replace("<command>",
+ (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_FINISH") : "finish") + ChatColor.RED)); translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_FINISH") : "finish"));
} }
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.nextstage")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.nextstage")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
+ BukkitLang.get("COMMAND_QUESTADMIN_NEXTSTAGE_HELP").replace("<command>", ChatColor.GOLD + BukkitLang.get("COMMAND_QUESTADMIN_NEXTSTAGE_HELP").replace("<command>",
+ (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_NEXTSTAGE") : "nextstage") + ChatColor.RED)); translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_NEXTSTAGE") : "nextstage"));
} }
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.setstage")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.setstage")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
+ BukkitLang.get("COMMAND_QUESTADMIN_SETSTAGE_HELP").replace("<command>", ChatColor.GOLD + BukkitLang.get("COMMAND_QUESTADMIN_SETSTAGE_HELP").replace("<command>",
+ (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_SETSTAGE") : "setstage") + ChatColor.RED)); translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_SETSTAGE") : "setstage"));
} }
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.reset")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.reset")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED+ BukkitLang.get("COMMAND_QUESTADMIN_RESET_HELP") cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED+ BukkitLang.get("COMMAND_QUESTADMIN_RESET_HELP")
.replace("<command>", ChatColor.GOLD + (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_RESET") .replace("<command>", translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_RESET") : "reset"));
: "reset") + ChatColor.RED));
} }
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.remove")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.remove")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
+ BukkitLang.get("COMMAND_QUESTADMIN_REMOVE_HELP").replace("<command>", ChatColor.GOLD + BukkitLang.get("COMMAND_QUESTADMIN_REMOVE_HELP").replace("<command>",
+ (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_REMOVE") : "remove") + ChatColor.RED)); translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_REMOVE") : "remove"));
} }
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.reload")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.reload")) {
cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED cs.sendMessage(ChatColor.YELLOW + "/questadmin " + ChatColor.RED
+ BukkitLang.get("COMMAND_QUESTADMIN_RELOAD_HELP").replace("<command>", ChatColor.GOLD + BukkitLang.get("COMMAND_QUESTADMIN_RELOAD_HELP").replace("<command>",
+ (translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_RELOAD") : "reload") + ChatColor.RED)); translateSubCommands ? BukkitLang.get("COMMAND_QUESTADMIN_RELOAD") : "reload"));
} }
} }

View File

@ -77,10 +77,13 @@ public class BukkitQuestadminFinishCommand extends BukkitQuestsSubCommand {
try { try {
target = Bukkit.getOfflinePlayer(UUID.fromString(args[1])); target = Bukkit.getOfflinePlayer(UUID.fromString(args[1]));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound")); // Do nothing
return;
} }
} }
if (target == null || target.getName() == null) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound"));
return;
}
final Quester quester = plugin.getQuester(target.getUniqueId()); final Quester quester = plugin.getQuester(target.getUniqueId());
if (quester.getCurrentQuests().isEmpty() && target.getName() != null) { if (quester.getCurrentQuests().isEmpty() && target.getName() != null) {
String msg = BukkitLang.get("noCurrentQuest"); String msg = BukkitLang.get("noCurrentQuest");
@ -93,14 +96,14 @@ public class BukkitQuestadminFinishCommand extends BukkitQuestsSubCommand {
return; return;
} }
String msg1 = BukkitLang.get("questForceFinish"); String msg1 = BukkitLang.get("questForceFinish");
msg1 = msg1.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD); msg1 = msg1.replace("<player>", target.getName());
msg1 = msg1.replace("<quest>", ChatColor.DARK_PURPLE + quest.getName() + ChatColor.GOLD); msg1 = msg1.replace("<quest>", quest.getName());
cs.sendMessage(ChatColor.GOLD + msg1); cs.sendMessage(ChatColor.GOLD + msg1);
if (target.isOnline()) { if (target.isOnline()) {
final Player p = (Player)target; final Player p = (Player)target;
String msg2 = BukkitLang.get(p, "questForcedFinish"); String msg2 = BukkitLang.get(p, "questForcedFinish");
msg2 = msg2.replace("<player>", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); msg2 = msg2.replace("<player>", cs.getName());
msg2 = msg2.replace("<quest>", ChatColor.DARK_PURPLE + quest.getName() + ChatColor.GOLD); msg2 = msg2.replace("<quest>", quest.getName());
p.sendMessage(ChatColor.GREEN + msg2); p.sendMessage(ChatColor.GREEN + msg2);
} }
quest.completeQuest(quester); quest.completeQuest(quester);

View File

@ -76,10 +76,13 @@ public class BukkitQuestadminGiveCommand extends BukkitQuestsSubCommand {
try { try {
target = Bukkit.getOfflinePlayer(UUID.fromString(args[1])); target = Bukkit.getOfflinePlayer(UUID.fromString(args[1]));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound")); // Do nothing
return;
} }
} }
if (target == null || target.getName() == null) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound"));
return;
}
final Quest questToGive; final Quest questToGive;
StringBuilder name = new StringBuilder(); StringBuilder name = new StringBuilder();
if (args.length == 3) { if (args.length == 3) {
@ -102,24 +105,22 @@ public class BukkitQuestadminGiveCommand extends BukkitQuestsSubCommand {
for (final Quest q : quester.getCurrentQuests().keySet()) { for (final Quest q : quester.getCurrentQuests().keySet()) {
if (q.getName().equalsIgnoreCase(questToGive.getName())) { if (q.getName().equalsIgnoreCase(questToGive.getName())) {
String msg = BukkitLang.get("questsPlayerHasQuestAlready"); String msg = BukkitLang.get("questsPlayerHasQuestAlready");
msg = msg.replace("<player>", ChatColor.ITALIC + "" + ChatColor.GREEN + target.getName() msg = msg.replace("<player>", target.getName());
+ ChatColor.RESET + ChatColor.YELLOW); msg = msg.replace("<quest>", questToGive.getName());
msg = msg.replace("<quest>", ChatColor.ITALIC + "" + ChatColor.DARK_PURPLE
+ questToGive.getName() + ChatColor.RESET + ChatColor.YELLOW);
cs.sendMessage(ChatColor.YELLOW + msg); cs.sendMessage(ChatColor.YELLOW + msg);
return; return;
} }
} }
quester.hardQuit(questToGive); quester.hardQuit(questToGive);
String msg1 = BukkitLang.get("questForceTake"); String msg1 = BukkitLang.get("questForceTake");
msg1 = msg1.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD); msg1 = msg1.replace("<player>", target.getName());
msg1 = msg1.replace("<quest>", ChatColor.DARK_PURPLE + questToGive.getName() + ChatColor.GOLD); msg1 = msg1.replace("<quest>", questToGive.getName());
cs.sendMessage(ChatColor.GOLD + msg1); cs.sendMessage(ChatColor.GOLD + msg1);
if (target.isOnline()) { if (target.isOnline()) {
final Player p = (Player)target; final Player p = (Player)target;
String msg2 = BukkitLang.get(p, "questForcedTake"); String msg2 = BukkitLang.get(p, "questForcedTake");
msg2 = msg2.replace("<player>", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); msg2 = msg2.replace("<player>", cs.getName());
msg2 = msg2.replace("<quest>", ChatColor.DARK_PURPLE + questToGive.getName() + ChatColor.GOLD); msg2 = msg2.replace("<quest>", questToGive.getName());
p.sendMessage(ChatColor.GREEN + msg2); p.sendMessage(ChatColor.GREEN + msg2);
} }
quester.takeQuest(questToGive, true); quester.takeQuest(questToGive, true);

View File

@ -74,10 +74,13 @@ public class BukkitQuestadminGivepointsCommand extends BukkitQuestsSubCommand {
try { try {
target = Bukkit.getOfflinePlayer(UUID.fromString(args[1])); target = Bukkit.getOfflinePlayer(UUID.fromString(args[1]));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound")); // Do nothing
return;
} }
} }
if (target == null || target.getName() == null) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound"));
return;
}
final int points; final int points;
try { try {
points = Integer.parseInt(args[2]); points = Integer.parseInt(args[2]);
@ -88,14 +91,14 @@ public class BukkitQuestadminGivepointsCommand extends BukkitQuestsSubCommand {
final Quester quester = plugin.getQuester(target.getUniqueId()); final Quester quester = plugin.getQuester(target.getUniqueId());
quester.setQuestPoints(quester.getQuestPoints() + Math.abs(points)); quester.setQuestPoints(quester.getQuestPoints() + Math.abs(points));
String msg1 = BukkitLang.get("giveQuestPoints").replace("<points>", BukkitLang.get("questPoints")); String msg1 = BukkitLang.get("giveQuestPoints").replace("<points>", BukkitLang.get("questPoints"));
msg1 = msg1.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD); msg1 = msg1.replace("<player>", target.getName());
msg1 = msg1.replace("<number>", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); msg1 = msg1.replace("<number>", String.valueOf(points));
cs.sendMessage(ChatColor.GOLD + msg1); cs.sendMessage(ChatColor.GOLD + msg1);
if (target.isOnline()) { if (target.isOnline()) {
final Player p = (Player)target; final Player p = (Player)target;
String msg2 = BukkitLang.get(p, "questPointsGiven").replace("<points>", BukkitLang.get("questPoints")); String msg2 = BukkitLang.get(p, "questPointsGiven").replace("<points>", BukkitLang.get("questPoints"));
msg2 = msg2.replace("<player>", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); msg2 = msg2.replace("<player>", cs.getName());
msg2 = msg2.replace("<number>", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); msg2 = msg2.replace("<number>", String.valueOf(points));
p.sendMessage(ChatColor.GREEN + msg2); p.sendMessage(ChatColor.GREEN + msg2);
} }
quester.saveData(); quester.saveData();

View File

@ -77,12 +77,15 @@ public class BukkitQuestadminNextstageCommand extends BukkitQuestsSubCommand {
try { try {
target = Bukkit.getOfflinePlayer(UUID.fromString(args[1])); target = Bukkit.getOfflinePlayer(UUID.fromString(args[1]));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound")); // Do nothing
return;
} }
} }
if (target == null || target.getName() == null) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound"));
return;
}
final Quester quester = plugin.getQuester(target.getUniqueId()); final Quester quester = plugin.getQuester(target.getUniqueId());
if (quester.getCurrentQuests().isEmpty() && target.getName() != null) { if (quester.getCurrentQuests().isEmpty()) {
String msg = BukkitLang.get("noCurrentQuest"); String msg = BukkitLang.get("noCurrentQuest");
msg = msg.replace("<player>", target.getName()); msg = msg.replace("<player>", target.getName());
cs.sendMessage(ChatColor.YELLOW + msg); cs.sendMessage(ChatColor.YELLOW + msg);
@ -93,14 +96,14 @@ public class BukkitQuestadminNextstageCommand extends BukkitQuestsSubCommand {
return; return;
} }
String msg1 = BukkitLang.get("questForceNextStage"); String msg1 = BukkitLang.get("questForceNextStage");
msg1 = msg1.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD); msg1 = msg1.replace("<player>", target.getName());
msg1 = msg1.replace("<quest>", ChatColor.DARK_PURPLE + quest.getName() + ChatColor.GOLD); msg1 = msg1.replace("<quest>", quest.getName());
cs.sendMessage(ChatColor.GOLD + msg1); cs.sendMessage(ChatColor.GOLD + msg1);
if (target.isOnline()) { if (target.isOnline()) {
final Player p = (Player)target; final Player p = (Player)target;
String msg2 = BukkitLang.get(p, "questForcedNextStage"); String msg2 = BukkitLang.get(p, "questForcedNextStage");
msg2 = msg2.replace("<player>", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); msg2 = msg2.replace("<player>", cs.getName());
msg2 = msg2.replace("<quest>", ChatColor.DARK_PURPLE + quest.getName() + ChatColor.GOLD); msg2 = msg2.replace("<quest>", quest.getName());
p.sendMessage(ChatColor.GREEN + msg2); p.sendMessage(ChatColor.GREEN + msg2);
} }
quest.nextStage(quester, false); quest.nextStage(quester, false);

View File

@ -74,10 +74,13 @@ public class BukkitQuestadminPointsCommand extends BukkitQuestsSubCommand {
try { try {
target = Bukkit.getOfflinePlayer(UUID.fromString(args[1])); target = Bukkit.getOfflinePlayer(UUID.fromString(args[1]));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound")); // Do nothing
return;
} }
} }
if (target == null || target.getName() == null) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound"));
return;
}
final int points; final int points;
try { try {
points = Integer.parseInt(args[2]); points = Integer.parseInt(args[2]);
@ -88,14 +91,14 @@ public class BukkitQuestadminPointsCommand extends BukkitQuestsSubCommand {
final Quester quester = plugin.getQuester(target.getUniqueId()); final Quester quester = plugin.getQuester(target.getUniqueId());
quester.setQuestPoints(points); quester.setQuestPoints(points);
String msg1 = BukkitLang.get("setQuestPoints").replace("<points>", BukkitLang.get("questPoints")); String msg1 = BukkitLang.get("setQuestPoints").replace("<points>", BukkitLang.get("questPoints"));
msg1 = msg1.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD); msg1 = msg1.replace("<player>", target.getName());
msg1 = msg1.replace("<number>", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); msg1 = msg1.replace("<number>", String.valueOf(points));
cs.sendMessage(ChatColor.GOLD + msg1); cs.sendMessage(ChatColor.GOLD + msg1);
if (target.isOnline()) { if (target.isOnline()) {
final Player p = (Player)target; final Player p = (Player)target;
String msg2 = BukkitLang.get(p, "questPointsSet").replace("<points>", BukkitLang.get("questPoints")); String msg2 = BukkitLang.get(p, "questPointsSet").replace("<points>", BukkitLang.get("questPoints"));
msg2 = msg2.replace("<player>", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); msg2 = msg2.replace("<player>", cs.getName());
msg2 = msg2.replace("<number>", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); msg2 = msg2.replace("<number>", String.valueOf(points));
p.sendMessage(ChatColor.GREEN + msg2); p.sendMessage(ChatColor.GREEN + msg2);
} }
quester.saveData(); quester.saveData();

View File

@ -77,10 +77,13 @@ public class BukkitQuestadminQuitCommand extends BukkitQuestsSubCommand {
try { try {
target = Bukkit.getOfflinePlayer(UUID.fromString(args[1])); target = Bukkit.getOfflinePlayer(UUID.fromString(args[1]));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound")); // Do nothing
return;
} }
} }
if (target == null || target.getName() == null) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound"));
return;
}
final Quester quester = plugin.getQuester(target.getUniqueId()); final Quester quester = plugin.getQuester(target.getUniqueId());
if (quester.getCurrentQuests().isEmpty() && target.getName() != null) { if (quester.getCurrentQuests().isEmpty() && target.getName() != null) {
String msg = BukkitLang.get("noCurrentQuest"); String msg = BukkitLang.get("noCurrentQuest");
@ -93,12 +96,12 @@ public class BukkitQuestadminQuitCommand extends BukkitQuestsSubCommand {
return; return;
} }
String msg1 = BukkitLang.get("questForceQuit"); String msg1 = BukkitLang.get("questForceQuit");
msg1 = msg1.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD); msg1 = msg1.replace("<player>", target.getName());
msg1 = msg1.replace("<quest>", ChatColor.DARK_PURPLE + quest.getName() + ChatColor.GOLD); msg1 = msg1.replace("<quest>", quest.getName());
cs.sendMessage(ChatColor.GOLD + msg1); cs.sendMessage(ChatColor.GOLD + msg1);
String msg2 = BukkitLang.get((Player) target, "questForcedQuit"); String msg2 = BukkitLang.get((Player) target, "questForcedQuit");
msg2 = msg2.replace("<player>", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); msg2 = msg2.replace("<player>", cs.getName());
msg2 = msg2.replace("<quest>", ChatColor.DARK_PURPLE + quest.getName() + ChatColor.GOLD); msg2 = msg2.replace("<quest>", quest.getName());
quester.quitQuest(quest, msg2); quester.quitQuest(quest, msg2);
} }
} else { } else {

View File

@ -62,8 +62,7 @@ public class BukkitQuestadminReloadCommand extends BukkitQuestsSubCommand {
if (response) { if (response) {
cs.sendMessage(ChatColor.GOLD + BukkitLang.get("questsReloaded")); cs.sendMessage(ChatColor.GOLD + BukkitLang.get("questsReloaded"));
String msg = BukkitLang.get("numQuestsLoaded"); String msg = BukkitLang.get("numQuestsLoaded");
msg = msg.replace("<number>", ChatColor.DARK_PURPLE + String.valueOf(plugin.getLoadedQuests().size()) msg = msg.replace("<number>", String.valueOf(plugin.getLoadedQuests().size()));
+ ChatColor.GOLD);
cs.sendMessage(ChatColor.GOLD + msg); cs.sendMessage(ChatColor.GOLD + msg);
} else { } else {
cs.sendMessage(ChatColor.RED + BukkitLang.get("unknownError")); cs.sendMessage(ChatColor.RED + BukkitLang.get("unknownError"));

View File

@ -77,10 +77,13 @@ public class BukkitQuestadminRemoveCommand extends BukkitQuestsSubCommand {
try { try {
target = Bukkit.getOfflinePlayer(UUID.fromString(args[1])); target = Bukkit.getOfflinePlayer(UUID.fromString(args[1]));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound")); // Do nothing
return;
} }
} }
if (target == null || target.getName() == null) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound"));
return;
}
final Quest toRemove = plugin.getQuest(concatArgArray(args, 2, args.length - 1, ' ')); final Quest toRemove = plugin.getQuest(concatArgArray(args, 2, args.length - 1, ' '));
if (toRemove == null) { if (toRemove == null) {
cs.sendMessage(ChatColor.RED + BukkitLang.get("questNotFound")); cs.sendMessage(ChatColor.RED + BukkitLang.get("questNotFound"));
@ -89,11 +92,11 @@ public class BukkitQuestadminRemoveCommand extends BukkitQuestsSubCommand {
final Quester quester = plugin.getQuester(target.getUniqueId()); final Quester quester = plugin.getQuester(target.getUniqueId());
String msg = BukkitLang.get("questRemoved"); String msg = BukkitLang.get("questRemoved");
if (target.getName() != null) { if (target.getName() != null) {
msg = msg.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD); msg = msg.replace("<player>", target.getName());
} else { } else {
msg = msg.replace("<player>", ChatColor.GREEN + args[1] + ChatColor.GOLD); msg = msg.replace("<player>", args[1]);
} }
msg = msg.replace("<quest>", ChatColor.DARK_PURPLE + toRemove.getName() + ChatColor.GOLD); msg = msg.replace("<quest>", toRemove.getName());
cs.sendMessage(ChatColor.GOLD + msg); cs.sendMessage(ChatColor.GOLD + msg);
cs.sendMessage(ChatColor.DARK_PURPLE + " UUID: " + ChatColor.DARK_AQUA + quester.getUUID().toString()); cs.sendMessage(ChatColor.DARK_PURPLE + " UUID: " + ChatColor.DARK_AQUA + quester.getUUID().toString());
quester.hardRemove(toRemove); quester.hardRemove(toRemove);

View File

@ -76,10 +76,13 @@ public class BukkitQuestadminResetCommand extends BukkitQuestsSubCommand {
try { try {
target = Bukkit.getOfflinePlayer(UUID.fromString(args[1])); target = Bukkit.getOfflinePlayer(UUID.fromString(args[1]));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound")); // Do nothing
return;
} }
} }
if (target == null || target.getName() == null) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound"));
return;
}
final UUID id = target.getUniqueId(); final UUID id = target.getUniqueId();
final ConcurrentSkipListSet<Quester> temp = (ConcurrentSkipListSet<Quester>) plugin.getOfflineQuesters(); final ConcurrentSkipListSet<Quester> temp = (ConcurrentSkipListSet<Quester>) plugin.getOfflineQuesters();
temp.removeIf(quester -> quester.getUUID().equals(id)); temp.removeIf(quester -> quester.getUUID().equals(id));
@ -94,9 +97,9 @@ public class BukkitQuestadminResetCommand extends BukkitQuestsSubCommand {
storage.deleteQuester(id); storage.deleteQuester(id);
String msg = BukkitLang.get("questReset"); String msg = BukkitLang.get("questReset");
if (target.getName() != null) { if (target.getName() != null) {
msg = msg.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD); msg = msg.replace("<player>", target.getName());
} else { } else {
msg = msg.replace("<player>", ChatColor.GREEN + args[1] + ChatColor.GOLD); msg = msg.replace("<player>", args[1]);
} }
cs.sendMessage(ChatColor.GOLD + msg); cs.sendMessage(ChatColor.GOLD + msg);
cs.sendMessage(ChatColor.DARK_PURPLE + " UUID: " + ChatColor.DARK_AQUA + id); cs.sendMessage(ChatColor.DARK_PURPLE + " UUID: " + ChatColor.DARK_AQUA + id);

View File

@ -77,11 +77,14 @@ public class BukkitQuestadminSetstageCommand extends BukkitQuestsSubCommand {
try { try {
target = Bukkit.getOfflinePlayer(UUID.fromString(args[1])); target = Bukkit.getOfflinePlayer(UUID.fromString(args[1]));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound")); // Do nothing
return;
} }
} }
int stage = -1; if (target == null || target.getName() == null) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound"));
return;
}
int stage;
try { try {
stage = Integer.parseInt(args[args.length - 1]); stage = Integer.parseInt(args[args.length - 1]);
} catch (final NumberFormatException e) { } catch (final NumberFormatException e) {
@ -101,13 +104,13 @@ public class BukkitQuestadminSetstageCommand extends BukkitQuestsSubCommand {
} }
if (!quester.getCurrentQuests().containsKey(quest)) { if (!quester.getCurrentQuests().containsKey(quest)) {
String msg1 = BukkitLang.get("questForceTake"); String msg1 = BukkitLang.get("questForceTake");
msg1 = msg1.replace("<player>", ChatColor.GREEN + quester.getLastKnownName() + ChatColor.GOLD); msg1 = msg1.replace("<player>", quester.getLastKnownName());
msg1 = msg1.replace("<quest>", ChatColor.DARK_PURPLE + quest.getName() + ChatColor.GOLD); msg1 = msg1.replace("<quest>", quest.getName());
cs.sendMessage(ChatColor.GOLD + msg1); cs.sendMessage(ChatColor.GOLD + msg1);
if (quester.getPlayer() != null && quester.getPlayer().isOnline()) { if (quester.getPlayer() != null && quester.getPlayer().isOnline()) {
String msg2 = BukkitLang.get("questForcedTake"); String msg2 = BukkitLang.get("questForcedTake");
msg2 = msg2.replace("<player>", ChatColor.GREEN + quester.getLastKnownName() + ChatColor.GOLD); msg2 = msg2.replace("<player>", quester.getLastKnownName());
msg2 = msg2.replace("<quest>", ChatColor.DARK_PURPLE + quest.getName() + ChatColor.GOLD); msg2 = msg2.replace("<quest>", quest.getName());
quester.sendMessage(ChatColor.GREEN + msg2); quester.sendMessage(ChatColor.GREEN + msg2);
} }
quester.takeQuest(quest, true); quester.takeQuest(quest, true);

View File

@ -75,10 +75,13 @@ public class BukkitQuestadminStatsCommand extends BukkitQuestsSubCommand {
try { try {
target = Bukkit.getOfflinePlayer(UUID.fromString(args[1])); target = Bukkit.getOfflinePlayer(UUID.fromString(args[1]));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound")); // Do nothing
return;
} }
} }
if (target == null || target.getName() == null) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound"));
return;
}
final Quester quester = plugin.getQuester(target.getUniqueId()); final Quester quester = plugin.getQuester(target.getUniqueId());
cs.sendMessage(ChatColor.GOLD + "- " + target.getName() + " -"); cs.sendMessage(ChatColor.GOLD + "- " + target.getName() + " -");
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("questPoints") + " - " + ChatColor.DARK_PURPLE cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("questPoints") + " - " + ChatColor.DARK_PURPLE

View File

@ -74,10 +74,13 @@ public class BukkitQuestadminTakepointsCommand extends BukkitQuestsSubCommand {
try { try {
target = Bukkit.getOfflinePlayer(UUID.fromString(args[1])); target = Bukkit.getOfflinePlayer(UUID.fromString(args[1]));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound")); // Do nothing
return;
} }
} }
if (target == null || target.getName() == null) {
cs.sendMessage(ChatColor.YELLOW + BukkitLang.get("playerNotFound"));
return;
}
final int points; final int points;
try { try {
points = Integer.parseInt(args[2]); points = Integer.parseInt(args[2]);
@ -92,14 +95,14 @@ public class BukkitQuestadminTakepointsCommand extends BukkitQuestsSubCommand {
} else { } else {
quester.setQuestPoints(quester.getQuestPoints() - Math.abs(points)); quester.setQuestPoints(quester.getQuestPoints() - Math.abs(points));
String msg1 = BukkitLang.get("takeQuestPoints").replace("<points>", BukkitLang.get("questPoints")); String msg1 = BukkitLang.get("takeQuestPoints").replace("<points>", BukkitLang.get("questPoints"));
msg1 = msg1.replace("<player>", ChatColor.GREEN + target.getName() + ChatColor.GOLD); msg1 = msg1.replace("<player>", target.getName());
msg1 = msg1.replace("<number>", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); msg1 = msg1.replace("<number>", String.valueOf(points));
cs.sendMessage(ChatColor.GOLD + msg1); cs.sendMessage(ChatColor.GOLD + msg1);
if (target.isOnline()) { if (target.isOnline()) {
final Player p = (Player)target; final Player p = (Player)target;
String msg2 = BukkitLang.get(p, "questPointsTaken").replace("<points>", BukkitLang.get("questPoints")); String msg2 = BukkitLang.get(p, "questPointsTaken").replace("<points>", BukkitLang.get("questPoints"));
msg2 = msg2.replace("<player>", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); msg2 = msg2.replace("<player>", cs.getName());
msg2 = msg2.replace("<number>", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); msg2 = msg2.replace("<number>", String.valueOf(points));
p.sendMessage(ChatColor.GREEN + msg2); p.sendMessage(ChatColor.GREEN + msg2);
} }
quester.saveData(); quester.saveData();

View File

@ -104,9 +104,8 @@ public class BukkitQuestsCommandHandler {
if (cmd.getName().equals("choice")) { if (cmd.getName().equals("choice")) {
continue; continue;
} }
cs.sendMessage(ChatColor.YELLOW + "/quests " + cmd.getDescription().replace("<command>", ChatColor.GOLD cs.sendMessage(ChatColor.YELLOW + "/quests " + cmd.getDescription().replace("<command>",
+ (plugin.getConfigSettings().canTranslateSubCommands() ? cmd.getNameI18N() : cmd.getName()) plugin.getConfigSettings().canTranslateSubCommands() ? cmd.getNameI18N() : cmd.getName()));
+ ChatColor.YELLOW));
} }
if (cs instanceof Player) { if (cs instanceof Player) {
cs.sendMessage(ChatColor.DARK_AQUA + "/quest " + ChatColor.YELLOW + BukkitLang.get(cs, "COMMAND_QUEST_HELP")); cs.sendMessage(ChatColor.DARK_AQUA + "/quest " + ChatColor.YELLOW + BukkitLang.get(cs, "COMMAND_QUEST_HELP"));

View File

@ -79,7 +79,7 @@ public class BukkitQuestsQuitCommand extends BukkitQuestsSubCommand {
if (quest != null) { if (quest != null) {
if (quest.getOptions().canAllowQuitting()) { if (quest.getOptions().canAllowQuitting()) {
final String msg = ChatColor.YELLOW + BukkitLang.get(player, "questQuit").replace("<quest>", final String msg = ChatColor.YELLOW + BukkitLang.get(player, "questQuit").replace("<quest>",
ChatColor.DARK_PURPLE + quest.getName() + ChatColor.YELLOW); quest.getName());
quester.abandonQuest(quest, msg); quester.abandonQuest(quest, msg);
} else { } else {
BukkitLang.send(player, ChatColor.YELLOW + BukkitLang.get(player, "questQuitDisabled")); BukkitLang.send(player, ChatColor.YELLOW + BukkitLang.get(player, "questQuitDisabled"));

View File

@ -104,7 +104,7 @@ public class BukkitQuestsTopCommand extends BukkitQuestsSubCommand {
final LinkedHashMap<String, Integer> sortedMap = (LinkedHashMap<String, Integer>) sort(questPoints); final LinkedHashMap<String, Integer> sortedMap = (LinkedHashMap<String, Integer>) sort(questPoints);
int numPrinted = 0; int numPrinted = 0;
String msg = BukkitLang.get(cs, "topQuestersTitle"); String msg = BukkitLang.get(cs, "topQuestersTitle");
msg = msg.replace("<number>", ChatColor.DARK_PURPLE + "" + topNumber + ChatColor.GOLD); msg = msg.replace("<number>", String.valueOf(topNumber));
cs.sendMessage(ChatColor.GOLD + msg); cs.sendMessage(ChatColor.GOLD + msg);
for (final Map.Entry<String, Integer> entry : sortedMap.entrySet()) { for (final Map.Entry<String, Integer> entry : sortedMap.entrySet()) {
numPrinted++; numPrinted++;

View File

@ -133,8 +133,7 @@ public class QuestMobsPrompt extends QuestsEditorNumericPrompt {
if (locations != null && radii != null && names != null) { if (locations != null && radii != null && names != null) {
for (int i = 0; i < mobs.size(); i++) { for (int i = 0; i < mobs.size(); i++) {
String msg = BukkitLang.get("blocksWithin"); String msg = BukkitLang.get("blocksWithin");
msg = msg.replace("<amount>", ChatColor.DARK_PURPLE + "" + radii.get(i) msg = msg.replace("<amount>", String.valueOf(radii.get(i)));
+ ChatColor.GRAY);
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.BLUE) text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.BLUE)
.append(BukkitMiscUtil.getPrettyMobName(Objects.requireNonNull(BukkitMiscUtil .append(BukkitMiscUtil.getPrettyMobName(Objects.requireNonNull(BukkitMiscUtil
.getProperMobType(mobs.get(i))))).append(ChatColor.GRAY).append(" x ") .getProperMobType(mobs.get(i))))).append(ChatColor.GRAY).append(" x ")

View File

@ -461,11 +461,11 @@ public class QuestRequirementsPrompt extends QuestsEditorNumericPrompt {
String text = getQueryText(context); String text = getQueryText(context);
if (plugin.getDependencies().getVaultEconomy() != null) { if (plugin.getDependencies().getVaultEconomy() != null) {
text = text.replace("<money>", ChatColor.DARK_PURPLE+ ((plugin.getDependencies().getVaultEconomy() text = text.replace("<money>", ((plugin.getDependencies().getVaultEconomy()
.currencyNamePlural().isEmpty() ? BukkitLang.get("money") : plugin.getDependencies().getVaultEconomy() .currencyNamePlural().isEmpty() ? BukkitLang.get("money")
.currencyNamePlural())) + ChatColor.YELLOW); : plugin.getDependencies().getVaultEconomy().currencyNamePlural())));
} else { } else {
text = text.replace("<money>", ChatColor.DARK_PURPLE + BukkitLang.get("money") + ChatColor.YELLOW); text = text.replace("<money>", BukkitLang.get("money"));
} }
return ChatColor.YELLOW + text; return ChatColor.YELLOW + text;
} }
@ -915,7 +915,7 @@ public class QuestRequirementsPrompt extends QuestsEditorNumericPrompt {
s = s.trim(); s = s.trim();
if (plugin.getQuest(s) == null) { if (plugin.getQuest(s) == null) {
String text = BukkitLang.get("reqNotAQuestName"); String text = BukkitLang.get("reqNotAQuestName");
text = text.replace("<quest>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED); text = text.replace("<quest>", s);
context.getForWhom().sendRawMessage(text); context.getForWhom().sendRawMessage(text);
return new QuestRequirementsQuestListPrompt(context, isRequiredQuest); return new QuestRequirementsQuestListPrompt(context, isRequiredQuest);
} }
@ -1103,7 +1103,7 @@ public class QuestRequirementsPrompt extends QuestsEditorNumericPrompt {
return new QuestMcMMOSkillsPrompt(context); return new QuestMcMMOSkillsPrompt(context);
} else { } else {
String text = BukkitLang.get("reqMcMMOError"); String text = BukkitLang.get("reqMcMMOError");
text = text.replace("<input>", ChatColor.RED + s + ChatColor.YELLOW); text = text.replace("<input>", s);
context.getForWhom().sendRawMessage(ChatColor.YELLOW + text); context.getForWhom().sendRawMessage(ChatColor.YELLOW + text);
return new QuestMcMMOSkillsPrompt(context); return new QuestMcMMOSkillsPrompt(context);
} }
@ -1159,7 +1159,7 @@ public class QuestRequirementsPrompt extends QuestsEditorNumericPrompt {
amounts.add(i); amounts.add(i);
} catch (final NumberFormatException nfe) { } catch (final NumberFormatException nfe) {
String text = BukkitLang.get("reqNotANumber"); String text = BukkitLang.get("reqNotANumber");
text = text.replace("<input>", ChatColor.RED + s + ChatColor.YELLOW); text = text.replace("<input>", s);
context.getForWhom().sendRawMessage(ChatColor.YELLOW + text); context.getForWhom().sendRawMessage(ChatColor.YELLOW + text);
return new QuestMcMMOAmountsPrompt(context); return new QuestMcMMOAmountsPrompt(context);
} }
@ -1734,7 +1734,7 @@ public class QuestRequirementsPrompt extends QuestsEditorNumericPrompt {
text += ChatColor.GOLD + descriptions.get(temp) + "\n"; text += ChatColor.GOLD + descriptions.get(temp) + "\n";
} }
String lang = BukkitLang.get("stageEditorCustomDataPrompt"); String lang = BukkitLang.get("stageEditorCustomDataPrompt");
lang = lang.replace("<data>", ChatColor.GOLD + temp + ChatColor.YELLOW); lang = lang.replace("<data>", temp);
text += ChatColor.YELLOW + lang; text += ChatColor.YELLOW + lang;
} }
return text; return text;

View File

@ -490,8 +490,7 @@ public class QuestRewardsPrompt extends QuestsEditorNumericPrompt {
String text = getQueryText(context); String text = getQueryText(context);
if (plugin.getDependencies().getVaultEconomy() != null) { if (plugin.getDependencies().getVaultEconomy() != null) {
text = text.replace("<money>", ChatColor.AQUA text = text.replace("<money>", plugin.getDependencies().getVaultEconomy().currencyNamePlural());
+ plugin.getDependencies().getVaultEconomy().currencyNamePlural() + ChatColor.YELLOW);
} }
return ChatColor.YELLOW + text; return ChatColor.YELLOW + text;
} }
@ -1266,7 +1265,7 @@ public class QuestRewardsPrompt extends QuestsEditorNumericPrompt {
} }
} else { } else {
String text = BukkitLang.get("reqMcMMOError"); String text = BukkitLang.get("reqMcMMOError");
text = text.replace("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED); text = text.replace("<input>", s);
context.getForWhom().sendRawMessage(ChatColor.RED + text); context.getForWhom().sendRawMessage(ChatColor.RED + text);
return new QuestMcMMOSkillsPrompt(context); return new QuestMcMMOSkillsPrompt(context);
} }
@ -1315,7 +1314,7 @@ public class QuestRewardsPrompt extends QuestsEditorNumericPrompt {
amounts.add(Integer.parseInt(s)); amounts.add(Integer.parseInt(s));
} catch (final NumberFormatException e) { } catch (final NumberFormatException e) {
String text = BukkitLang.get("reqNotANumber"); String text = BukkitLang.get("reqNotANumber");
text = text.replace("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED); text = text.replace("<input>", s);
context.getForWhom().sendRawMessage(ChatColor.RED + text); context.getForWhom().sendRawMessage(ChatColor.RED + text);
return new QuestMcMMOAmountsPrompt(context); return new QuestMcMMOAmountsPrompt(context);
} }
@ -1525,7 +1524,7 @@ public class QuestRewardsPrompt extends QuestsEditorNumericPrompt {
final HeroClass hc = plugin.getDependencies().getHeroes().getClassManager().getClass(s); final HeroClass hc = plugin.getDependencies().getHeroes().getClassManager().getClass(s);
if (hc == null) { if (hc == null) {
String text = BukkitLang.get("rewHeroesInvalidClass"); String text = BukkitLang.get("rewHeroesInvalidClass");
text = text.replace("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED); text = text.replace("<input>", s);
context.getForWhom().sendRawMessage(ChatColor.RED + text); context.getForWhom().sendRawMessage(ChatColor.RED + text);
return new QuestHeroesClassesPrompt(context); return new QuestHeroesClassesPrompt(context);
} else { } else {
@ -1579,7 +1578,7 @@ public class QuestRewardsPrompt extends QuestsEditorNumericPrompt {
amounts.add(d); amounts.add(d);
} catch (final NumberFormatException nfe) { } catch (final NumberFormatException nfe) {
String text = BukkitLang.get("reqNotANumber"); String text = BukkitLang.get("reqNotANumber");
text = text.replace("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED); text = text.replace("<input>", s);
context.getForWhom().sendRawMessage(ChatColor.RED + text); context.getForWhom().sendRawMessage(ChatColor.RED + text);
return new QuestHeroesExperiencePrompt(context); return new QuestHeroesExperiencePrompt(context);
} }
@ -1953,10 +1952,10 @@ public class QuestRewardsPrompt extends QuestsEditorNumericPrompt {
= (Map<String, String>) context.getSessionData(Key.REW_CUSTOM_DATA_DESCRIPTIONS); = (Map<String, String>) context.getSessionData(Key.REW_CUSTOM_DATA_DESCRIPTIONS);
if (temp != null && descriptions != null) { if (temp != null && descriptions != null) {
if (descriptions.get(temp) != null) { if (descriptions.get(temp) != null) {
text += ChatColor.GOLD + descriptions.get(temp) + "\n"; text += descriptions.get(temp) + "\n";
} }
String lang = BukkitLang.get("stageEditorCustomDataPrompt"); String lang = BukkitLang.get("stageEditorCustomDataPrompt");
lang = lang.replace("<data>", ChatColor.GOLD + temp + ChatColor.YELLOW); lang = lang.replace("<data>", temp);
text += ChatColor.YELLOW + lang; text += ChatColor.YELLOW + lang;
} }
return text; return text;

View File

@ -2751,7 +2751,7 @@ public class QuestStageMainPrompt extends QuestsEditorNumericPrompt {
text += ChatColor.GOLD + descriptions.get(temp) + "\n"; text += ChatColor.GOLD + descriptions.get(temp) + "\n";
} }
String msg = BukkitLang.get("stageEditorCustomDataPrompt"); String msg = BukkitLang.get("stageEditorCustomDataPrompt");
msg = msg.replace("<data>", ChatColor.GOLD + temp + ChatColor.YELLOW); msg = msg.replace("<data>", temp);
text += ChatColor.YELLOW + msg; text += ChatColor.YELLOW + msg;
return text; return text;
} }

View File

@ -41,7 +41,8 @@ public class BukkitPartiesListener implements Listener {
final Player p = Bukkit.getServer().getPlayer(event.getPartyPlayer().getPlayerUUID()); final Player p = Bukkit.getServer().getPlayer(event.getPartyPlayer().getPlayerUUID());
if (p != null && BukkitLang.get("questPartiesLeave").length() > 0) { if (p != null && BukkitLang.get("questPartiesLeave").length() > 0) {
BukkitLang.send(p, ChatColor.GREEN + BukkitLang.get(p, "questPartiesJoin")); BukkitLang.send(p, ChatColor.GREEN + BukkitLang.get(p, "questPartiesJoin"));
event.getParty().broadcastMessage(ChatColor.GREEN + BukkitLang.get("questPartiesJoinBroadcast").replace("<player>", event.getPartyPlayer().getName()), event.getPartyPlayer()); event.getParty().broadcastMessage(ChatColor.GREEN + BukkitLang.get("questPartiesJoinBroadcast")
.replace("<player>", event.getPartyPlayer().getName()), event.getPartyPlayer());
} }
} }
@ -50,7 +51,8 @@ public class BukkitPartiesListener implements Listener {
final Player p = Bukkit.getServer().getPlayer(event.getPartyPlayer().getPlayerUUID()); final Player p = Bukkit.getServer().getPlayer(event.getPartyPlayer().getPlayerUUID());
if (p != null && BukkitLang.get("questPartiesLeave").length() > 0) { if (p != null && BukkitLang.get("questPartiesLeave").length() > 0) {
BukkitLang.send(p, ChatColor.RED + BukkitLang.get(p, "questPartiesLeave")); BukkitLang.send(p, ChatColor.RED + BukkitLang.get(p, "questPartiesLeave"));
event.getParty().broadcastMessage(ChatColor.RED + BukkitLang.get("questPartiesLeaveBroadcast").replace("<player>", event.getPartyPlayer().getName()), event.getPartyPlayer()); event.getParty().broadcastMessage(ChatColor.RED + BukkitLang.get("questPartiesLeaveBroadcast")
.replace("<player>", event.getPartyPlayer().getName()), event.getPartyPlayer());
} }
} }
} }

View File

@ -382,18 +382,15 @@ public class BukkitPlayerListener implements Listener {
if (bukkitQuest.getPlanner().getCooldown() > -1 if (bukkitQuest.getPlanner().getCooldown() > -1
&& (quester.getRemainingCooldown(bukkitQuest)) > 0) { && (quester.getRemainingCooldown(bukkitQuest)) > 0) {
String early = BukkitLang.get(player, "questTooEarly"); String early = BukkitLang.get(player, "questTooEarly");
early = early.replace("<quest>", ChatColor.AQUA + bukkitQuest.getName() early = early.replace("<quest>", bukkitQuest.getName());
+ ChatColor.YELLOW); early = early.replace("<time>", BukkitMiscUtil.getTime(
early = early.replace("<time>", ChatColor.DARK_PURPLE quester.getRemainingCooldown(bukkitQuest)));
+ BukkitMiscUtil.getTime(quester.getRemainingCooldown(bukkitQuest))
+ ChatColor.YELLOW);
BukkitLang.send(player, ChatColor.YELLOW + early); BukkitLang.send(player, ChatColor.YELLOW + early);
continue; continue;
} else if (quester.getCompletedQuests().contains(bukkitQuest) } else if (quester.getCompletedQuests().contains(bukkitQuest)
&& bukkitQuest.getPlanner().getCooldown() < 0) { && bukkitQuest.getPlanner().getCooldown() < 0) {
String completed = BukkitLang.get(player, "questAlreadyCompleted"); String completed = BukkitLang.get(player, "questAlreadyCompleted");
completed = completed.replace("<quest>", ChatColor.AQUA completed = completed.replace("<quest>", bukkitQuest.getName());
+ bukkitQuest.getName() + ChatColor.YELLOW);
BukkitLang.send(player, ChatColor.YELLOW + completed); BukkitLang.send(player, ChatColor.YELLOW + completed);
continue; continue;
} }
@ -553,7 +550,7 @@ public class BukkitPlayerListener implements Listener {
if (!event.getMessage().startsWith("/quest")) { if (!event.getMessage().startsWith("/quest")) {
final Player player = event.getPlayer(); final Player player = event.getPlayer();
BukkitLang.send(player, ChatColor.RED + BukkitLang.get(player, "optCommandsDenied") BukkitLang.send(player, ChatColor.RED + BukkitLang.get(player, "optCommandsDenied")
.replace("<quest>", ChatColor.DARK_PURPLE + quest.getName() + ChatColor.RED)); .replace("<quest>", quest.getName()));
event.setCancelled(true); event.setCancelled(true);
plugin.getLogger().info("Player " + player.getName() + " tried to use command " plugin.getLogger().info("Player " + player.getName() + " tried to use command "
+ event.getMessage() + " but was denied because they are currently on quest " + event.getMessage() + " but was denied because they are currently on quest "

View File

@ -58,7 +58,8 @@ public class BukkitUniteListener implements Listener {
continue; continue;
} }
if (event.getPartyProvider().areInSameParty(p, online)) { if (event.getPartyProvider().areInSameParty(p, online)) {
online.sendMessage(ChatColor.GREEN + BukkitLang.get("questPartiesJoinBroadcast").replace("<player>", p.getName())); online.sendMessage(ChatColor.GREEN + BukkitLang.get("questPartiesJoinBroadcast")
.replace("<player>", p.getName()));
} }
} }
} }
@ -76,7 +77,8 @@ public class BukkitUniteListener implements Listener {
continue; continue;
} }
if (event.getPartyProvider().areInSameParty(p, online)) { if (event.getPartyProvider().areInSameParty(p, online)) {
online.sendMessage(ChatColor.RED + BukkitLang.get("questPartiesLeaveBroadcast").replace("<player>", p.getName())); online.sendMessage(ChatColor.RED + BukkitLang.get("questPartiesLeaveBroadcast")
.replace("<player>", p.getName()));
} }
} }
} }

View File

@ -558,8 +558,7 @@ public class BukkitQuester implements Quester {
.equals(getPlayer().getLocation().getWorld().getName()) .equals(getPlayer().getLocation().getWorld().getName())
&& npc.getLocation().distance(getPlayer().getLocation()) > 6.0) { && npc.getLocation().distance(getPlayer().getLocation()) > 6.0) {
if (giveReason) { if (giveReason) {
final String msg = BukkitLang.get(getPlayer(), "mustSpeakTo") final String msg = BukkitLang.get(getPlayer(), "mustSpeakTo").replace("<npc>", npc.getName());
.replace("<npc>", ChatColor.DARK_PURPLE + npc.getName() + ChatColor.YELLOW);
sendMessage(ChatColor.YELLOW + msg); sendMessage(ChatColor.YELLOW + msg);
} }
return false; return false;
@ -571,7 +570,7 @@ public class BukkitQuester implements Quester {
znpc.getLocation().toBukkitLocation(znpc.getWorld()).distance(getPlayer().getLocation()) > 6.0) { znpc.getLocation().toBukkitLocation(znpc.getWorld()).distance(getPlayer().getLocation()) > 6.0) {
if (giveReason) { if (giveReason) {
final String msg = BukkitLang.get(getPlayer(), "mustSpeakTo") final String msg = BukkitLang.get(getPlayer(), "mustSpeakTo")
.replace("<npc>", ChatColor.DARK_PURPLE + plugin.getDependencies().getNpcName(znpc.getUuid()) + ChatColor.YELLOW); .replace("<npc>", plugin.getDependencies().getNpcName(znpc.getUuid()));
sendMessage(ChatColor.YELLOW + msg); sendMessage(ChatColor.YELLOW + msg);
} }
return false; return false;
@ -595,31 +594,31 @@ public class BukkitQuester implements Quester {
} else if (getCompletedQuests().contains(bukkitQuest) && bukkitQuest.getPlanner().getCooldown() < 0) { } else if (getCompletedQuests().contains(bukkitQuest) && bukkitQuest.getPlanner().getCooldown() < 0) {
if (giveReason) { if (giveReason) {
final String msg = BukkitLang.get(getPlayer(), "questAlreadyCompleted") final String msg = BukkitLang.get(getPlayer(), "questAlreadyCompleted")
.replace("<quest>", ChatColor.DARK_PURPLE + bukkitQuest.getName() + ChatColor.YELLOW); .replace("<quest>", bukkitQuest.getName());
sendMessage(ChatColor.YELLOW + msg); sendMessage(ChatColor.YELLOW + msg);
} }
return false; return false;
} else if (bukkitQuest.getBlockStart() != null) { } else if (bukkitQuest.getBlockStart() != null) {
if (giveReason) { if (giveReason) {
final String msg = BukkitLang.get(getPlayer(), "noCommandStart").replace("<quest>", ChatColor.DARK_PURPLE final String msg = BukkitLang.get(getPlayer(), "noCommandStart").replace("<quest>",
+ bukkitQuest.getName() + ChatColor.YELLOW); bukkitQuest.getName());
sendMessage(ChatColor.YELLOW + msg); sendMessage(ChatColor.YELLOW + msg);
} }
return false; return false;
} else if (getCompletedQuests().contains(bukkitQuest) && getRemainingCooldown(bukkitQuest) > 0 } else if (getCompletedQuests().contains(bukkitQuest) && getRemainingCooldown(bukkitQuest) > 0
&& !bukkitQuest.getPlanner().getOverride()) { && !bukkitQuest.getPlanner().getOverride()) {
if (giveReason) { if (giveReason) {
final String msg = BukkitLang.get(getPlayer(), "questTooEarly").replace("<quest>", ChatColor.AQUA final String msg = BukkitLang.get(getPlayer(), "questTooEarly").replace("<quest>",
+ bukkitQuest.getName()+ ChatColor.YELLOW).replace("<time>", ChatColor.DARK_PURPLE bukkitQuest.getName()).replace("<time>", BukkitMiscUtil
+ BukkitMiscUtil.getTime(getRemainingCooldown(bukkitQuest)) + ChatColor.YELLOW); .getTime(getRemainingCooldown(bukkitQuest)));
getPlayer().sendMessage(ChatColor.YELLOW + msg); getPlayer().sendMessage(ChatColor.YELLOW + msg);
} }
return false; return false;
} else if (bukkitQuest.getRegionStart() != null) { } else if (bukkitQuest.getRegionStart() != null) {
if (!bukkitQuest.isInRegionStart(this)) { if (!bukkitQuest.isInRegionStart(this)) {
if (giveReason) { if (giveReason) {
final String msg = BukkitLang.get(getPlayer(), "questInvalidLocation").replace("<quest>", ChatColor.AQUA final String msg = BukkitLang.get(getPlayer(), "questInvalidLocation").replace("<quest>",
+ bukkitQuest.getName() + ChatColor.YELLOW); bukkitQuest.getName());
getPlayer().sendMessage(ChatColor.YELLOW + msg); getPlayer().sendMessage(ChatColor.YELLOW + msg);
} }
return false; return false;
@ -648,9 +647,8 @@ public class BukkitQuester implements Quester {
if (currentTime < start) { if (currentTime < start) {
if (giveReason) { if (giveReason) {
String early = BukkitLang.get("plnTooEarly"); String early = BukkitLang.get("plnTooEarly");
early = early.replace("<quest>", ChatColor.AQUA + quest.getName() + ChatColor.YELLOW); early = early.replace("<quest>", quest.getName());
early = early.replace("<time>", ChatColor.RED early = early.replace("<time>", BukkitMiscUtil.getTime(start - currentTime));
+ BukkitMiscUtil.getTime(start - currentTime) + ChatColor.YELLOW);
sendMessage(ChatColor.YELLOW + early); sendMessage(ChatColor.YELLOW + early);
} }
return false; return false;
@ -660,9 +658,8 @@ public class BukkitQuester implements Quester {
if (currentTime > end) { if (currentTime > end) {
if (giveReason) { if (giveReason) {
String late = BukkitLang.get("plnTooLate"); String late = BukkitLang.get("plnTooLate");
late = late.replace("<quest>", ChatColor.AQUA + quest.getName() + ChatColor.RED); late = late.replace("<quest>", quest.getName());
late = late.replace("<time>", ChatColor.DARK_PURPLE late = late.replace("<time>", BukkitMiscUtil.getTime(currentTime - end));
+ BukkitMiscUtil.getTime(currentTime - end) + ChatColor.RED);
sendMessage(ChatColor.RED + late); sendMessage(ChatColor.RED + late);
} }
return false; return false;
@ -712,10 +709,8 @@ public class BukkitQuester implements Quester {
// If quest is not active, or new period of activity should override player cooldown // If quest is not active, or new period of activity should override player cooldown
if (!active || (quest.getPlanner().getOverride() && completedEnd > 0L && currentTime < completedEnd)) { if (!active || (quest.getPlanner().getOverride() && completedEnd > 0L && currentTime < completedEnd)) {
if (giveReason) { if (giveReason) {
final String early = BukkitLang.get("plnTooEarly") final String early = BukkitLang.get("plnTooEarly").replace("<quest>", quest.getName())
.replace("<quest>", ChatColor.AQUA + quest.getName() + ChatColor.YELLOW) .replace("<time>", BukkitMiscUtil.getTime((completedEnd) - currentTime));
.replace("<time>", ChatColor.DARK_PURPLE
+ BukkitMiscUtil.getTime((completedEnd) - currentTime) + ChatColor.YELLOW);
sendMessage(ChatColor.YELLOW + early); sendMessage(ChatColor.YELLOW + early);
} }
return false; return false;
@ -1046,21 +1041,18 @@ public class BukkitQuester implements Quester {
for (final String questId : requirements.getNeededQuestIds()) { for (final String questId : requirements.getNeededQuestIds()) {
if (completed.containsKey(questId)) { if (completed.containsKey(questId)) {
String msg = BukkitLang.get("haveCompleted"); String msg = BukkitLang.get("haveCompleted");
msg = msg.replace("<quest>", ChatColor.ITALIC + "" + ChatColor.DARK_PURPLE msg = msg.replace("<quest>", completed.get(questId));
+ completed.get(questId) + ChatColor.GREEN);
finishedRequirements.add(ChatColor.GREEN + msg); finishedRequirements.add(ChatColor.GREEN + msg);
} else { } else {
String msg = BukkitLang.get("mustComplete"); String msg = BukkitLang.get("mustComplete");
msg = msg.replace("<quest>", ChatColor.ITALIC + "" + ChatColor.DARK_PURPLE msg = msg.replace("<quest>", plugin.getQuestById(questId).getName());
+ plugin.getQuestById(questId).getName() + ChatColor.GREEN);
unfinishedRequirements.add(ChatColor.GRAY + msg); unfinishedRequirements.add(ChatColor.GRAY + msg);
} }
} }
for (final String questId : requirements.getBlockQuestIds()) { for (final String questId : requirements.getBlockQuestIds()) {
if (completed.containsKey(questId)) { if (completed.containsKey(questId)) {
String msg = BukkitLang.get("cannotComplete"); String msg = BukkitLang.get("cannotComplete");
msg = msg.replace("<quest>", ChatColor.ITALIC + "" + ChatColor.DARK_PURPLE msg = msg.replace("<quest>", quest.getName());
+ quest.getName() + ChatColor.RED);
current.add(ChatColor.RED + msg); current.add(ChatColor.RED + msg);
} }
} }
@ -3561,7 +3553,7 @@ public class BukkitQuester implements Quester {
private String formatCompletedObjectiveMessage(final String langKey, final int goal) { private String formatCompletedObjectiveMessage(final String langKey, final int goal) {
String message = ChatColor.GREEN + "(" + BukkitLang.get("completed") + ") " + BukkitLang.get(langKey); String message = ChatColor.GREEN + "(" + BukkitLang.get("completed") + ") " + BukkitLang.get(langKey);
if (message.contains("<count>")) { if (message.contains("<count>")) {
message = message.replace("<count>", "" + ChatColor.GREEN + goal + "/" + goal); message = message.replace("<count>", goal + "/" + goal);
} }
if (plugin.getDependencies().getPlaceholderApi() != null) { if (plugin.getDependencies().getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(getPlayer(), message); message = PlaceholderAPI.setPlaceholders(getPlayer(), message);
@ -4071,7 +4063,7 @@ public class BukkitQuester implements Quester {
/*if (q.equals(quest) == false) { /*if (q.equals(quest) == false) {
if (getPlayer() != null && getPlayer().isOnline()) { if (getPlayer() != null && getPlayer().isOnline()) {
quitQuest(quest, ChatColor.GOLD + Lang.get("questModified") quitQuest(quest, ChatColor.GOLD + Lang.get("questModified")
.replace("<quest>", ChatColor.DARK_PURPLE + quest.getName() + ChatColor.GOLD)); .replace("<quest>", quest.getName()));
} }
}*/ }*/
} }
@ -4080,8 +4072,7 @@ public class BukkitQuester implements Quester {
} }
} }
if (!exists) { if (!exists) {
sendMessage(ChatColor.RED + BukkitLang.get("questNotExist").replace("<quest>", ChatColor.DARK_PURPLE sendMessage(ChatColor.RED + BukkitLang.get("questNotExist").replace("<quest>", quest.getName()));
+ quest.getName() + ChatColor.RED));
} }
} }
} }
@ -4301,14 +4292,14 @@ public class BukkitQuester implements Quester {
quest.updateCompass(BukkitQuester.this, stage); quest.updateCompass(BukkitQuester.this, stage);
if (notify) { if (notify) {
sendMessage(ChatColor.YELLOW + BukkitLang.get(getPlayer(), "compassSet") sendMessage(ChatColor.YELLOW + BukkitLang.get(getPlayer(), "compassSet")
.replace("<quest>", ChatColor.GOLD + quest.getName() + ChatColor.YELLOW)); .replace("<quest>", quest.getName()));
} }
} else { } else {
resetCompass(); resetCompass();
setCompassTarget(quest); setCompassTarget(quest);
if (notify) { if (notify) {
sendMessage(ChatColor.RED + BukkitLang.get(getPlayer(), "compassNone") sendMessage(ChatColor.RED + BukkitLang.get(getPlayer(), "compassNone")
.replace("<quest>", ChatColor.GRAY + quest.getName() + ChatColor.RED)); .replace("<quest>", quest.getName()));
} }
} }
} }

View File

@ -894,8 +894,7 @@ public class BukkitQuest implements Quest {
// Inform player // Inform player
if (player.isOnline()) { if (player.isOnline()) {
final Player p = (Player)player; final Player p = (Player)player;
BukkitLang.send(p, ChatColor.GOLD + BukkitLang.get(p, "questCompleteTitle").replace("<quest>", BukkitLang.send(p, ChatColor.GOLD + BukkitLang.get(p, "questCompleteTitle").replace("<quest>", name));
ChatColor.YELLOW + name + ChatColor.GOLD));
if (plugin.getConfigSettings().canShowQuestTitles()) { if (plugin.getConfigSettings().canShowQuestTitles()) {
final String title = ChatColor.GOLD + BukkitLang.get(p, "quest") + " " + BukkitLang.get(p, "complete"); final String title = ChatColor.GOLD + BukkitLang.get(p, "quest") + " " + BukkitLang.get(p, "complete");
final String subtitle = ChatColor.YELLOW + name; final String subtitle = ChatColor.YELLOW + name;

View File

@ -37,8 +37,7 @@ public class BukkitActionTimer extends BukkitRunnable {
quester.updateJournal(); quester.updateJournal();
} else if (quester.getOfflinePlayer().isOnline()){ } else if (quester.getOfflinePlayer().isOnline()){
quester.getPlayer().sendMessage(ChatColor.GREEN + BukkitLang.get(quester.getPlayer(), "timerMessage") quester.getPlayer().sendMessage(ChatColor.GREEN + BukkitLang.get(quester.getPlayer(), "timerMessage")
.replace("<time>", ChatColor.RED + BukkitMiscUtil.getTime(time * 1000L) + ChatColor.GREEN) .replace("<time>", BukkitMiscUtil.getTime(time * 1000L)).replace("<quest>", quest.getName()));
.replace("<quest>", ChatColor.GOLD + quest.getName() + ChatColor.GREEN));
} }
} }
} }