mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-05-25 16:54:18 +00:00
Add chat question config option
This commit is contained in:
parent
d5822e9a41
commit
94edbcfeb1
4 changed files with 11 additions and 1 deletions
|
@ -46,6 +46,8 @@ public interface ISettings extends IConf {
|
||||||
|
|
||||||
char getChatQuestion();
|
char getChatQuestion();
|
||||||
|
|
||||||
|
boolean isChatQuestionEnabled();
|
||||||
|
|
||||||
BigDecimal getCommandCost(IEssentialsCommand cmd);
|
BigDecimal getCommandCost(IEssentialsCommand cmd);
|
||||||
|
|
||||||
BigDecimal getCommandCost(String label);
|
BigDecimal getCommandCost(String label);
|
||||||
|
|
|
@ -226,6 +226,11 @@ public class Settings implements net.ess3.api.ISettings {
|
||||||
return chatQuestion;
|
return chatQuestion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isChatQuestionEnabled() {
|
||||||
|
return config.getBoolean("chat.question-enabled", true);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean _isTeleportSafetyEnabled() {
|
public boolean _isTeleportSafetyEnabled() {
|
||||||
return config.getBoolean("teleport-safety", true);
|
return config.getBoolean("teleport-safety", true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -921,6 +921,9 @@ chat:
|
||||||
# plots: "&dP&r"
|
# plots: "&dP&r"
|
||||||
# creative: "&eC&r"
|
# creative: "&eC&r"
|
||||||
|
|
||||||
|
# Whether chat questions should be enabled or not.
|
||||||
|
question-enabled: true
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# +------------------------------------------------------+ #
|
# +------------------------------------------------------+ #
|
||||||
# | EssentialsX Protect | #
|
# | EssentialsX Protect | #
|
||||||
|
|
|
@ -38,7 +38,7 @@ public abstract class EssentialsChatPlayer implements Listener {
|
||||||
final char prefix = message.charAt(0);
|
final char prefix = message.charAt(0);
|
||||||
if (prefix == ess.getSettings().getChatShout() || user.isToggleShout()) {
|
if (prefix == ess.getSettings().getChatShout() || user.isToggleShout()) {
|
||||||
return message.length() > 1 ? "shout" : "";
|
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" : "";
|
return message.length() > 1 ? "question" : "";
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
|
|
Loading…
Reference in a new issue