mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-27 20:27:37 +00:00
Merge pull request #238 from speedxx/development
fix nickclean not being registered
This commit is contained in:
commit
d93a2a7e7d
@ -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);
|
||||
@ -64,4 +58,4 @@ public class Command_nickclean extends FreedomCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user