mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-09 20:41:23 +01:00
Merge pull request #226 from Elvaron/2.9
Made socialspy commands list configurable
This commit is contained in:
commit
010df964a1
@ -335,14 +335,13 @@ public class EssentialsPlayerListener implements Listener
|
||||
});
|
||||
}
|
||||
}
|
||||
private final static List<String> COMMANDS = Arrays.asList("msg", "w", "r", "mail", "m", "t", "whisper", "emsg", "tell", "er", "reply", "ereply", "email", "action", "describe", "eme", "eaction", "edescribe", "etell", "ewhisper", "pm");
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
final Player player = event.getPlayer();
|
||||
final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH);
|
||||
if (COMMANDS.contains(cmd))
|
||||
if (ess.getSettings().getSocialSpyCommands().contains(cmd))
|
||||
{
|
||||
for (Player onlinePlayer : ess.getServer().getOnlinePlayers())
|
||||
{
|
||||
|
@ -42,6 +42,8 @@ public interface ISettings extends IConf
|
||||
|
||||
double getHealCooldown();
|
||||
|
||||
Set<String> getSocialSpyCommands();
|
||||
|
||||
Map<String, Object> getKit(String name);
|
||||
|
||||
ConfigurationSection getKits();
|
||||
|
@ -237,6 +237,24 @@ public class Settings implements ISettings
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
private Set<String> socialSpyCommands = new HashSet<String>();
|
||||
|
||||
public Set<String> _getSocialSpyCommands()
|
||||
{
|
||||
Set<String> socialspyCommands = new HashSet<String>();
|
||||
for (String c : config.getStringList("socialspy-commands"))
|
||||
{
|
||||
socialspyCommands.add(c.toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
return socialspyCommands;
|
||||
}
|
||||
|
||||
public Set<String> getSocialSpyCommands() {
|
||||
return socialSpyCommands;
|
||||
}
|
||||
|
||||
private String nicknamePrefix = "~";
|
||||
|
||||
private String _getNicknamePrefix()
|
||||
@ -462,6 +480,7 @@ public class Settings implements ISettings
|
||||
disableSuffix = _disableSuffix();
|
||||
chatRadius = _getChatRadius();
|
||||
commandCosts = _getCommandCosts();
|
||||
socialSpyCommands = _getSocialSpyCommands();
|
||||
warnOnBuildDisallow = _warnOnBuildDisallow();
|
||||
mailsPerMinute = _getMailsPerMinute();
|
||||
}
|
||||
|
@ -91,6 +91,32 @@ overridden-commands:
|
||||
disabled-commands:
|
||||
# - nick
|
||||
|
||||
# These commands will be shown to players with socialSpy enabled
|
||||
# You can add commands from other plugins you may want to track or
|
||||
# remove commands that are used for something you dont want to spy on
|
||||
socialspy-commands:
|
||||
- msg
|
||||
- w
|
||||
- r
|
||||
- mail
|
||||
- m
|
||||
- t
|
||||
- whisper
|
||||
- emsg
|
||||
- tell
|
||||
- er
|
||||
- reply
|
||||
- ereply
|
||||
- email
|
||||
- action
|
||||
- describe
|
||||
- eme
|
||||
- eaction
|
||||
- edescribe
|
||||
- etell
|
||||
- ewhisper
|
||||
- pm
|
||||
|
||||
# If you do not wish to use a permission system, you can define a list of 'player perms' below.
|
||||
# This list has no effect if you are using a supported permissions system.
|
||||
# If you are using an unsupported permissions system simply delete this section.
|
||||
|
Loading…
Reference in New Issue
Block a user