mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-26 10:01:49 +01:00
Ban cleanup
This commit is contained in:
parent
465cdae989
commit
e73983649f
@ -4,6 +4,7 @@ import com.earth2me.essentials.Console;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.OfflinePlayer;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -57,7 +58,7 @@ public class Commandban extends EssentialsCommand
|
||||
String banReason;
|
||||
if (args.length > 1)
|
||||
{
|
||||
banReason = _("banFormat", getFinalArg(args, 1), senderName);
|
||||
banReason = _("banFormat", Util.replaceFormat(getFinalArg(args, 1).replace("\\n", "\n")), senderName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -66,6 +67,7 @@ public class Commandban extends EssentialsCommand
|
||||
|
||||
user.setBanReason(banReason);
|
||||
user.setBanned(true);
|
||||
user.setBanTimeout(0);
|
||||
user.kickPlayer(banReason);
|
||||
|
||||
server.getLogger().log(Level.INFO, _("playerBanned", senderName, user.getName(), banReason));
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
|
||||
import com.earth2me.essentials.Console;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -39,7 +40,7 @@ public class Commandkick extends EssentialsCommand
|
||||
}
|
||||
|
||||
String kickReason = args.length > 1 ? getFinalArg(args, 1) : _("kickDefault");
|
||||
kickReason = kickReason.replace("\\n", "\n");
|
||||
kickReason = Util.replaceFormat(kickReason.replace("\\n", "\n"));
|
||||
|
||||
target.kickPlayer(kickReason);
|
||||
final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Util;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -17,7 +18,7 @@ public class Commandkickall extends EssentialsCommand
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
String kickReason = args.length > 0 ? getFinalArg(args, 0) : _("kickDefault");
|
||||
kickReason = kickReason.replace("\\n", "\n");
|
||||
kickReason = Util.replaceFormat(kickReason.replace("\\n", "\n"));
|
||||
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
|
@ -26,6 +26,7 @@ public class Commandunban extends EssentialsCommand
|
||||
{
|
||||
final User user = getPlayer(server, args, 0, true);
|
||||
user.setBanned(false);
|
||||
user.setBanTimeout(0);
|
||||
sender.sendMessage(_("unbannedPlayer"));
|
||||
}
|
||||
catch (NoSuchFieldException e)
|
||||
|
@ -23,7 +23,7 @@ backupStarted=\u00a76Backup started
|
||||
balance=\u00a7aBalance:\u00a7c {0}
|
||||
balanceTop=\u00a76Top balances ({0})
|
||||
banExempt=\u00a74You can not ban that player.
|
||||
banFormat=Banned: {0}
|
||||
banFormat=\u00a74Banned:\n\u00a7r{0}
|
||||
banIpAddress=\u00a76Banned IP address
|
||||
bigTreeFailure=\u00a74Big tree generation failure. Try again on grass or dirt.
|
||||
bigTreeSuccess= \u00a76Big tree spawned.
|
||||
|
@ -23,7 +23,7 @@ backupStarted=\u00a76Backup started
|
||||
balance=\u00a7aBalance:\u00a7c {0}
|
||||
balanceTop=\u00a76Top balances ({0})
|
||||
banExempt=\u00a74You can not ban that player.
|
||||
banFormat=Banned: {0}
|
||||
banFormat=\u00a74Banned:\n\u00a7r{0}
|
||||
banIpAddress=\u00a76Banned IP address
|
||||
bigTreeFailure=\u00a74Big tree generation failure. Try again on grass or dirt.
|
||||
bigTreeSuccess= \u00a76Big tree spawned.
|
||||
|
Loading…
Reference in New Issue
Block a user