Plex/src/main/java/dev/plex/command/impl/OpAllCMD.java
2022-01-26 21:28:30 -08:00

38 lines
1003 B
Java

package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import java.util.List;
@CommandParameters(description = "Op everyone on the server", aliases = "opa")
@CommandPermissions(level = Rank.ADMIN)
public class OpAllCMD extends PlexCommand
{
public OpAllCMD()
{
super("opall");
}
@Override
public Component execute(CommandSender sender, String[] args)
{
for (Player player : Bukkit.getOnlinePlayers())
{
player.setOp(true);
}
PlexUtils.broadcast(tl("oppedAllPlayers", sender.getName()));
}
@Override
public List<String> tabComplete(CommandSender sender, String[] args)
{
return ImmutableList.of();
}
}