Adding permission node to speak, with config option to enable the node

This commit is contained in:
Chris Ward 2012-12-24 01:55:53 +11:00
parent 99c750d18b
commit 6b18259af6
17 changed files with 30 additions and 0 deletions

View File

@ -60,6 +60,12 @@ public class EssentialsPlayerListener implements Listener
user.sendMessage(_("playerMuted"));
LOGGER.info(_("mutedUserSpeaks", user.getName()));
}
if(ess.getSettings().isChatPermEnabled() && !user.isAuthorized("essentials.chat.allowed"))
{
event.setCancelled(true);
user.sendMessage(_("playerChatDenied"));
LOGGER.info(_("mutedUserSpeaks", user.getName()));
}
final Iterator<Player> it = event.getRecipients().iterator();
while (it.hasNext())
{

View File

@ -187,4 +187,6 @@ public interface ISettings extends IConf
public void setEssentialsChatActive(boolean b);
long getMaxTempban();
boolean isChatPermEnabled();
}

View File

@ -1014,4 +1014,10 @@ public class Settings implements ISettings
{
return config.getLong("max-tempban-time", -1);
}
@Override
public boolean isChatPermEnabled()
{
return config.getBoolean("enable-chat-perm", false);
}
}

View File

@ -351,6 +351,9 @@ mails-per-minute: 1000
# Set to -1 to disable, and essentials.tempban.unlimited can be used to override.
max-tempban-time: -1
# Require users have essentials.chat before they can speak? Any users without this node will not be able to speak
enable-chat-perm: false
############################################################
# +------------------------------------------------------+ #
# | EssentialsHome | #

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -481,3 +481,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -478,3 +478,4 @@ recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.