1. Remove marco from dev
2. Add namehistory
3. Fix grammar issues
4. Actually use CoreProtect bridge to rollback players
5.  Improve automatic wiper
This commit is contained in:
Lemon
2017-10-13 23:35:11 +05:00
committed by GitHub
parent 3c09bc7995
commit ed2f15cc54
38 changed files with 1562 additions and 461 deletions

View File

@ -20,36 +20,49 @@ public class CommandBlockerEntry
private final String subCommand;
@Getter
private final String message;
public CommandBlockerEntry(CommandBlockerRank rank, CommandBlockerAction action, String command, String message)
{
public CommandBlockerEntry(final CommandBlockerRank rank, final CommandBlockerAction action, final String command, final String message) {
this(rank, action, command, null, message);
}
public CommandBlockerEntry(CommandBlockerRank rank, CommandBlockerAction action, String command, String subCommand, String message)
{
public CommandBlockerEntry(final CommandBlockerRank rank, final CommandBlockerAction action, final String command, final String subCommand, final String message) {
this.rank = rank;
this.action = action;
this.command = command;
this.subCommand = (subCommand == null ? null : subCommand.toLowerCase().trim());
this.message = (message == null || message.equals("_") ? "That command is blocked." : message);
this.subCommand = ((subCommand == null) ? null : subCommand.toLowerCase().trim());
this.message = ((message == null || message.equals("_")) ? "That command is blocked." : message);
}
public void doActions(CommandSender sender)
{
if (action == CommandBlockerAction.BLOCK_AND_EJECT && sender instanceof Player)
{
TotalFreedomMod.plugin().ae.autoEject((Player) sender, "You used a prohibited command: " + command);
public void doActions(final CommandSender sender) {
if (this.action == CommandBlockerAction.BLOCK_AND_EJECT && sender instanceof Player) {
TotalFreedomMod.plugin().ae.autoEject((Player)sender, "You used a prohibited command: " + this.command);
FUtil.bcastMsg(sender.getName() + " was automatically kicked for using harmful commands.", ChatColor.RED);
return;
}
if (action == CommandBlockerAction.BLOCK_UNKNOWN)
{
if (this.action == CommandBlockerAction.BLOCK_UNKNOWN) {
FUtil.playerMsg(sender, "Unknown command. Type \"help\" for help.", ChatColor.RESET);
return;
}
FUtil.playerMsg(sender, FUtil.colorize(message));
FUtil.playerMsg(sender, FUtil.colorize(this.message));
}
public CommandBlockerRank getRank() {
return this.rank;
}
public CommandBlockerAction getAction() {
return this.action;
}
public String getCommand() {
return this.command;
}
public String getSubCommand() {
return this.subCommand;
}
public String getMessage() {
return this.message;
}
}