mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
useless
This commit is contained in:
parent
35ef866690
commit
81c5775150
@ -8,7 +8,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH, cooldown = 30)
|
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH, cooldown = 30)
|
||||||
@CommandParameters(description = "Op everyone on the server, optionally change everyone's gamemode at the same time.", usage = "/<command> [-c | -s | -a]")
|
@CommandParameters(description = "Op everyone on the server, optionally change everyone's gamemode at the same time.", usage = "/<command>")
|
||||||
public class Command_opall extends FreedomCommand
|
public class Command_opall extends FreedomCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -17,18 +17,10 @@ public class Command_opall extends FreedomCommand
|
|||||||
{
|
{
|
||||||
FUtil.adminAction(sender.getName(), "Opping all players on the server", false);
|
FUtil.adminAction(sender.getName(), "Opping all players on the server", false);
|
||||||
|
|
||||||
boolean doSetGamemode = false;
|
|
||||||
GameMode targetGamemode = GameMode.CREATIVE;
|
|
||||||
|
|
||||||
for (Player player : server.getOnlinePlayers())
|
for (Player player : server.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
player.setOp(true);
|
player.setOp(true);
|
||||||
player.sendMessage(FreedomCommand.YOU_ARE_OP);
|
player.sendMessage(FreedomCommand.YOU_ARE_OP);
|
||||||
|
|
||||||
if (doSetGamemode && !player.getGameMode().equals(GameMode.SPECTATOR))
|
|
||||||
{
|
|
||||||
player.setGameMode(targetGamemode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user