Add chat question config option

This commit is contained in:
Josh Roy 2021-09-16 22:55:16 -04:00
parent d5822e9a41
commit 94edbcfeb1
4 changed files with 11 additions and 1 deletions

View File

@ -46,6 +46,8 @@ public interface ISettings extends IConf {
char getChatQuestion();
boolean isChatQuestionEnabled();
BigDecimal getCommandCost(IEssentialsCommand cmd);
BigDecimal getCommandCost(String label);

View File

@ -226,6 +226,11 @@ public class Settings implements net.ess3.api.ISettings {
return chatQuestion;
}
@Override
public boolean isChatQuestionEnabled() {
return config.getBoolean("chat.question-enabled", true);
}
public boolean _isTeleportSafetyEnabled() {
return config.getBoolean("teleport-safety", true);
}

View File

@ -921,6 +921,9 @@ chat:
# plots: "&dP&r"
# creative: "&eC&r"
# Whether chat questions should be enabled or not.
question-enabled: true
############################################################
# +------------------------------------------------------+ #
# | EssentialsX Protect | #

View File

@ -38,7 +38,7 @@ public abstract class EssentialsChatPlayer implements Listener {
final char prefix = message.charAt(0);
if (prefix == ess.getSettings().getChatShout() || user.isToggleShout()) {
return message.length() > 1 ? "shout" : "";
} else if (prefix == ess.getSettings().getChatQuestion()) {
} else if (ess.getSettings().isChatQuestionEnabled() && prefix == ess.getSettings().getChatQuestion()) {
return message.length() > 1 ? "question" : "";
} else {
return "";