mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-19 05:45:01 +00:00
commit
893c7c2991
@ -1,6 +1,8 @@
|
||||
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.command.Command;
|
||||
@ -24,6 +26,29 @@ public class Command_survival extends TFM_Command
|
||||
}
|
||||
|
||||
Player p;
|
||||
p = sender_p;
|
||||
if (args.length != 0){
|
||||
if (args[0].equalsIgnoreCase("-a"))
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(sender))
|
||||
{
|
||||
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
|
||||
return true;
|
||||
}
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if(!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
{
|
||||
player.setGameMode(GameMode.CREATIVE);
|
||||
}
|
||||
}
|
||||
|
||||
Bukkit.broadcastMessage(ChatColor.AQUA + sender.getName() + " - Setting all non-admins gamemode to creative.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (args.length == 0)
|
||||
{
|
||||
p = sender_p;
|
||||
|
Loading…
Reference in New Issue
Block a user