mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-05 23:08:23 +00:00
Add chat configurables.
This commit is contained in:
parent
f272a7ecd6
commit
0e6a5240db
4 changed files with 43 additions and 7 deletions
|
@ -29,6 +29,10 @@ public interface ISettings extends IConf
|
|||
String getChatFormat(String group);
|
||||
|
||||
int getChatRadius();
|
||||
|
||||
char getChatShout();
|
||||
|
||||
char getChatQuestion();
|
||||
|
||||
BigDecimal getCommandCost(IEssentialsCommand cmd);
|
||||
|
||||
|
|
|
@ -94,6 +94,34 @@ public class Settings implements net.ess3.api.ISettings
|
|||
{
|
||||
return chatRadius;
|
||||
}
|
||||
|
||||
// #easteregg
|
||||
private char chatShout = '!';
|
||||
|
||||
private char _getChatShout()
|
||||
{
|
||||
return config.getString("chat.shout", "!").charAt(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public char getChatShout()
|
||||
{
|
||||
return chatShout;
|
||||
}
|
||||
|
||||
// #easteregg
|
||||
private char chatQuestion = '?';
|
||||
|
||||
private char _getChatQuestion()
|
||||
{
|
||||
return config.getString("chat.question", "?").charAt(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public char getChatQuestion()
|
||||
{
|
||||
return chatQuestion;
|
||||
}
|
||||
|
||||
private boolean teleportSafety;
|
||||
|
||||
|
@ -524,6 +552,8 @@ public class Settings implements net.ess3.api.ISettings
|
|||
disablePrefix = _disablePrefix();
|
||||
disableSuffix = _disableSuffix();
|
||||
chatRadius = _getChatRadius();
|
||||
chatShout = _getChatShout();
|
||||
chatQuestion = _getChatQuestion();
|
||||
commandCosts = _getCommandCosts();
|
||||
socialSpyCommands = _getSocialSpyCommands();
|
||||
warnOnBuildDisallow = _warnOnBuildDisallow();
|
||||
|
|
|
@ -33,7 +33,6 @@ public class EssentialsChat extends JavaPlugin
|
|||
|
||||
final Map<AsyncPlayerChatEvent, ChatStore> chatStore = Collections.synchronizedMap(new HashMap<AsyncPlayerChatEvent, ChatStore>());
|
||||
|
||||
|
||||
final EssentialsChatPlayerListenerLowest playerListenerLowest = new EssentialsChatPlayerListenerLowest(getServer(), ess, chatStore);
|
||||
final EssentialsChatPlayerListenerNormal playerListenerNormal = new EssentialsChatPlayerListenerNormal(getServer(), ess, chatStore);
|
||||
final EssentialsChatPlayerListenerHighest playerListenerHighest = new EssentialsChatPlayerListenerHighest(getServer(), ess, chatStore);
|
||||
|
|
|
@ -47,15 +47,18 @@ public abstract class EssentialsChatPlayer implements Listener
|
|||
//Ignore empty chat events generated by plugins
|
||||
return "";
|
||||
}
|
||||
switch (message.charAt(0))
|
||||
|
||||
final char prefix = message.charAt(0);
|
||||
if (prefix == ess.getSettings().getChatShout())
|
||||
{
|
||||
case '!':
|
||||
return "shout";
|
||||
case '?':
|
||||
}
|
||||
else if (prefix == ess.getSettings().getChatQuestion())
|
||||
{
|
||||
return "question";
|
||||
//case '@':
|
||||
//return "admin";
|
||||
default:
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue