2020-11-02 20:50:51 +00:00
|
|
|
package me.totalfreedom.plex.command.impl;
|
|
|
|
|
2020-11-05 21:17:14 +00:00
|
|
|
import com.google.common.collect.ImmutableList;
|
2020-11-06 01:29:38 +00:00
|
|
|
import java.util.List;
|
2020-11-02 20:50:51 +00:00
|
|
|
import me.totalfreedom.plex.command.PlexCommand;
|
2020-11-03 00:19:26 +00:00
|
|
|
import me.totalfreedom.plex.command.annotation.CommandParameters;
|
|
|
|
import me.totalfreedom.plex.command.annotation.CommandPermissions;
|
|
|
|
import me.totalfreedom.plex.command.source.CommandSource;
|
2020-11-02 20:50:51 +00:00
|
|
|
import me.totalfreedom.plex.rank.enums.Rank;
|
|
|
|
import me.totalfreedom.plex.util.PlexUtils;
|
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
@CommandParameters(description = "Op everyone on the server", aliases = "opa")
|
|
|
|
@CommandPermissions(level = Rank.ADMIN)
|
|
|
|
public class OpAllCMD extends PlexCommand
|
|
|
|
{
|
|
|
|
public OpAllCMD()
|
|
|
|
{
|
|
|
|
super("opall");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-11-03 00:19:26 +00:00
|
|
|
public void execute(CommandSource sender, String[] args)
|
2020-11-02 20:50:51 +00:00
|
|
|
{
|
|
|
|
for (Player player : Bukkit.getOnlinePlayers())
|
2020-11-06 01:29:38 +00:00
|
|
|
{
|
2020-11-02 20:50:51 +00:00
|
|
|
player.setOp(true);
|
2020-11-06 01:29:38 +00:00
|
|
|
}
|
2020-11-02 20:50:51 +00:00
|
|
|
PlexUtils.broadcast(tl("oppedAllPlayers", sender.getName()));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-11-06 01:29:38 +00:00
|
|
|
public List<String> onTabComplete(CommandSource sender, String[] args)
|
|
|
|
{
|
2020-11-05 21:17:14 +00:00
|
|
|
return ImmutableList.of();
|
2020-11-02 20:50:51 +00:00
|
|
|
}
|
|
|
|
}
|