mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
Adding permission node to speak, with config option to enable the node
This commit is contained in:
parent
99c750d18b
commit
6b18259af6
17 changed files with 30 additions and 0 deletions
|
@ -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())
|
||||
{
|
||||
|
|
|
@ -187,4 +187,6 @@ public interface ISettings extends IConf
|
|||
public void setEssentialsChatActive(boolean b);
|
||||
|
||||
long getMaxTempban();
|
||||
|
||||
boolean isChatPermEnabled();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 | #
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue