mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-08 08:21:44 +01:00
Add chat configurables.
This commit is contained in:
parent
f272a7ecd6
commit
0e6a5240db
@ -29,6 +29,10 @@ public interface ISettings extends IConf
|
|||||||
String getChatFormat(String group);
|
String getChatFormat(String group);
|
||||||
|
|
||||||
int getChatRadius();
|
int getChatRadius();
|
||||||
|
|
||||||
|
char getChatShout();
|
||||||
|
|
||||||
|
char getChatQuestion();
|
||||||
|
|
||||||
BigDecimal getCommandCost(IEssentialsCommand cmd);
|
BigDecimal getCommandCost(IEssentialsCommand cmd);
|
||||||
|
|
||||||
|
@ -94,6 +94,34 @@ public class Settings implements net.ess3.api.ISettings
|
|||||||
{
|
{
|
||||||
return chatRadius;
|
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;
|
private boolean teleportSafety;
|
||||||
|
|
||||||
@ -524,6 +552,8 @@ public class Settings implements net.ess3.api.ISettings
|
|||||||
disablePrefix = _disablePrefix();
|
disablePrefix = _disablePrefix();
|
||||||
disableSuffix = _disableSuffix();
|
disableSuffix = _disableSuffix();
|
||||||
chatRadius = _getChatRadius();
|
chatRadius = _getChatRadius();
|
||||||
|
chatShout = _getChatShout();
|
||||||
|
chatQuestion = _getChatQuestion();
|
||||||
commandCosts = _getCommandCosts();
|
commandCosts = _getCommandCosts();
|
||||||
socialSpyCommands = _getSocialSpyCommands();
|
socialSpyCommands = _getSocialSpyCommands();
|
||||||
warnOnBuildDisallow = _warnOnBuildDisallow();
|
warnOnBuildDisallow = _warnOnBuildDisallow();
|
||||||
|
@ -33,7 +33,6 @@ public class EssentialsChat extends JavaPlugin
|
|||||||
|
|
||||||
final Map<AsyncPlayerChatEvent, ChatStore> chatStore = Collections.synchronizedMap(new HashMap<AsyncPlayerChatEvent, ChatStore>());
|
final Map<AsyncPlayerChatEvent, ChatStore> chatStore = Collections.synchronizedMap(new HashMap<AsyncPlayerChatEvent, ChatStore>());
|
||||||
|
|
||||||
|
|
||||||
final EssentialsChatPlayerListenerLowest playerListenerLowest = new EssentialsChatPlayerListenerLowest(getServer(), ess, chatStore);
|
final EssentialsChatPlayerListenerLowest playerListenerLowest = new EssentialsChatPlayerListenerLowest(getServer(), ess, chatStore);
|
||||||
final EssentialsChatPlayerListenerNormal playerListenerNormal = new EssentialsChatPlayerListenerNormal(getServer(), ess, chatStore);
|
final EssentialsChatPlayerListenerNormal playerListenerNormal = new EssentialsChatPlayerListenerNormal(getServer(), ess, chatStore);
|
||||||
final EssentialsChatPlayerListenerHighest playerListenerHighest = new EssentialsChatPlayerListenerHighest(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
|
//Ignore empty chat events generated by plugins
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
switch (message.charAt(0))
|
|
||||||
|
final char prefix = message.charAt(0);
|
||||||
|
if (prefix == ess.getSettings().getChatShout())
|
||||||
{
|
{
|
||||||
case '!':
|
|
||||||
return "shout";
|
return "shout";
|
||||||
case '?':
|
}
|
||||||
|
else if (prefix == ess.getSettings().getChatQuestion())
|
||||||
|
{
|
||||||
return "question";
|
return "question";
|
||||||
//case '@':
|
}
|
||||||
//return "admin";
|
else
|
||||||
default:
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user