2021-01-03 07:21:15 +00:00
|
|
|
package dev.plex.command.impl;
|
2020-11-02 20:50:51 +00:00
|
|
|
|
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;
|
2022-03-19 03:33:23 +00:00
|
|
|
import dev.plex.command.annotation.System;
|
2021-01-03 07:21:15 +00:00
|
|
|
import dev.plex.rank.enums.Rank;
|
|
|
|
import dev.plex.util.PlexUtils;
|
2022-01-27 09:00:50 +00:00
|
|
|
import net.kyori.adventure.text.Component;
|
2020-11-02 20:50:51 +00:00
|
|
|
import org.bukkit.Bukkit;
|
2022-01-27 09:00:50 +00:00
|
|
|
import org.bukkit.command.CommandSender;
|
2020-11-02 20:50:51 +00:00
|
|
|
import org.bukkit.entity.Player;
|
2022-02-04 04:49:05 +00:00
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
2020-11-02 20:50:51 +00:00
|
|
|
|
2022-01-27 09:00:50 +00:00
|
|
|
@CommandParameters(name = "opall", description = "Op everyone on the server", aliases = "opa")
|
2020-11-02 20:50:51 +00:00
|
|
|
@CommandPermissions(level = Rank.ADMIN)
|
2022-03-19 03:33:23 +00:00
|
|
|
@System("ranks")
|
2020-11-02 20:50:51 +00:00
|
|
|
public class OpAllCMD extends PlexCommand
|
|
|
|
{
|
|
|
|
@Override
|
2022-02-04 04:49:05 +00:00
|
|
|
protected Component execute(@NotNull CommandSender sender, @Nullable Player playerSender, 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
|
|
|
}
|
2022-02-25 07:09:55 +00:00
|
|
|
PlexUtils.broadcast(messageComponent("oppedAllPlayers", sender.getName()));
|
2022-01-27 09:00:50 +00:00
|
|
|
return null;
|
2020-11-02 20:50:51 +00:00
|
|
|
}
|
|
|
|
}
|