Limit condition notification to once every 5 seconds. No longer in BETA

This commit is contained in:
PikaMug 2020-11-27 00:10:28 -05:00
parent b9205ab94c
commit 51c9b61e9c
2 changed files with 8 additions and 4 deletions

View File

@ -76,6 +76,7 @@ public class Quester implements Comparable<Quester> {
private String lastKnownName;
protected int questPoints = 0;
private String compassTargetQuestId;
private long lastNotifiedCondition = 0L;
protected ConcurrentHashMap<Integer, Quest> timers = new ConcurrentHashMap<Integer, Quest>();
protected ConcurrentHashMap<Quest, Integer> currentQuests = new ConcurrentHashMap<Quest, Integer>() {
@ -3774,8 +3775,11 @@ public class Quester implements Comparable<Quester> {
}
hardQuit(quest);
} else if (giveReason) {
if (System.currentTimeMillis() - lastNotifiedCondition > 5000) {
getPlayer().sendMessage(ChatColor.YELLOW + Lang.get(getPlayer(), "conditionFailRetry")
.replace("<quest>", quest.getName()));
lastNotifiedCondition = System.currentTimeMillis();
}
}
return false;
}

View File

@ -178,9 +178,9 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
}
case 10:
if (!hasObjective) {
return ChatColor.GRAY + Lang.get("stageEditorConditions") + ChatColor.RED + " BETA";
return ChatColor.GRAY + Lang.get("stageEditorConditions");
} else {
return ChatColor.AQUA + Lang.get("stageEditorConditions") + ChatColor.RED + " BETA";
return ChatColor.AQUA + Lang.get("stageEditorConditions");
}
case 11:
if (!hasObjective) {