mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-02 17:09:58 +01:00
offline player validation for banning
This commit is contained in:
parent
4dc92a144e
commit
f104c2e8f6
@ -26,13 +26,7 @@ public class Commandban extends EssentialsCommand
|
|||||||
sender.sendMessage(Util.i18n("banExempt"));
|
sender.sendMessage(Util.i18n("banExempt"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (server.matchPlayer(args[0]).isEmpty())
|
|
||||||
{
|
|
||||||
ess.getBans().banByName(args[0]);
|
|
||||||
server.broadcastMessage(Util.format("playerBanned", args[0], Util.i18n("defaultBanReason")));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
String banReason;
|
String banReason;
|
||||||
if (args.length > 1)
|
if (args.length > 1)
|
||||||
{
|
{
|
||||||
@ -44,8 +38,8 @@ public class Commandban extends EssentialsCommand
|
|||||||
banReason = Util.i18n("defaultBanReason");
|
banReason = Util.i18n("defaultBanReason");
|
||||||
}
|
}
|
||||||
player.kickPlayer(banReason);
|
player.kickPlayer(banReason);
|
||||||
ess.getBans().banByName(args[0]);
|
ess.getBans().banByName(player.getName());
|
||||||
server.broadcastMessage(Util.format("playerBanned", player.getName(), banReason));
|
server.broadcastMessage(Util.format("playerBanned", player.getName(), banReason));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.earth2me.essentials.commands;
|
package com.earth2me.essentials.commands;
|
||||||
|
|
||||||
|
import com.earth2me.essentials.User;
|
||||||
import com.earth2me.essentials.Util;
|
import com.earth2me.essentials.Util;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -20,7 +21,8 @@ public class Commandunban extends EssentialsCommand
|
|||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
|
|
||||||
ess.getBans().unbanByName(args[0]);
|
User u = getPlayer(server, args, 0, true);
|
||||||
|
ess.getBans().unbanByName(u.getName());
|
||||||
sender.sendMessage(Util.i18n("unbannedPlayer"));
|
sender.sendMessage(Util.i18n("unbannedPlayer"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user