mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 20:29:20 +00:00
![md_5](/assets/img/avatar_default.png)
* Add a method for backwards compatability with unmapped code. * Convert all getOnlinePlayers() calls to use this method, part of the IEssentials interface * Add a new method getOnlineUsers() Ljava/lang/Iterable; * Convert appropriate calls to use this method * Update Bukkit to #1945 * Update CraftBukkit to #3103
32 lines
932 B
Java
32 lines
932 B
Java
package com.earth2me.essentials.commands;
|
|
|
|
import com.earth2me.essentials.CommandSource;
|
|
import static com.earth2me.essentials.I18n.tl;
|
|
import com.earth2me.essentials.utils.FormatUtil;
|
|
import org.bukkit.Server;
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
public class Commandkickall extends EssentialsCommand
|
|
{
|
|
public Commandkickall()
|
|
{
|
|
super("kickall");
|
|
}
|
|
|
|
@Override
|
|
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
|
|
{
|
|
String kickReason = args.length > 0 ? getFinalArg(args, 0) : tl("kickDefault");
|
|
kickReason = FormatUtil.replaceFormat(kickReason.replace("\\n", "\n").replace("|", "\n"));
|
|
|
|
for (Player onlinePlayer : ess.getOnlinePlayers())
|
|
{
|
|
if (!sender.isPlayer() || !onlinePlayer.getName().equalsIgnoreCase(sender.getPlayer().getName()))
|
|
{
|
|
onlinePlayer.kickPlayer(kickReason);
|
|
}
|
|
}
|
|
sender.sendMessage(tl("kickedAll"));
|
|
}
|
|
}
|