Merge pull request #238 from speedxx/development

fix nickclean not being registered
This commit is contained in:
super 2020-07-23 19:50:02 -04:00 committed by GitHub
commit d93a2a7e7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 11 deletions

View File

@ -16,15 +16,9 @@ import org.bukkit.entity.Player;
public class Command_nickclean extends FreedomCommand
{
private static final String[] BLOCK = ConfigEntry.BLOCKED_CHATCODES.getString().split(",");
private static final Pattern REGEX = Pattern.compile(FUtil.colorize(ChatColor.COLOR_CHAR + "[" + StringUtils.join(BLOCK, "") + "]"), Pattern.CASE_INSENSITIVE);
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
FUtil.adminAction(sender.getName(), "Cleaning all nicknames", false);
if (args.length > 1)
{
Player player = getPlayer(args[0]);
@ -40,7 +34,6 @@ public class Command_nickclean extends FreedomCommand
return true;
}
FUtil.adminAction(sender.getName(), "Cleaning all nicknames", false);
for (final Player player : server.getOnlinePlayers())
{
@ -53,6 +46,7 @@ public class Command_nickclean extends FreedomCommand
{
final String playerName = player.getName();
final String nickName = plugin.esb.getNickname(playerName);
final Pattern REGEX = Pattern.compile(FUtil.colorize(ChatColor.COLOR_CHAR + "[" + StringUtils.join(ConfigEntry.BLOCKED_CHATCODES.getString().split(","), "") + "]"), Pattern.CASE_INSENSITIVE);
if (nickName != null && !nickName.isEmpty() && !nickName.equalsIgnoreCase(playerName))
{
final Matcher matcher = REGEX.matcher(nickName);

View File

@ -6,7 +6,7 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
@CommandPermissions(level = Rank.NON_OP, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "OPs the command sender.", usage = "/<command>")
public class Command_opme extends FreedomCommand
{
@ -17,7 +17,6 @@ public class Command_opme extends FreedomCommand
FUtil.adminAction(sender.getName(), "Opping " + sender.getName(), false);
sender.setOp(true);
sender.sendMessage(FreedomCommand.YOU_ARE_OP);
return true;
}
}