Plex/src/main/java/me/totalfreedom/plex/command/impl/OpAllCMD.java

38 lines
1.1 KiB
Java
Raw Normal View History

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-02 20:50:51 +00:00
import me.totalfreedom.plex.command.PlexCommand;
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;
import java.util.List;
import static me.totalfreedom.plex.util.PlexUtils.tl;
@CommandParameters(description = "Op everyone on the server", aliases = "opa")
@CommandPermissions(level = Rank.ADMIN)
public class OpAllCMD extends PlexCommand
{
public OpAllCMD()
{
super("opall");
}
@Override
public void execute(CommandSource sender, String[] args)
2020-11-02 20:50:51 +00:00
{
for (Player player : Bukkit.getOnlinePlayers())
player.setOp(true);
PlexUtils.broadcast(tl("oppedAllPlayers", sender.getName()));
}
@Override
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
}
}