Plex/src/main/java/dev/plex/command/impl/OpAllCMD.java

38 lines
1003 B
Java
Raw Normal View History

2021-01-03 07:21:15 +00:00
package dev.plex.command.impl;
2020-11-02 20:50:51 +00:00
2020-11-05 21:17:14 +00:00
import com.google.common.collect.ImmutableList;
2022-01-04 03:04:39 +00:00
import dev.plex.command.PlexCommand;
2021-01-03 07:21:15 +00:00
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
2020-11-02 20:50:51 +00:00
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
2022-01-04 03:04:39 +00:00
import java.util.List;
2020-11-02 20:50:51 +00:00
@CommandParameters(description = "Op everyone on the server", aliases = "opa")
@CommandPermissions(level = Rank.ADMIN)
public class OpAllCMD extends PlexCommand
{
public OpAllCMD()
{
super("opall");
}
@Override
2022-01-27 05:28:30 +00:00
public Component execute(CommandSender 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
2022-01-27 05:28:30 +00:00
public List<String> tabComplete(CommandSender sender, String[] args)
2020-11-06 01:29:38 +00:00
{
2020-11-05 21:17:14 +00:00
return ImmutableList.of();
2020-11-02 20:50:51 +00:00
}
}