mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-02 20:11:44 +00:00
Cleanup of Essentials class
Moved all ban stuff to BanWorkaround
This commit is contained in:
parent
963fd7cf01
commit
25c9557c59
12 changed files with 268 additions and 331 deletions
|
@ -2,7 +2,6 @@ package com.earth2me.essentials.commands;
|
|||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
|
||||
|
@ -15,7 +14,7 @@ public class Commandban extends EssentialsCommand
|
|||
}
|
||||
|
||||
@Override
|
||||
public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@ -24,7 +23,7 @@ public class Commandban extends EssentialsCommand
|
|||
|
||||
if (server.matchPlayer(args[0]).isEmpty())
|
||||
{
|
||||
((CraftServer)server).getHandle().a(args[0]);
|
||||
ess.getBans().banByName(args[0]);
|
||||
server.broadcastMessage(Util.format("playerBanned", args[0], Util.i18n("defaultBanReason")));
|
||||
}
|
||||
else
|
||||
|
@ -41,9 +40,8 @@ public class Commandban extends EssentialsCommand
|
|||
banReason = Util.i18n("defaultBanReason");
|
||||
}
|
||||
player.kickPlayer(banReason);
|
||||
((CraftServer)server).getHandle().a(player.getName());
|
||||
ess.getBans().banByName(args[0]);
|
||||
server.broadcastMessage(Util.format("playerBanned", player.getName(), banReason));
|
||||
}
|
||||
ess.loadBanList();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue