mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-27 18:51:34 +01:00
Add condition notice interval setting. Fixes #1861
This commit is contained in:
parent
0e9bb7ce75
commit
2e622d5673
@ -13,6 +13,8 @@ public interface ISettings {
|
||||
void setAskConfirmation(final boolean askConfirmation);
|
||||
boolean canClickablePrompts();
|
||||
void setClickablePrompts(boolean clickablePrompts);
|
||||
int getConditionInterval();
|
||||
void setConditionInterval(final int conditionInterval);
|
||||
int getConsoleLogging();
|
||||
void setConsoleLogging(final int consoleLogging);
|
||||
boolean canDisableCommandFeedback();
|
||||
|
@ -4319,7 +4319,8 @@ public class Quester implements IQuester {
|
||||
}
|
||||
hardQuit(quest);
|
||||
} else if (giveReason) {
|
||||
if (System.currentTimeMillis() - lastNotifiedCondition > 6000) {
|
||||
if (System.currentTimeMillis() - lastNotifiedCondition > (plugin.getSettings().getConditionInterval()
|
||||
* 1000L)) {
|
||||
getPlayer().sendMessage(ChatColor.YELLOW + Lang.get(getPlayer(), "conditionFailRetry")
|
||||
.replace("<quest>", quest.getName()));
|
||||
lastNotifiedCondition = System.currentTimeMillis();
|
||||
|
@ -29,6 +29,7 @@ public class Settings implements ISettings {
|
||||
private boolean allowPranks = true;
|
||||
private boolean askConfirmation = true;
|
||||
private boolean clickablePrompts = true;
|
||||
private int conditionInterval = 7;
|
||||
private int consoleLogging = 1;
|
||||
private boolean disableCommandFeedback = true;
|
||||
private boolean genFilesOnJoin = true;
|
||||
@ -87,6 +88,12 @@ public class Settings implements ISettings {
|
||||
public void setClickablePrompts(boolean clickablePrompts) {
|
||||
this.clickablePrompts = clickablePrompts;
|
||||
}
|
||||
public int getConditionInterval() {
|
||||
return conditionInterval;
|
||||
}
|
||||
public void setConditionInterval(final int conditionInterval) {
|
||||
this.conditionInterval = conditionInterval;
|
||||
}
|
||||
public int getConsoleLogging() {
|
||||
return consoleLogging;
|
||||
}
|
||||
@ -198,6 +205,11 @@ public class Settings implements ISettings {
|
||||
allowPranks = config.getBoolean("allow-pranks", true);
|
||||
askConfirmation = config.getBoolean("ask-confirmation", true);
|
||||
clickablePrompts = config.getBoolean("clickable-prompts", true);
|
||||
conditionInterval = config.getInt("condition-interval", 8);
|
||||
if (conditionInterval < 3 || conditionInterval > 180) {
|
||||
plugin.getLogger().warning("Condition interval out of range, reverting to default of 8 seconds");
|
||||
conditionInterval = 8;
|
||||
}
|
||||
consoleLogging = config.getInt("console-logging", 1);
|
||||
disableCommandFeedback = config.getBoolean("disable-command-feedback", true);
|
||||
genFilesOnJoin = config.getBoolean("generate-files-on-join", true);
|
||||
|
@ -5,6 +5,7 @@ allow-command-quests-with-npcs: false
|
||||
allow-pranks: true
|
||||
ask-confirmation: true
|
||||
clickable-prompts: true
|
||||
condition-interval: 8
|
||||
console-logging: 2
|
||||
disable-command-feedback: false
|
||||
generate-files-on-join: true
|
||||
|
Loading…
Reference in New Issue
Block a user