mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-11 13:33:54 +00:00
Revert "Merge branch 'development' of https://github.com/TFPatches/TotalFreedomMod into development"
This reverts commit4407e9e6ec
, reversing changes made toe4c9ea656e
.
This commit is contained in:
@ -7,9 +7,12 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Talk privately with other staff on the server.", usage = "/<command> [message]", aliases = "o,sc")
|
||||
public class Command_staffchat extends FreedomCommand
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(
|
||||
description = "Talk privately with other administrators on the server.",
|
||||
usage = "/<command> [message...]",
|
||||
aliases = "o,ac")
|
||||
public class Command_adminchat extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
@ -25,11 +28,11 @@ public class Command_staffchat extends FreedomCommand
|
||||
|
||||
FPlayer userinfo = plugin.pl.getPlayer(playerSender);
|
||||
userinfo.setAdminChat(!userinfo.inAdminChat());
|
||||
msg("Toggled your staff chat " + (userinfo.inAdminChat() ? "on" : "off") + ".");
|
||||
msg("Toggled your admin chat " + (userinfo.inAdminChat() ? "on" : "off") + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.cm.staffChat(sender, StringUtils.join(args, " "));
|
||||
plugin.cm.adminChat(sender, StringUtils.join(args, " "));
|
||||
}
|
||||
|
||||
return true;
|
@ -11,22 +11,22 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Information on how to apply for admin.", usage = "/<command>", aliases = "si")
|
||||
public class Command_staffinfo extends FreedomCommand
|
||||
@CommandParameters(description = "Information on how to apply for admin.", usage = "/<command>", aliases = "ai")
|
||||
public class Command_admininfo extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
List<String> staffInfo = ConfigEntry.STAFF_INFO.getStringList();
|
||||
List<String> adminInfo = ConfigEntry.ADMIN_INFO.getStringList();
|
||||
|
||||
if (staffInfo.isEmpty())
|
||||
if (adminInfo.isEmpty())
|
||||
{
|
||||
msg("The staff information section of the config.yml file has not been configured.", ChatColor.RED);
|
||||
msg("The admin information section of the config.yml file has not been configured.", ChatColor.RED);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg(FUtil.colorize(StringUtils.join(staffInfo, "\n")));
|
||||
msg(FUtil.colorize(StringUtils.join(adminInfo, "\n")));
|
||||
}
|
||||
|
||||
return true;
|
@ -10,9 +10,9 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.MOD, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Denies joining of operators and only allows staff members to join.", usage = "/<command> [on | off]")
|
||||
public class Command_staffmode extends FreedomCommand
|
||||
@CommandPermissions(level = Rank.TELNET_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Denies joining of operators and only allows admins to join.", usage = "/<command> [on | off]")
|
||||
public class Command_adminmode extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
@ -25,19 +25,19 @@ public class Command_staffmode extends FreedomCommand
|
||||
|
||||
if (args[0].equalsIgnoreCase("off"))
|
||||
{
|
||||
ConfigEntry.STAFF_ONLY_MODE.setBoolean(false);
|
||||
FUtil.staffAction(sender.getName(), "Opening the server to all players.", true);
|
||||
ConfigEntry.ADMIN_ONLY_MODE.setBoolean(false);
|
||||
FUtil.adminAction(sender.getName(), "Opening the server to all players.", true);
|
||||
return true;
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("on"))
|
||||
{
|
||||
ConfigEntry.STAFF_ONLY_MODE.setBoolean(true);
|
||||
FUtil.staffAction(sender.getName(), "Closing the server to non-staff.", true);
|
||||
ConfigEntry.ADMIN_ONLY_MODE.setBoolean(true);
|
||||
FUtil.adminAction(sender.getName(), "Closing the server to non-admins.", true);
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!isStaff(player))
|
||||
if (!isAdmin(player))
|
||||
{
|
||||
player.kickPlayer("Server is now closed to non-staff.");
|
||||
player.kickPlayer("Server is now closed to non-admins.");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@ -49,7 +49,7 @@ public class Command_staffmode extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1 && plugin.sl.isStaff(sender) && !(sender instanceof Player))
|
||||
if (args.length == 1 && plugin.al.isAdmin(sender) && !(sender instanceof Player))
|
||||
{
|
||||
return Arrays.asList("on", "off");
|
||||
}
|
@ -12,10 +12,10 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Allows for staff to configure time, and weather of the AdminWorld, and allows for staff and ops to go to the AdminWorld.",
|
||||
@CommandParameters(description = "Allows for admins to configure time, and weather of the AdminWorld, and allows for admins and ops to go to the AdminWorld.",
|
||||
usage = "/<command> [time <morning | noon | evening | night> | weather <off | rain | storm>]",
|
||||
aliases = "aw")
|
||||
public class Command_staffworld extends FreedomCommand
|
||||
public class Command_adminworld extends FreedomCommand
|
||||
{
|
||||
|
||||
private enum CommandMode
|
||||
@ -63,7 +63,7 @@ public class Command_staffworld extends FreedomCommand
|
||||
World adminWorld = null;
|
||||
try
|
||||
{
|
||||
adminWorld = plugin.wm.staffworld.getWorld();
|
||||
adminWorld = plugin.wm.adminworld.getWorld();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -76,8 +76,8 @@ public class Command_staffworld extends FreedomCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("Going to the StaffWorld.");
|
||||
plugin.wm.staffworld.sendToWorld(playerSender);
|
||||
msg("Going to the AdminWorld.");
|
||||
plugin.wm.adminworld.sendToWorld(playerSender);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -91,8 +91,8 @@ public class Command_staffworld extends FreedomCommand
|
||||
WorldTime timeOfDay = WorldTime.getByAlias(args[1]);
|
||||
if (timeOfDay != null)
|
||||
{
|
||||
plugin.wm.staffworld.setTimeOfDay(timeOfDay);
|
||||
msg("StaffWorld time set to: " + timeOfDay.name());
|
||||
plugin.wm.adminworld.setTimeOfDay(timeOfDay);
|
||||
msg("AdminWorld time set to: " + timeOfDay.name());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -115,8 +115,8 @@ public class Command_staffworld extends FreedomCommand
|
||||
WorldWeather weatherMode = WorldWeather.getByAlias(args[1]);
|
||||
if (weatherMode != null)
|
||||
{
|
||||
plugin.wm.staffworld.setWeatherMode(weatherMode);
|
||||
msg("StaffWorld weather set to: " + weatherMode.name());
|
||||
plugin.wm.adminworld.setWeatherMode(weatherMode);
|
||||
msg("AdminWorld weather set to: " + weatherMode.name());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -152,7 +152,7 @@ public class Command_staffworld extends FreedomCommand
|
||||
// TODO: Redo this properly
|
||||
private void assertCommandPerms(CommandSender sender, Player playerSender) throws PermissionDeniedException
|
||||
{
|
||||
if (!(sender instanceof Player) || playerSender == null || !isStaff(sender))
|
||||
if (!(sender instanceof Player) || playerSender == null || !isAdmin(sender))
|
||||
{
|
||||
throw new PermissionDeniedException();
|
||||
}
|
||||
@ -177,7 +177,7 @@ public class Command_staffworld extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
@ -28,7 +28,7 @@ public class Command_adventure extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
checkRank(Rank.TRIAL_MOD);
|
||||
checkRank(Rank.SUPER_ADMIN);
|
||||
|
||||
if (args[0].equals("-a"))
|
||||
{
|
||||
@ -37,7 +37,7 @@ public class Command_adventure extends FreedomCommand
|
||||
targetPlayer.setGameMode(GameMode.ADVENTURE);
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Changing everyone's gamemode to adventure", false);
|
||||
FUtil.adminAction(sender.getName(), "Changing everyone's gamemode to adventure", false);
|
||||
msg("Your gamemode has been set to adventure.");
|
||||
return true;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.entity.AreaEffectCloud;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Clears lingering potion area effect clouds.", usage = "/<command>", aliases = "aec")
|
||||
public class Command_aeclear extends FreedomCommand
|
||||
{
|
||||
@ -17,7 +17,7 @@ public class Command_aeclear extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Removing all area effect clouds.", true);
|
||||
FUtil.adminAction(sender.getName(), "Removing all area effect clouds.", true);
|
||||
int removed = 0;
|
||||
for (World world : server.getWorlds())
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
@ -12,7 +12,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Manage your AMP account", usage = "/<command> <create | resetpassword>")
|
||||
public class Command_amp extends FreedomCommand
|
||||
{
|
||||
@ -43,9 +43,9 @@ public class Command_amp extends FreedomCommand
|
||||
if (args[0].equals("create"))
|
||||
{
|
||||
msg("Creating your AMP account...", ChatColor.GREEN);
|
||||
StaffMember staffMember = getAdmin(playerSender);
|
||||
Admin admin = getAdmin(playerSender);
|
||||
|
||||
if (staffMember.getAmpUsername() != null)
|
||||
if (admin.getAmpUsername() != null)
|
||||
{
|
||||
msg("You already have an AMP account.", ChatColor.RED);
|
||||
return true;
|
||||
@ -54,9 +54,9 @@ public class Command_amp extends FreedomCommand
|
||||
String username = sender.getName();
|
||||
String password = FUtil.randomString(30);
|
||||
|
||||
staffMember.setAmpUsername(username);
|
||||
plugin.sl.save(staffMember);
|
||||
plugin.sl.updateTables();
|
||||
admin.setAmpUsername(username);
|
||||
plugin.al.save(admin);
|
||||
plugin.al.updateTables();
|
||||
|
||||
plugin.amp.createAccount(username, password);
|
||||
plugin.dc.sendAMPInfo(playerData, username, password);
|
||||
@ -65,9 +65,9 @@ public class Command_amp extends FreedomCommand
|
||||
}
|
||||
else if (args[0].equals("resetpassword"))
|
||||
{
|
||||
StaffMember staffMember = getAdmin(playerSender);
|
||||
Admin admin = getAdmin(playerSender);
|
||||
|
||||
if (staffMember.getAmpUsername() == null)
|
||||
if (admin.getAmpUsername() == null)
|
||||
{
|
||||
msg("You do not have an AMP account.", ChatColor.RED);
|
||||
return true;
|
||||
@ -75,7 +75,7 @@ public class Command_amp extends FreedomCommand
|
||||
|
||||
msg("Resetting your password...", ChatColor.GREEN);
|
||||
|
||||
String username = staffMember.getAmpUsername();
|
||||
String username = admin.getAmpUsername();
|
||||
String password = FUtil.randomString(30);
|
||||
plugin.amp.setPassword(username,password);
|
||||
plugin.dc.sendAMPInfo(playerData, username, password);
|
||||
@ -90,7 +90,7 @@ public class Command_amp extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1 && plugin.sl.isAdmin(sender))
|
||||
if (args.length == 1 && plugin.al.isSeniorAdmin(sender))
|
||||
{
|
||||
return Arrays.asList("create", "resetpassword");
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Make an announcement anonymously to operators.", usage = "/<command> <message>")
|
||||
public class Command_announce extends FreedomCommand
|
||||
{
|
||||
|
@ -5,7 +5,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Toggle whether or not a player has their inventory automatically cleared when they join", usage = "/<command> <player>")
|
||||
public class Command_autoclear extends FreedomCommand
|
||||
{
|
||||
|
@ -5,7 +5,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Toggle whether or not a player is automatically teleported when they join", usage = "/<command> <player>")
|
||||
public class Command_autotp extends FreedomCommand
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "Bans the specified player.", usage = "/<command> <username> [reason] [-nrb | -q]", aliases = "gtfo")
|
||||
public class Command_ban extends FreedomCommand
|
||||
{
|
||||
@ -151,7 +151,7 @@ public class Command_ban extends FreedomCommand
|
||||
bcast.append(" - Reason: ").append(ChatColor.YELLOW).append(reason);
|
||||
}
|
||||
msg(sender, ChatColor.GRAY + username + " has been banned and IP is: " + StringUtils.join(ips, ", "));
|
||||
FUtil.staffAction(sender.getName(), String.format(bcast.toString()), true);
|
||||
FUtil.adminAction(sender.getName(), String.format(bcast.toString()), true);
|
||||
}
|
||||
|
||||
// Kick player and handle others on IP
|
||||
|
@ -11,7 +11,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "Bans the specified ip.", usage = "/<command> <ip> [reason] [-q]")
|
||||
public class Command_banip extends FreedomCommand
|
||||
{
|
||||
@ -72,7 +72,7 @@ public class Command_banip extends FreedomCommand
|
||||
{
|
||||
// Broadcast
|
||||
FLog.info(ChatColor.RED + sender.getName() + " - Banned the IP " + ip);
|
||||
String message = ChatColor.RED + sender.getName() + " - Banned " + (plugin.sl.isStaff(player) ? "the IP " + ip : "an IP");
|
||||
String message = ChatColor.RED + sender.getName() + " - Banned " + (plugin.al.isAdmin(player) ? "the IP " + ip : "an IP");
|
||||
player.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,9 @@ public class Command_banlist extends FreedomCommand
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("purge"))
|
||||
{
|
||||
checkRank(Rank.ADMIN);
|
||||
checkRank(Rank.SENIOR_ADMIN);
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Purging the ban list", true);
|
||||
FUtil.adminAction(sender.getName(), "Purging the ban list", true);
|
||||
int amount = plugin.bm.purge();
|
||||
msg("Purged " + amount + " player bans.");
|
||||
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "Bans the specified name.", usage = "/<command> <name> [reason] [-q]")
|
||||
public class Command_banname extends FreedomCommand
|
||||
{
|
||||
@ -55,7 +55,7 @@ public class Command_banname extends FreedomCommand
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Banned the name " + name, true);
|
||||
FUtil.adminAction(sender.getName(), "Banned the name " + name, true);
|
||||
}
|
||||
|
||||
Player player = getPlayer(name);
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Block all commands for everyone on the server, or a specific player.", usage = "/<command> <-a | purge | <player>>", aliases = "blockcommands,blockcommand,bc,bcmd")
|
||||
public class Command_blockcmd extends FreedomCommand
|
||||
{
|
||||
@ -23,7 +23,7 @@ public class Command_blockcmd extends FreedomCommand
|
||||
|
||||
if (args[0].equals("purge"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Unblocking commands for all players", true);
|
||||
FUtil.adminAction(sender.getName(), "Unblocking commands for all players", true);
|
||||
int counter = 0;
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
@ -40,18 +40,18 @@ public class Command_blockcmd extends FreedomCommand
|
||||
|
||||
if (args[0].equals("-a"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Blocking commands for all non-staff", true);
|
||||
FUtil.adminAction(sender.getName(), "Blocking commands for all non-admins", true);
|
||||
int counter = 0;
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (isStaff(player))
|
||||
if (isAdmin(player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
counter += 1;
|
||||
plugin.pl.getPlayer(player).setCommandsBlocked(true);
|
||||
msg(player, "Your commands have been blocked by a staff member.", ChatColor.RED);
|
||||
msg(player, "Your commands have been blocked by an admin.", ChatColor.RED);
|
||||
}
|
||||
|
||||
msg("Blocked commands for " + counter + " players.");
|
||||
@ -66,9 +66,9 @@ public class Command_blockcmd extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isStaff(player))
|
||||
if (isAdmin(player))
|
||||
{
|
||||
msg(player.getName() + " is a staff member, and cannot have their commands blocked.");
|
||||
msg(player.getName() + " is an admin, and cannot have their commands blocked.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ public class Command_blockcmd extends FreedomCommand
|
||||
if (!playerdata.allCommandsBlocked())
|
||||
{
|
||||
playerdata.setCommandsBlocked(true);
|
||||
FUtil.staffAction(sender.getName(), "Blocking all commands for " + player.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Blocking all commands for " + player.getName(), true);
|
||||
msg("Blocked commands for " + player.getName() + ".");
|
||||
}
|
||||
else
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Restricts/unrestricts block modification abilities for everyone on the server or a certain player.", usage = "/<command> [[-s] <player> [reason] | list | purge | all]")
|
||||
public class Command_blockedit extends FreedomCommand
|
||||
{
|
||||
@ -46,7 +46,7 @@ public class Command_blockedit extends FreedomCommand
|
||||
|
||||
if (args[0].equals("purge"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Unblocking block modification abilities for all players.", true);
|
||||
FUtil.adminAction(sender.getName(), "Unblocking block modification abilities for all players.", true);
|
||||
int count = 0;
|
||||
for (final Player player : this.server.getOnlinePlayers())
|
||||
{
|
||||
@ -63,11 +63,11 @@ public class Command_blockedit extends FreedomCommand
|
||||
|
||||
if (args[0].equals("all"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Blocking block modification abilities for all non-staff.", true);
|
||||
FUtil.adminAction(sender.getName(), "Blocking block modification abilities for all non-admins.", true);
|
||||
int counter = 0;
|
||||
for (final Player player : this.server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.sl.isStaff(player))
|
||||
if (!plugin.al.isAdmin(player))
|
||||
{
|
||||
final FPlayer playerdata = plugin.pl.getPlayer(player);
|
||||
playerdata.setEditBlocked(true);
|
||||
@ -105,20 +105,20 @@ public class Command_blockedit extends FreedomCommand
|
||||
final FPlayer pd = plugin.pl.getPlayer(player2);
|
||||
if (pd.isEditBlocked())
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Unblocking block modification abilities for " + player2.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Unblocking block modification abilities for " + player2.getName(), true);
|
||||
pd.setEditBlocked(false);
|
||||
msg("Unblocking block modification abilities for " + player2.getName());
|
||||
msg(player2, "Your block modification abilities have been restored.", ChatColor.RED);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (plugin.sl.isStaff(player2))
|
||||
if (plugin.al.isAdmin(player2))
|
||||
{
|
||||
msg(player2.getName() + " is an admin, and cannot have their block edits blocked.");
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Blocking block modification abilities for " + player2.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Blocking block modification abilities for " + player2.getName(), true);
|
||||
pd.setEditBlocked(true);
|
||||
|
||||
if (smite)
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Toggle PVP mode for everyone or a certain player.", usage = "/<command> [[-s] <player> [reason] | list | purge | all]", aliases = "pvpblock,pvpmode")
|
||||
public class Command_blockpvp extends FreedomCommand
|
||||
{
|
||||
@ -46,7 +46,7 @@ public class Command_blockpvp extends FreedomCommand
|
||||
|
||||
if (args[0].equals("purge"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Enabling PVP for all players.", true);
|
||||
FUtil.adminAction(sender.getName(), "Enabling PVP for all players.", true);
|
||||
int count = 0;
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
@ -64,11 +64,11 @@ public class Command_blockpvp extends FreedomCommand
|
||||
|
||||
if (args[0].equals("all"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Disabling PVP for all non-staff", true);
|
||||
FUtil.adminAction(sender.getName(), "Disabling PVP for all non-admins", true);
|
||||
int counter = 0;
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.sl.isStaff(player))
|
||||
if (!plugin.al.isAdmin(player))
|
||||
{
|
||||
final FPlayer playerdata = plugin.pl.getPlayer(player);
|
||||
playerdata.setPvpBlocked(true);
|
||||
@ -106,20 +106,20 @@ public class Command_blockpvp extends FreedomCommand
|
||||
final FPlayer pd = plugin.pl.getPlayer(p);
|
||||
if (pd.isPvpBlocked())
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Enabling PVP for " + p.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Enabling PVP for " + p.getName(), true);
|
||||
pd.setPvpBlocked(false);
|
||||
msg("Enabling PVP for " + p.getName());
|
||||
msg(p, "Your PVP have been enabled.", ChatColor.GREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (plugin.sl.isStaff(p))
|
||||
if (plugin.al.isAdmin(p))
|
||||
{
|
||||
msg(p.getName() + " is an admin, and cannot have their PVP disabled.");
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Disabling PVP for " + p.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Disabling PVP for " + p.getName(), true);
|
||||
pd.setPvpBlocked(true);
|
||||
if (smite)
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Blocks redstone on the server.", usage = "/<command>", aliases = "bre")
|
||||
public class Command_blockredstone extends FreedomCommand
|
||||
{
|
||||
@ -18,14 +18,14 @@ public class Command_blockredstone extends FreedomCommand
|
||||
if (ConfigEntry.ALLOW_REDSTONE.getBoolean())
|
||||
{
|
||||
ConfigEntry.ALLOW_REDSTONE.setBoolean(false);
|
||||
FUtil.staffAction(sender.getName(), "Blocking all redstone", true);
|
||||
FUtil.adminAction(sender.getName(), "Blocking all redstone", true);
|
||||
new BukkitRunnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
if (!ConfigEntry.ALLOW_REDSTONE.getBoolean())
|
||||
{
|
||||
FUtil.staffAction("TotalFreedom", "Unblocking all redstone", false);
|
||||
FUtil.adminAction("TotalFreedom", "Unblocking all redstone", false);
|
||||
ConfigEntry.ALLOW_REDSTONE.setBoolean(true);
|
||||
}
|
||||
}
|
||||
@ -34,7 +34,7 @@ public class Command_blockredstone extends FreedomCommand
|
||||
else
|
||||
{
|
||||
ConfigEntry.ALLOW_REDSTONE.setBoolean(true);
|
||||
FUtil.staffAction(sender.getName(), "Unblocking all redstone", true);
|
||||
FUtil.adminAction(sender.getName(), "Unblocking all redstone", true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Place a cage around someone with certain blocks, or someone's player head.", usage = "/<command> <purge | <partialname> [head | block] [playername | blockname]")
|
||||
public class Command_cage extends FreedomCommand
|
||||
{
|
||||
@ -30,7 +30,7 @@ public class Command_cage extends FreedomCommand
|
||||
String skullName = null;
|
||||
if ("purge".equals(args[0]))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Uncaging all players", true);
|
||||
FUtil.adminAction(sender.getName(), "Uncaging all players", true);
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
final FPlayer fPlayer = plugin.pl.getPlayer(player);
|
||||
@ -101,11 +101,11 @@ public class Command_cage extends FreedomCommand
|
||||
|
||||
if (outerMaterial == Material.PLAYER_HEAD)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Caging " + player.getName() + " in " + skullName, true);
|
||||
FUtil.adminAction(sender.getName(), "Caging " + player.getName() + " in " + skullName, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Caging " + player.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Caging " + player.getName(), true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -113,7 +113,7 @@ public class Command_cage extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
@CommandPermissions(level = Rank.MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "For the people that are still alive - gives a cake to everyone on the server.", usage = "/<command>")
|
||||
public class Command_cake extends FreedomCommand
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ public class Command_cartsit extends FreedomCommand
|
||||
{
|
||||
Player targetPlayer = playerSender;
|
||||
|
||||
if (args.length == 1 && plugin.sl.isStaff(sender))
|
||||
if (args.length == 1 && plugin.al.isAdmin(sender))
|
||||
{
|
||||
|
||||
targetPlayer = getPlayer(args[0]);
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Clears the chat.", usage = "/<command>", aliases = "cc")
|
||||
public class Command_clearchat extends FreedomCommand
|
||||
{
|
||||
@ -16,7 +16,7 @@ public class Command_clearchat extends FreedomCommand
|
||||
{
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.sl.isStaff(player))
|
||||
if (!plugin.al.isAdmin(player))
|
||||
{
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
@ -24,7 +24,7 @@ public class Command_clearchat extends FreedomCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
FUtil.staffAction(sender.getName(), "Cleared chat", true);
|
||||
FUtil.adminAction(sender.getName(), "Cleared chat", true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandParameters(description = "Clear the discord message queue.", usage = "/<command>")
|
||||
public class Command_cleardiscordqueue extends FreedomCommand
|
||||
{
|
||||
|
@ -29,11 +29,11 @@ public class Command_clearinventory extends FreedomCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
if (plugin.sl.isStaff(sender))
|
||||
if (plugin.al.isAdmin(sender))
|
||||
{
|
||||
if (args[0].equals("-a"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Clearing everyone's inventory", true);
|
||||
FUtil.adminAction(sender.getName(), "Clearing everyone's inventory", true);
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
player.getInventory().clear();
|
||||
@ -67,7 +67,7 @@ public class Command_clearinventory extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1 && plugin.sl.isStaff(sender))
|
||||
if (args.length == 1 && plugin.al.isAdmin(sender))
|
||||
{
|
||||
List<String> players = FUtil.getPlayerList();
|
||||
players.add("-a");
|
||||
|
@ -1,12 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Spy on commands", usage = "/<command>", aliases = "commandspy")
|
||||
public class Command_cmdspy extends FreedomCommand
|
||||
{
|
||||
@ -14,11 +14,11 @@ public class Command_cmdspy extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
StaffMember staffMember = plugin.sl.getAdmin(playerSender);
|
||||
staffMember.setCommandSpy(!staffMember.getCommandSpy());
|
||||
msg("CommandSpy " + (staffMember.getCommandSpy() ? "enabled." : "disabled."));
|
||||
plugin.sl.save(staffMember);
|
||||
plugin.sl.updateTables();
|
||||
Admin admin = plugin.al.getAdmin(playerSender);
|
||||
admin.setCommandSpy(!admin.getCommandSpy());
|
||||
msg("CommandSpy " + (admin.getCommandSpy() ? "enabled." : "disabled."));
|
||||
plugin.al.save(admin);
|
||||
plugin.al.updateTables();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.MOD, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandParameters(description = "Telnet/Console command - Send a chat message with chat formatting over telnet.", usage = "/<command> <message>", aliases = "csay")
|
||||
public class Command_consolesay extends FreedomCommand
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
@CommandPermissions(level = Rank.MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "For those who have no friends - gives a cookie to everyone on the server.", usage = "/<command>")
|
||||
public class Command_cookie extends FreedomCommand
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ public class Command_creative extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
checkRank(Rank.TRIAL_MOD);
|
||||
checkRank(Rank.SUPER_ADMIN);
|
||||
|
||||
if (args[0].equals("-a"))
|
||||
{
|
||||
@ -37,7 +37,7 @@ public class Command_creative extends FreedomCommand
|
||||
targetPlayer.setGameMode(GameMode.CREATIVE);
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Changing everyone's gamemode to creative", false);
|
||||
FUtil.adminAction(sender.getName(), "Changing everyone's gamemode to creative", false);
|
||||
msg("Your gamemode has been set to creative.");
|
||||
return true;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Curse someone - sends a cursed texture pack to the specified player.", usage = "/<command> <player>")
|
||||
public class Command_curse extends FreedomCommand
|
||||
{
|
||||
@ -57,7 +57,7 @@ public class Command_curse extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1 && plugin.sl.isStaff(sender) && FUtil.isExecutive(sender.getName()))
|
||||
if (args.length == 1 && plugin.al.isAdmin(sender) && FUtil.isExecutive(sender.getName()))
|
||||
{
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Essentials Interface Command - Remove the nickname of all players on the server.", usage = "/<command>")
|
||||
public class Command_denick extends FreedomCommand
|
||||
{
|
||||
@ -20,7 +20,7 @@ public class Command_denick extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Removing all nicknames", false);
|
||||
FUtil.adminAction(sender.getName(), "Removing all nicknames", false);
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Deop a player", usage = "/<command> <partialname>")
|
||||
public class Command_deop extends FreedomCommand
|
||||
{
|
||||
@ -35,7 +35,7 @@ public class Command_deop extends FreedomCommand
|
||||
if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName)
|
||||
|| player.getName().contains(targetName) || player.getDisplayName().contains(targetName))
|
||||
{
|
||||
if (player.isOp() && !plugin.sl.isVanished(player))
|
||||
if (player.isOp() && !plugin.al.isVanished(player))
|
||||
{
|
||||
matchedPlayerNames.add(player.getName());
|
||||
player.setOp(false);
|
||||
@ -48,7 +48,7 @@ public class Command_deop extends FreedomCommand
|
||||
{
|
||||
if (!silent)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "De-opping " + StringUtils.join(matchedPlayerNames, ", "), false);
|
||||
FUtil.adminAction(sender.getName(), "De-opping " + StringUtils.join(matchedPlayerNames, ", "), false);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "Deop everyone on the server.", usage = "/<command>")
|
||||
public class Command_deopall extends FreedomCommand
|
||||
{
|
||||
@ -14,7 +14,7 @@ public class Command_deopall extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "De-opping all players on the server", true);
|
||||
FUtil.adminAction(sender.getName(), "De-opping all players on the server", true);
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Toggle LibsDisguises for everyone online.", usage = "/<command>", aliases = "dtoggle")
|
||||
public class Command_disguisetoggle extends FreedomCommand
|
||||
{
|
||||
@ -20,7 +20,7 @@ public class Command_disguisetoggle extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), (plugin.ldb.isDisguisesEnabled() ? "Disabling" : "Enabling") + " disguises", false);
|
||||
FUtil.adminAction(sender.getName(), (plugin.ldb.isDisguisesEnabled() ? "Disabling" : "Enabling") + " disguises", false);
|
||||
|
||||
if (plugin.ldb.isDisguisesEnabled())
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandParameters(description = "Adds or removes donators", usage = "/<command> <mode> <name> <ip> <package> [forum_user]")
|
||||
public class Command_donator extends FreedomCommand
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.banning.Ban;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
@ -17,7 +17,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
||||
@CommandParameters(description = "Sends the specified player to their doom.", usage = "/<command> <playername> [reason]")
|
||||
public class Command_doom extends FreedomCommand
|
||||
{
|
||||
@ -38,23 +38,23 @@ public class Command_doom extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Casting oblivion over " + player.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Casting oblivion over " + player.getName(), true);
|
||||
FUtil.bcastMsg(player.getName() + " will be completely obliviated!", ChatColor.RED);
|
||||
|
||||
final String ip = player.getAddress().getAddress().getHostAddress().trim();
|
||||
|
||||
// Remove from admin
|
||||
StaffMember staffMember = getAdmin(player);
|
||||
if (staffMember != null)
|
||||
Admin admin = getAdmin(player);
|
||||
if (admin != null)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Removing " + player.getName() + " from the staff list", true);
|
||||
staffMember.setActive(false);
|
||||
plugin.sl.save(staffMember);
|
||||
plugin.sl.updateTables();
|
||||
plugin.amp.updateAccountStatus(staffMember);
|
||||
FUtil.adminAction(sender.getName(), "Removing " + player.getName() + " from the admin list", true);
|
||||
admin.setActive(false);
|
||||
plugin.al.save(admin);
|
||||
plugin.al.updateTables();
|
||||
plugin.amp.updateAccountStatus(admin);
|
||||
if (plugin.dc.enabled && ConfigEntry.DISCORD_ROLE_SYNC.getBoolean())
|
||||
{
|
||||
plugin.dc.syncRoles(staffMember, plugin.pl.getData(staffMember.getName()).getDiscordID());
|
||||
plugin.dc.syncRoles(admin, plugin.pl.getData(admin.getName()).getDiscordID());
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ public class Command_doom extends FreedomCommand
|
||||
public void run()
|
||||
{
|
||||
// message
|
||||
FUtil.staffAction(sender.getName(), "Banning " + player.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Banning " + player.getName(), true);
|
||||
msg(sender, player.getName() + " has been banned and IP is: " + ip);
|
||||
|
||||
// generate explosion
|
||||
|
@ -12,7 +12,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Remove various server entities that may cause lag, such as dropped items, minecarts, and boats.", usage = "/<command> [name | -a]", aliases = "ew,rd")
|
||||
public class Command_entitywipe extends FreedomCommand
|
||||
{
|
||||
@ -54,7 +54,7 @@ public class Command_entitywipe extends FreedomCommand
|
||||
entityName = FUtil.formatName(type.name());
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Purging all " + (type != null ? entityName + "s" : "entities"), true);
|
||||
FUtil.adminAction(sender.getName(), "Purging all " + (type != null ? entityName + "s" : "entities"), true);
|
||||
int count;
|
||||
if (type != null)
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Push people away from you.", usage = "/<command> [radius] [strength]")
|
||||
public class Command_expel extends FreedomCommand
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Surprise someone.", usage = "/<command> <player>")
|
||||
public class Command_explode extends FreedomCommand
|
||||
{
|
||||
@ -58,7 +58,7 @@ public class Command_explode extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1 && plugin.sl.isStaff(sender))
|
||||
if (args.length == 1 && plugin.al.isAdmin(sender))
|
||||
{
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.MOD, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Make arrows explode", usage = "/<command>", aliases = "ea")
|
||||
public class Command_explosivearrows extends FreedomCommand
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Shows all IPs registered to a player", usage = "/<command> <player>", aliases = "showip,listip")
|
||||
public class Command_findip extends FreedomCommand
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public class Command_forcekill extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (!plugin.sl.isMod(sender) && !senderIsConsole)
|
||||
if (!plugin.al.isAdmin(sender) && !senderIsConsole)
|
||||
{
|
||||
playerSender.setHealth(0);
|
||||
return true;
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Freeze/Unfreeze a specified player, or all non-admins on the server.", usage = "/<command> [target | purge]", aliases = "fr")
|
||||
public class Command_freeze extends FreedomCommand
|
||||
{
|
||||
@ -23,15 +23,15 @@ public class Command_freeze extends FreedomCommand
|
||||
|
||||
if (!gFreeze)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Disabling global player freeze", false);
|
||||
FUtil.adminAction(sender.getName(), "Disabling global player freeze", false);
|
||||
msg("Players are now free to move.");
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Enabling global player freeze", false);
|
||||
FUtil.adminAction(sender.getName(), "Enabling global player freeze", false);
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!isStaff(player))
|
||||
if (!isAdmin(player))
|
||||
{
|
||||
player.sendTitle(ChatColor.RED + "You've been globally frozen.", ChatColor.YELLOW + "Please be patient and you will be unfrozen shortly.", 20, 100, 60);
|
||||
msg(player, "You have been globally frozen due to an OP breaking the rules, please wait and you will be unfrozen soon.", ChatColor.RED);
|
||||
@ -44,10 +44,10 @@ public class Command_freeze extends FreedomCommand
|
||||
|
||||
if (args[0].equals("purge"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Unfreezing all players", false);
|
||||
FUtil.adminAction(sender.getName(), "Unfreezing all players", false);
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!isStaff(player))
|
||||
if (!isAdmin(player))
|
||||
{
|
||||
player.sendTitle(ChatColor.GREEN + "You've been unfrozen.", ChatColor.YELLOW + "You may now move again.", 20, 100, 60);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "You'll never even see it coming - repeatedly push players away from you until command is untoggled.", usage = "/<command> <on [radius (default=25)] | off>")
|
||||
public class Command_fuckoff extends FreedomCommand
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "View server health, such as ticks-per-second, memory, etc.", usage = "/<command>")
|
||||
public class Command_health extends FreedomCommand
|
||||
{
|
||||
|
@ -152,7 +152,7 @@ public class Command_hubworld extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@ -177,7 +177,7 @@ public class Command_hubworld extends FreedomCommand
|
||||
// TODO: Redo this properly
|
||||
private void assertCommandPerms(CommandSender sender, Player playerSender) throws PermissionDeniedException
|
||||
{
|
||||
if (!(sender instanceof Player) || playerSender == null || !plugin.sl.isAdmin(playerSender))
|
||||
if (!(sender instanceof Player) || playerSender == null || !plugin.al.isSeniorAdmin(playerSender))
|
||||
{
|
||||
throw new PermissionDeniedException();
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandParameters(description = "Reload the indefinite ban list.", usage = "/<command> reload", aliases = "ib")
|
||||
public class Command_indefban extends FreedomCommand
|
||||
{
|
||||
|
@ -26,11 +26,11 @@ public class Command_invis extends FreedomCommand
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("clear"))
|
||||
{
|
||||
if(!plugin.sl.isStaff(sender))
|
||||
if(!plugin.al.isAdmin(sender))
|
||||
return noPerms();
|
||||
else
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Clearing all invisibility potion effects from all players", true);
|
||||
FUtil.adminAction(sender.getName(), "Clearing all invisibility potion effects from all players", true);
|
||||
clear = true;
|
||||
}
|
||||
}
|
||||
@ -43,10 +43,10 @@ public class Command_invis extends FreedomCommand
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (player.hasPotionEffect(PotionEffectType.INVISIBILITY) && !plugin.sl.isVanished(player))
|
||||
if (player.hasPotionEffect(PotionEffectType.INVISIBILITY) && !plugin.al.isVanished(player))
|
||||
{
|
||||
players.add(player.getName());
|
||||
if (clear && !plugin.sl.isStaff(player))
|
||||
if (clear && !plugin.al.isAdmin(player))
|
||||
{
|
||||
player.removePotionEffect((PotionEffectType.INVISIBILITY));
|
||||
clears++;
|
||||
@ -71,7 +71,7 @@ public class Command_invis extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1 && plugin.sl.isStaff(sender))
|
||||
if (args.length == 1 && plugin.al.isAdmin(sender))
|
||||
return Arrays.asList("clear");
|
||||
|
||||
return Collections.emptyList();
|
||||
|
@ -35,7 +35,7 @@ public class Command_invsee extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (plugin.sl.isStaff(player) && !plugin.sl.isStaff(playerSender))
|
||||
if (plugin.al.isAdmin(player) && !plugin.al.isAdmin(playerSender))
|
||||
{
|
||||
msg("You cannot spy on administrators.");
|
||||
return true;
|
||||
@ -44,7 +44,7 @@ public class Command_invsee extends FreedomCommand
|
||||
|
||||
Inventory inv;
|
||||
|
||||
if (plugin.sl.isStaff(player))
|
||||
if (plugin.al.isAdmin(player))
|
||||
{
|
||||
if (args.length > 1)
|
||||
{
|
||||
@ -75,7 +75,7 @@ public class Command_invsee extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!plugin.sl.isStaff(player))
|
||||
if (!plugin.al.isAdmin(player))
|
||||
{
|
||||
if (args.length > 1)
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ public class Command_jumppads extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Kick the specified player.", usage = "/<command> <player> [reason] [-q]")
|
||||
public class Command_kick extends FreedomCommand
|
||||
{
|
||||
@ -65,11 +65,11 @@ public class Command_kick extends FreedomCommand
|
||||
{
|
||||
if (reason != null)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Kicking " + player.getName() + " - Reason: " + reason, true);
|
||||
FUtil.adminAction(sender.getName(), "Kicking " + player.getName() + " - Reason: " + reason, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Kicking " + player.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Kicking " + player.getName(), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,21 +7,21 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.MOD, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Kick all non-staff on server.", usage = "/<command>", aliases = "kickall")
|
||||
@CommandPermissions(level = Rank.TELNET_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Kick all non-admins on server.", usage = "/<command>", aliases = "kickall")
|
||||
public class Command_kicknoob extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Disconnecting all non-staff.", true);
|
||||
FUtil.adminAction(sender.getName(), "Disconnecting all non-admins.", true);
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.sl.isStaff(player))
|
||||
if (!plugin.al.isAdmin(player))
|
||||
{
|
||||
player.kickPlayer(ChatColor.RED + "All non-staff were kicked by " + sender.getName() + ".");
|
||||
player.kickPlayer(ChatColor.RED + "All non-admins were kicked by " + sender.getName() + ".");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Show the last command the specified player used.", usage = "/<command> <player>")
|
||||
public class Command_lastcmd extends FreedomCommand
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ public class Command_linkdiscord extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.length > 1 && plugin.sl.isStaff(playerSender))
|
||||
if (args.length > 1 && plugin.al.isAdmin(playerSender))
|
||||
{
|
||||
PlayerData playerData = plugin.pl.getData(args[0]);
|
||||
if (playerData == null)
|
||||
|
@ -1,9 +1,9 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import de.myzelyam.api.vanish.VanishAPI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.admin.AdminList;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Displayable;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
@ -15,7 +15,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.IMPOSTOR, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Lists the real names of all online players.", usage = "/<command> [-s | -i | -f | -v]", aliases = "who,lsit")
|
||||
@CommandParameters(description = "Lists the real names of all online players.", usage = "/<command> [-a | -i | -f | -v]", aliases = "who,lsit")
|
||||
public class Command_list extends FreedomCommand
|
||||
{
|
||||
|
||||
@ -41,20 +41,20 @@ public class Command_list extends FreedomCommand
|
||||
String s = args[0];
|
||||
switch (s)
|
||||
{
|
||||
case "-s":
|
||||
case "-a":
|
||||
{
|
||||
listFilter = ListFilter.STAFF;
|
||||
listFilter = ListFilter.ADMINS;
|
||||
break;
|
||||
}
|
||||
case "-v":
|
||||
{
|
||||
checkRank(Rank.TRIAL_MOD);
|
||||
listFilter = ListFilter.VANISHED_STAFF;
|
||||
checkRank(Rank.SUPER_ADMIN);
|
||||
listFilter = ListFilter.VANISHED_ADMINS;
|
||||
break;
|
||||
}
|
||||
case "-t":
|
||||
{
|
||||
checkRank(Rank.MOD);
|
||||
checkRank(Rank.TELNET_ADMIN);
|
||||
listFilter = ListFilter.TELNET_SESSIONS;
|
||||
break;
|
||||
}
|
||||
@ -83,20 +83,20 @@ public class Command_list extends FreedomCommand
|
||||
|
||||
List<String> n = new ArrayList<>();
|
||||
|
||||
if (listFilter == ListFilter.TELNET_SESSIONS && plugin.sl.isStaff(sender) && plugin.sl.getAdmin(sender).getRank().isAtLeast(Rank.MOD))
|
||||
if (listFilter == ListFilter.TELNET_SESSIONS && plugin.al.isAdmin(sender) && plugin.al.getAdmin(sender).getRank().isAtLeast(Rank.TELNET_ADMIN))
|
||||
{
|
||||
List<StaffMember> connectedStaffMembers = plugin.btb.getConnectedAdmins();
|
||||
onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(connectedStaffMembers.size())
|
||||
List<Admin> connectedAdmins = plugin.btb.getConnectedAdmins();
|
||||
onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(connectedAdmins.size())
|
||||
.append(ChatColor.BLUE)
|
||||
.append(" staff connected to telnet.");
|
||||
for (StaffMember staffMember : connectedStaffMembers)
|
||||
.append(" admins connected to telnet.");
|
||||
for (Admin admin : connectedAdmins)
|
||||
{
|
||||
n.add(plugin.rm.getDisplay(staffMember).getColoredTag() + staffMember.getName());
|
||||
n.add(plugin.rm.getDisplay(admin).getColoredTag() + admin.getName());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(server.getOnlinePlayers().size() - VanishAPI.getInvisiblePlayers().size())
|
||||
onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(server.getOnlinePlayers().size() - AdminList.vanished.size())
|
||||
.append(ChatColor.BLUE)
|
||||
.append(" out of a maximum ")
|
||||
.append(ChatColor.RED)
|
||||
@ -105,19 +105,19 @@ public class Command_list extends FreedomCommand
|
||||
.append(" players online.");
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
if (listFilter == ListFilter.STAFF && !plugin.sl.isStaff(p))
|
||||
if (listFilter == ListFilter.ADMINS && !plugin.al.isAdmin(p))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (listFilter == ListFilter.STAFF && plugin.sl.isVanished(p))
|
||||
if (listFilter == ListFilter.ADMINS && plugin.al.isVanished(p.getName()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (listFilter == ListFilter.VANISHED_STAFF && !plugin.sl.isVanished(p))
|
||||
if (listFilter == ListFilter.VANISHED_ADMINS && !plugin.al.isVanished(p.getName()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (listFilter == ListFilter.IMPOSTORS && !plugin.sl.isAdminImpostor(p))
|
||||
if (listFilter == ListFilter.IMPOSTORS && !plugin.al.isAdminImpostor(p))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -125,13 +125,20 @@ public class Command_list extends FreedomCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (listFilter == ListFilter.PLAYERS && plugin.sl.isVanished(p))
|
||||
if (listFilter == ListFilter.PLAYERS && plugin.al.isVanished(p))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final Displayable display = plugin.rm.getDisplay(p);
|
||||
n.add(display.getColoredTag() + p.getName());
|
||||
if (!senderIsConsole && plugin.al.isAdmin(playerSender) && plugin.al.getAdmin(playerSender).getOldTags())
|
||||
{
|
||||
n.add(getOldPrefix(display) + p.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
n.add(display.getColoredTag() + p.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
String playerType = listFilter.toString().toLowerCase().replace('_', ' ');
|
||||
@ -155,12 +162,29 @@ public class Command_list extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getOldPrefix(Displayable display)
|
||||
{
|
||||
ChatColor color = display.getColor();
|
||||
|
||||
if (color.equals(ChatColor.AQUA))
|
||||
{
|
||||
color = ChatColor.GOLD;
|
||||
}
|
||||
else if (color.equals(ChatColor.GOLD))
|
||||
{
|
||||
color = ChatColor.LIGHT_PURPLE;
|
||||
}
|
||||
|
||||
String prefix = "[" + display.getAbbr() + "]";
|
||||
|
||||
return color + prefix;
|
||||
}
|
||||
|
||||
private enum ListFilter
|
||||
{
|
||||
PLAYERS,
|
||||
STAFF,
|
||||
VANISHED_STAFF,
|
||||
ADMINS,
|
||||
VANISHED_ADMINS,
|
||||
TELNET_SESSIONS,
|
||||
FAMOUS_PLAYERS,
|
||||
IMPOSTORS
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "This is evil, and I never should have wrote it - blocks specified player's input.", usage = "/<command> <all | purge | <<partialname> on | off> [-q]>")
|
||||
public class Command_lockup extends FreedomCommand
|
||||
{
|
||||
@ -22,7 +22,7 @@ public class Command_lockup extends FreedomCommand
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("all"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Locking up all players", true);
|
||||
FUtil.adminAction(sender.getName(), "Locking up all players", true);
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
@ -32,7 +32,7 @@ public class Command_lockup extends FreedomCommand
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("purge"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Unlocking all players", true);
|
||||
FUtil.adminAction(sender.getName(), "Unlocking all players", true);
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
cancelLockup(player);
|
||||
@ -59,7 +59,7 @@ public class Command_lockup extends FreedomCommand
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Locking up " + player.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Locking up " + player.getName(), true);
|
||||
}
|
||||
startLockup(player);
|
||||
msg("Locked up " + player.getName() + ".");
|
||||
@ -76,7 +76,7 @@ public class Command_lockup extends FreedomCommand
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Unlocking " + player.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Unlocking " + player.getName(), true);
|
||||
}
|
||||
cancelLockup(player);
|
||||
msg("Unlocked " + player.getName() + ".");
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Register your connection with the TFM logviewer.", usage = "/<command> [off]")
|
||||
public class Command_logs extends FreedomCommand
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Make a WorldGuard region for an OP.", usage = "/<command> <playername> <name>", aliases = "mor")
|
||||
public class Command_makeopregion extends FreedomCommand
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandParameters(description = "Manage the shop", usage = "/<command> <coins: <add | set | remove> <amount> <player | all> | items: <give | take> <item> <player>", aliases = "ms")
|
||||
public class Command_manageshop extends FreedomCommand
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Manually verify someone", usage = "/<command> <playername>", aliases="mv")
|
||||
public class Command_manuallyverify extends FreedomCommand
|
||||
{
|
||||
@ -39,7 +39,7 @@ public class Command_manuallyverify extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Manually verifying player " + player.getName(), false);
|
||||
FUtil.adminAction(sender.getName(), "Manually verifying player " + player.getName(), false);
|
||||
player.setOp(true);
|
||||
player.sendMessage(YOU_ARE_OP);
|
||||
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "seth's personal command", usage = "/<command> <players>", aliases = "genocide")
|
||||
public class Command_massmurder extends FreedomCommand
|
||||
{
|
||||
|
@ -152,7 +152,7 @@ public class Command_masterbuilderworld extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@ -177,7 +177,7 @@ public class Command_masterbuilderworld extends FreedomCommand
|
||||
// TODO: Redo this properly
|
||||
private void assertCommandPerms(CommandSender sender, Player playerSender) throws PermissionDeniedException
|
||||
{
|
||||
if (!(sender instanceof Player) || playerSender == null || !plugin.sl.isAdmin(playerSender))
|
||||
if (!(sender instanceof Player) || playerSender == null || !plugin.al.isSeniorAdmin(playerSender))
|
||||
{
|
||||
throw new PermissionDeniedException();
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class Command_mbconfig extends FreedomCommand
|
||||
|
||||
if (data.isMasterBuilder() && plugin.pl.isPlayerImpostor(player))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Re-adding " + player.getName() + " to the Master Builder list", true);
|
||||
FUtil.adminAction(sender.getName(), "Re-adding " + player.getName() + " to the Master Builder list", true);
|
||||
player.setOp(true);
|
||||
player.sendMessage(YOU_ARE_OP);
|
||||
|
||||
@ -79,7 +79,7 @@ public class Command_mbconfig extends FreedomCommand
|
||||
}
|
||||
else if (!data.isMasterBuilder())
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Adding " + player.getName() + " to the Master Builder list", true);
|
||||
FUtil.adminAction(sender.getName(), "Adding " + player.getName() + " to the Master Builder list", true);
|
||||
data.setMasterBuilder(true);
|
||||
data.setVerification(true);
|
||||
plugin.pl.save(data);
|
||||
@ -113,7 +113,7 @@ public class Command_mbconfig extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Removing " + data.getName() + " from the Master Builder list", true);
|
||||
FUtil.adminAction(sender.getName(), "Removing " + data.getName() + " from the Master Builder list", true);
|
||||
data.setMasterBuilder(false);
|
||||
if (data.getDiscordID() == null)
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Control mob limiting parameters.", usage = "/<command> <on|off|setmax <count>|dragon|giant|ghast|slime>")
|
||||
public class Command_moblimiter extends FreedomCommand
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Purge all mobs in all worlds.", usage = "/<command> [name]", aliases = "mp")
|
||||
public class Command_mobpurge extends FreedomCommand
|
||||
{
|
||||
@ -46,7 +46,7 @@ public class Command_mobpurge extends FreedomCommand
|
||||
mobName = FUtil.formatName(type.name());
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Purging all " + (type != null ? mobName + "s" : "mobs"), true);
|
||||
FUtil.adminAction(sender.getName(), "Purging all " + (type != null ? mobName + "s" : "mobs"), true);
|
||||
int count = plugin.ew.purgeMobs(type);
|
||||
msg(count + " " + (type != null ? mobName : "mob") + FUtil.showS(count) + " removed.");
|
||||
return true;
|
||||
|
@ -16,7 +16,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Mutes a player with brute force.", usage = "/<command> <[-s | -q] <player> [reason] | list | purge | all>", aliases = "stfu")
|
||||
public class Command_mute extends FreedomCommand
|
||||
{
|
||||
@ -53,7 +53,7 @@ public class Command_mute extends FreedomCommand
|
||||
|
||||
if (args[0].equals("purge"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Unmuting all players.", true);
|
||||
FUtil.adminAction(sender.getName(), "Unmuting all players.", true);
|
||||
FPlayer info;
|
||||
int count = 0;
|
||||
for (Player mp : server.getOnlinePlayers())
|
||||
@ -73,13 +73,13 @@ public class Command_mute extends FreedomCommand
|
||||
|
||||
if (args[0].equals("all"))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Muting all non-admins", true);
|
||||
FUtil.adminAction(sender.getName(), "Muting all non-admins", true);
|
||||
|
||||
FPlayer playerdata;
|
||||
int counter = 0;
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.sl.isStaff(player))
|
||||
if (!plugin.al.isAdmin(player))
|
||||
{
|
||||
player.sendTitle(ChatColor.RED + "You've been muted globally.", ChatColor.YELLOW + "Please be patient and you will be unmuted shortly.", 20, 100, 60);
|
||||
playerdata = plugin.pl.getPlayer(player);
|
||||
@ -120,7 +120,7 @@ public class Command_mute extends FreedomCommand
|
||||
}
|
||||
|
||||
FPlayer playerdata = plugin.pl.getPlayer(player);
|
||||
if (plugin.sl.isStaff(player))
|
||||
if (plugin.al.isAdmin(player))
|
||||
{
|
||||
msg(player.getName() + " is an admin, and can't be muted.");
|
||||
return true;
|
||||
@ -140,7 +140,7 @@ public class Command_mute extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Muting " + player.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Muting " + player.getName(), true);
|
||||
|
||||
if (smite)
|
||||
{
|
||||
@ -163,7 +163,7 @@ public class Command_mute extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
@ -15,9 +15,9 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Manage your staff entry.", usage = "/<command> [-o <staff member>] <clearips | clearip <ip> | setlogin <message> | clearlogin | setacformat <format> | clearacformat> | oldtags | logstick | syncroles>")
|
||||
public class Command_mystaff extends FreedomCommand
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Manage your admin entry.", usage = "/<command> [-o <admin>] <clearips | clearip <ip> | setlogin <message> | clearlogin | setacformat <format> | clearacformat> | oldtags | logstick | syncroles>")
|
||||
public class Command_myadmin extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
@ -29,13 +29,13 @@ public class Command_mystaff extends FreedomCommand
|
||||
}
|
||||
|
||||
Player init = null;
|
||||
StaffMember target = getAdmin(playerSender);
|
||||
Admin target = getAdmin(playerSender);
|
||||
Player targetPlayer = playerSender;
|
||||
|
||||
// -o switch
|
||||
if (args[0].equals("-o"))
|
||||
{
|
||||
checkRank(Rank.ADMIN);
|
||||
checkRank(Rank.SENIOR_ADMIN);
|
||||
init = playerSender;
|
||||
targetPlayer = getPlayer(args[1]);
|
||||
if (targetPlayer == null)
|
||||
@ -47,7 +47,7 @@ public class Command_mystaff extends FreedomCommand
|
||||
target = getAdmin(targetPlayer);
|
||||
if (target == null)
|
||||
{
|
||||
msg("That player is not a staff member", ChatColor.RED);
|
||||
msg("That player is not an admin", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -72,19 +72,19 @@ public class Command_mystaff extends FreedomCommand
|
||||
|
||||
if (init == null)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Clearing my IPs", true);
|
||||
FUtil.adminAction(sender.getName(), "Clearing my supered IPs", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Clearing " + target.getName() + "' IPs", true);
|
||||
FUtil.adminAction(sender.getName(), "Clearing " + target.getName() + "' supered IPs", true);
|
||||
}
|
||||
|
||||
int counter = target.getIps().size() - 1;
|
||||
target.clearIPs();
|
||||
target.addIp(targetIp);
|
||||
|
||||
plugin.sl.save(target);
|
||||
plugin.sl.updateTables();
|
||||
plugin.al.save(target);
|
||||
plugin.al.updateTables();
|
||||
|
||||
plugin.pl.syncIps(target);
|
||||
|
||||
@ -121,16 +121,16 @@ public class Command_mystaff extends FreedomCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("You cannot remove that staff members's current IP.");
|
||||
msg("You cannot remove that admin's current IP.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Removing an IP" + (init == null ? "" : " from " + targetPlayer.getName() + "'s IPs"), true);
|
||||
FUtil.adminAction(sender.getName(), "Removing a supered IP" + (init == null ? "" : " from " + targetPlayer.getName() + "'s IPs"), true);
|
||||
|
||||
target.removeIp(args[1]);
|
||||
plugin.sl.save(target);
|
||||
plugin.sl.updateTables();
|
||||
plugin.al.save(target);
|
||||
plugin.al.updateTables();
|
||||
|
||||
plugin.pl.syncIps(target);
|
||||
|
||||
@ -141,7 +141,6 @@ public class Command_mystaff extends FreedomCommand
|
||||
|
||||
case "setlogin":
|
||||
{
|
||||
checkRank(Rank.MOD);
|
||||
if (args.length < 2)
|
||||
{
|
||||
return false;
|
||||
@ -159,43 +158,50 @@ public class Command_mystaff extends FreedomCommand
|
||||
msg("Your login message cannot be more than 100 characters (excluding your rank and your name)", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
FUtil.staffAction(sender.getName(), "Setting personal login message" + (init == null ? "" : " for " + targetPlayer.getName()), false);
|
||||
FUtil.adminAction(sender.getName(), "Setting personal login message" + (init == null ? "" : " for " + targetPlayer.getName()), false);
|
||||
target.setLoginMessage(message);
|
||||
String previewMessage = plugin.rm.craftLoginMessage(targetPlayer, message);
|
||||
msg((init == null ? "Your" : targetPlayer.getName() + "'s") + " login message is now: ");
|
||||
msg("> " + previewMessage);
|
||||
plugin.sl.save(target);
|
||||
plugin.sl.updateTables();
|
||||
plugin.al.save(target);
|
||||
plugin.al.updateTables();
|
||||
return true;
|
||||
}
|
||||
|
||||
case "clearlogin":
|
||||
{
|
||||
checkRank(Rank.MOD);
|
||||
FUtil.staffAction(sender.getName(), "Clearing personal login message" + (init == null ? "" : " for " + targetPlayer.getName()), false);
|
||||
FUtil.adminAction(sender.getName(), "Clearing personal login message" + (init == null ? "" : " for " + targetPlayer.getName()), false);
|
||||
target.setLoginMessage(null);
|
||||
plugin.sl.save(target);
|
||||
plugin.sl.updateTables();
|
||||
plugin.al.save(target);
|
||||
plugin.al.updateTables();
|
||||
return true;
|
||||
}
|
||||
|
||||
case "setscformat":
|
||||
case "setacformat":
|
||||
{
|
||||
String format = StringUtils.join(args, " ", 1, args.length);
|
||||
target.setAcFormat(format);
|
||||
plugin.sl.save(target);
|
||||
plugin.sl.updateTables();
|
||||
msg("Set staff chat format to \"" + format + "\".", ChatColor.GRAY);
|
||||
String example = format.replace("%name%", "ExampleStaff").replace("%rank%", Rank.MOD.getAbbr()).replace("%rankcolor%", Rank.MOD.getColor().toString()).replace("%msg%", "The quick brown fox jumps over the lazy dog.");
|
||||
plugin.al.save(target);
|
||||
plugin.al.updateTables();
|
||||
msg("Set admin chat format to \"" + format + "\".", ChatColor.GRAY);
|
||||
String example = format.replace("%name%", "ExampleAdmin").replace("%rank%", Rank.TELNET_ADMIN.getAbbr()).replace("%rankcolor%", Rank.TELNET_ADMIN.getColor().toString()).replace("%msg%", "The quick brown fox jumps over the lazy dog.");
|
||||
msg(ChatColor.GRAY + "Example: " + FUtil.colorize(example));
|
||||
return true;
|
||||
}
|
||||
case "clearscformat":
|
||||
case "clearacformat":
|
||||
{
|
||||
target.setAcFormat(null);
|
||||
plugin.sl.save(target);
|
||||
plugin.sl.updateTables();
|
||||
msg("Cleared staff chat format.", ChatColor.GRAY);
|
||||
plugin.al.save(target);
|
||||
plugin.al.updateTables();
|
||||
msg("Cleared admin chat format.", ChatColor.GRAY);
|
||||
return true;
|
||||
}
|
||||
case "oldtags":
|
||||
{
|
||||
target.setOldTags(!target.getOldTags());
|
||||
plugin.al.save(target);
|
||||
plugin.al.updateTables();
|
||||
msg((target.getOldTags() ? "Enabled" : "Disabled") + " old tags.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -242,7 +248,7 @@ public class Command_mystaff extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@ -269,7 +275,7 @@ public class Command_mystaff extends FreedomCommand
|
||||
{
|
||||
if (args[0].equals("clearip"))
|
||||
{
|
||||
List<String> ips = plugin.sl.getAdmin(sender).getIps();
|
||||
List<String> ips = plugin.al.getAdmin(sender).getIps();
|
||||
ips.remove(FUtil.getIp((Player) sender));
|
||||
return ips;
|
||||
}
|
||||
@ -290,10 +296,10 @@ public class Command_mystaff extends FreedomCommand
|
||||
{
|
||||
if (args[0].equals("-o") && args[2].equals("clearip"))
|
||||
{
|
||||
StaffMember staffMember = plugin.sl.getEntryByName(args[1]);
|
||||
if (staffMember != null)
|
||||
Admin admin = plugin.al.getEntryByName(args[1]);
|
||||
if (admin != null)
|
||||
{
|
||||
return staffMember.getIps();
|
||||
return admin.getIps();
|
||||
}
|
||||
}
|
||||
}
|
@ -16,7 +16,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Essentials Interface Command - Remove illegal chatcodes from nicknames of one or all players on server.", usage = "/<command> [player]", aliases = "nc")
|
||||
public class Command_nickclean extends FreedomCommand
|
||||
{
|
||||
@ -53,12 +53,12 @@ public class Command_nickclean extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Cleaning " + player.getName() + "'s nickname", false);
|
||||
FUtil.adminAction(sender.getName(), "Cleaning " + player.getName() + "'s nickname", false);
|
||||
cleanNickname(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Cleaning all nicknames", false);
|
||||
FUtil.adminAction(sender.getName(), "Cleaning all nicknames", false);
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
{
|
||||
cleanNickname(player);
|
||||
|
@ -41,11 +41,11 @@ public class Command_nickfilter extends FreedomCommand
|
||||
|
||||
player = getPlayerByDisplayName(displayName);
|
||||
|
||||
if (player == null || plugin.sl.isVanished(player) && !plugin.sl.isStaff(sender))
|
||||
if (player == null || plugin.al.isVanished(player) && !plugin.al.isAdmin(sender))
|
||||
{
|
||||
player = getPlayerByDisplayNameAlt(displayName);
|
||||
|
||||
if (player == null || !plugin.sl.isVanished(player) && !plugin.sl.isStaff(sender))
|
||||
if (player == null || !plugin.al.isVanished(player) && !plugin.al.isAdmin(sender))
|
||||
{
|
||||
sender.sendMessage(ChatColor.GRAY + "Can't find player by nickname: " + displayName);
|
||||
return true;
|
||||
|
@ -13,7 +13,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Manage notes for a player", usage = "/<command> <name> <list | add <note> | remove <id> | clear>")
|
||||
public class Command_notes extends FreedomCommand
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ public class Command_op extends FreedomCommand
|
||||
if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName)
|
||||
|| player.getName().contains(targetName) || player.getDisplayName().contains(targetName))
|
||||
{
|
||||
if (!player.isOp() && !plugin.sl.isVanished(player))
|
||||
if (!player.isOp() && !plugin.al.isVanished(player))
|
||||
{
|
||||
matchedPlayerNames.add(player.getName());
|
||||
player.setOp(true);
|
||||
@ -49,7 +49,7 @@ public class Command_op extends FreedomCommand
|
||||
{
|
||||
if (!silent)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Opping " + StringUtils.join(matchedPlayerNames, ", "), false);
|
||||
FUtil.adminAction(sender.getName(), "Opping " + StringUtils.join(matchedPlayerNames, ", "), false);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -14,7 +14,7 @@ public class Command_opall extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Opping all players on the server", false);
|
||||
FUtil.adminAction(sender.getName(), "Opping all players on the server", false);
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ public class Command_opme extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Opping " + sender.getName(), false);
|
||||
FUtil.adminAction(sender.getName(), "Opping " + sender.getName(), false);
|
||||
sender.setOp(true);
|
||||
sender.sendMessage(FreedomCommand.YOU_ARE_OP);
|
||||
return true;
|
||||
|
@ -42,13 +42,13 @@ public class Command_ops extends FreedomCommand
|
||||
|
||||
if (args[0].equals("purge"))
|
||||
{
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
noPerms();
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Purging all operators", true);
|
||||
FUtil.adminAction(sender.getName(), "Purging all operators", true);
|
||||
|
||||
for (OfflinePlayer player : server.getOperators())
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@CommandPermissions(level = Rank.MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "POW!!! Right in the kisser! One of these days Alice, straight to the Moon - Sends the specified player into orbit.",
|
||||
usage = "/<command> <target> [<<power> | stop>]")
|
||||
public class Command_orbit extends FreedomCommand
|
||||
@ -60,7 +60,7 @@ public class Command_orbit extends FreedomCommand
|
||||
playerdata.startOrbiting(strength);
|
||||
|
||||
player.setVelocity(new Vector(0, strength, 0));
|
||||
FUtil.staffAction(sender.getName(), "Orbiting " + player.getName(), false);
|
||||
FUtil.adminAction(sender.getName(), "Orbiting " + player.getName(), false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ public class Command_permissions extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (args.length > 0 && args[0].equals("reload") && plugin.sl.isStaff(sender))
|
||||
if (args.length > 0 && args[0].equals("reload") && plugin.al.isAdmin(sender))
|
||||
{
|
||||
plugin.permissions.load();
|
||||
plugin.pem.loadPermissionNodes();
|
||||
|
@ -3,14 +3,14 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import java.time.Instant;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.staff.ActivityLogEntry;
|
||||
import me.totalfreedom.totalfreedommod.admin.ActivityLogEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Gets your playtime statistics.", usage = "/<command>")
|
||||
public class Command_playtime extends FreedomCommand
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
@CommandPermissions(level = Rank.MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.TELNET_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Enable, disable, or reload a specified plugin, as well as list all plugins on the server.", usage = "/<command> <<enable | disable | reload> <pluginname>> | list>", aliases = "plc")
|
||||
public class Command_plugincontrol extends FreedomCommand
|
||||
{
|
||||
@ -135,7 +135,7 @@ public class Command_plugincontrol extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
@ -41,12 +41,12 @@ public class Command_potion extends FreedomCommand
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("clearall"))
|
||||
{
|
||||
if (!(plugin.sl.isStaff(sender) || senderIsConsole))
|
||||
if (!(plugin.al.isAdmin(sender) || senderIsConsole))
|
||||
{
|
||||
noPerms();
|
||||
return true;
|
||||
}
|
||||
FUtil.staffAction(sender.getName(), "Cleared all potion effects from all players", true);
|
||||
FUtil.adminAction(sender.getName(), "Cleared all potion effects from all players", true);
|
||||
for (Player target : server.getOnlinePlayers())
|
||||
{
|
||||
for (PotionEffect potion_effect : target.getActivePotionEffects())
|
||||
@ -76,9 +76,9 @@ public class Command_potion extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
msg(ChatColor.RED + "Only staff can clear potion effects from other players.");
|
||||
msg(ChatColor.RED + "Only admins can clear potion effects from other players.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ public class Command_potion extends FreedomCommand
|
||||
{
|
||||
target = getPlayer(args[4]);
|
||||
|
||||
if (target == null || plugin.sl.isVanished(target) && !plugin.sl.isStaff(sender))
|
||||
if (target == null || plugin.al.isVanished(target) && !plugin.al.isAdmin(sender))
|
||||
{
|
||||
msg(FreedomCommand.PLAYER_NOT_FOUND, ChatColor.RED);
|
||||
return true;
|
||||
@ -117,9 +117,9 @@ public class Command_potion extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "Only staff can apply potion effects to other players.");
|
||||
sender.sendMessage(ChatColor.RED + "Only admins can apply potion effects to other players.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ public class Command_potion extends FreedomCommand
|
||||
{
|
||||
List<String> arguments = new ArrayList<>();
|
||||
arguments.addAll(Arrays.asList("list", "clear", "add"));
|
||||
if (plugin.sl.isStaff(sender))
|
||||
if (plugin.al.isAdmin(sender))
|
||||
{
|
||||
arguments.add("clearall");
|
||||
}
|
||||
@ -193,7 +193,7 @@ public class Command_potion extends FreedomCommand
|
||||
{
|
||||
if (args[0].equals("clear"))
|
||||
{
|
||||
if (plugin.sl.isStaff(sender))
|
||||
if (plugin.al.isAdmin(sender))
|
||||
{
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
@ -217,7 +217,7 @@ public class Command_potion extends FreedomCommand
|
||||
return Arrays.asList("<amplifier>");
|
||||
}
|
||||
}
|
||||
else if (args.length == 5 && plugin.sl.isStaff(sender))
|
||||
else if (args.length == 5 && plugin.al.isAdmin(sender))
|
||||
{
|
||||
if (args[0].equals("add"))
|
||||
{
|
||||
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
@ -15,8 +15,8 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Allows staff to see potions that are thrown.", usage = "/<command> <enable | on | disable | off> | history [player] <page>", aliases = "potspy")
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Allows admins to see potions that are thrown.", usage = "/<command> <enable | on | disable | off> | history [player] <page>", aliases = "potspy")
|
||||
public class Command_potionspy extends FreedomCommand
|
||||
{
|
||||
private String titleText = "&8&m------------------&r &ePotionSpy &8&m------------------&r";
|
||||
@ -28,11 +28,11 @@ public class Command_potionspy extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
StaffMember staffMember = plugin.sl.getAdmin(playerSender);
|
||||
Admin admin = plugin.al.getAdmin(playerSender);
|
||||
|
||||
if (args.length <= 0)
|
||||
{
|
||||
setPotionSpyState(staffMember, !staffMember.getPotionSpy());
|
||||
setPotionSpyState(admin, !admin.getPotionSpy());
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -41,12 +41,12 @@ public class Command_potionspy extends FreedomCommand
|
||||
{
|
||||
case "enable":
|
||||
case "on":
|
||||
setPotionSpyState(staffMember, true);
|
||||
setPotionSpyState(admin, true);
|
||||
break;
|
||||
|
||||
case "disable":
|
||||
case "off":
|
||||
setPotionSpyState(staffMember, false);
|
||||
setPotionSpyState(admin, false);
|
||||
break;
|
||||
|
||||
case "history":
|
||||
@ -176,12 +176,12 @@ public class Command_potionspy extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setPotionSpyState(StaffMember staffMember, boolean state)
|
||||
private void setPotionSpyState(Admin admin, boolean state)
|
||||
{
|
||||
staffMember.setPotionSpy(state);
|
||||
plugin.sl.save(staffMember);
|
||||
plugin.sl.updateTables();
|
||||
msg("PotionSpy is now " + (staffMember.getPotionSpy() ? "enabled." : "disabled."));
|
||||
admin.setPotionSpy(state);
|
||||
plugin.al.save(admin);
|
||||
plugin.al.updateTables();
|
||||
msg("PotionSpy is now " + (admin.getPotionSpy() ? "enabled." : "disabled."));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,104 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.ProtectArea;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(
|
||||
description = "Protect areas so that only admins can directly modify blocks in those areas. WorldEdit and other such plugins might bypass this.",
|
||||
usage = "/<command> <list | clear | remove <label> | add <label> <radius>>", aliases = "pa")
|
||||
public class Command_protectarea extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (!ConfigEntry.PROTECTAREA_ENABLED.getBoolean())
|
||||
{
|
||||
msg("Protected areas are currently disabled in the TotalFreedomMod configuration.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.length == 1)
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("list"))
|
||||
{
|
||||
msg("Protected Areas: " + StringUtils.join(plugin.pa.getProtectedAreaLabels(), ", "));
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("clear"))
|
||||
{
|
||||
plugin.pa.clearProtectedAreas();
|
||||
|
||||
msg("Protected Areas Cleared.");
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (args.length == 2)
|
||||
{
|
||||
if ("remove".equals(args[0]))
|
||||
{
|
||||
plugin.pa.removeProtectedArea(args[1]);
|
||||
|
||||
msg("Area removed. Protected Areas: " + StringUtils.join(plugin.pa.getProtectedAreaLabels(), ", "));
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (args.length == 3)
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("add"))
|
||||
{
|
||||
if (senderIsConsole)
|
||||
{
|
||||
msg("You must be in-game to set a protected area.");
|
||||
return true;
|
||||
}
|
||||
|
||||
Double radius;
|
||||
try
|
||||
{
|
||||
radius = Double.parseDouble(args[2]);
|
||||
}
|
||||
catch (NumberFormatException nfex)
|
||||
{
|
||||
msg("Invalid radius.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (radius > ProtectArea.MAX_RADIUS || radius < 0.0D)
|
||||
{
|
||||
msg("Invalid radius. Radius must be a positive value less than " + ProtectArea.MAX_RADIUS + ".");
|
||||
return true;
|
||||
}
|
||||
|
||||
plugin.pa.addProtectedArea(args[1], playerSender.getLocation(), radius);
|
||||
|
||||
msg("Area added. Protected Areas: " + StringUtils.join(plugin.pa.getProtectedAreaLabels(), ", "));
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Purge current mutes, command blocks, orbits, freezes, potion effects, cages, and entities.", usage = "/<command>")
|
||||
public class Command_purgeall extends FreedomCommand
|
||||
{
|
||||
@ -19,7 +19,7 @@ public class Command_purgeall extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Purging all player data", true);
|
||||
FUtil.adminAction(sender.getName(), "Purging all player data", true);
|
||||
|
||||
// Purge entities
|
||||
for (World world : Bukkit.getWorlds())
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Broadcasts the given message. Supports colors.", usage = "/<command> <message>")
|
||||
public class Command_rawsay extends FreedomCommand
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Forcefully start a reaction", usage = "/<command>")
|
||||
public class Command_reactionbar extends FreedomCommand
|
||||
{
|
||||
|
@ -38,9 +38,9 @@ public class Command_report extends FreedomCommand
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.sl.isStaff(player))
|
||||
if (plugin.al.isAdmin(player))
|
||||
{
|
||||
msg(ChatColor.RED + "You can not report server staff.");
|
||||
msg(ChatColor.RED + "You can not report an admin.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class Command_ride extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (playerData.getRideMode().equals("off") && !isStaff(sender))
|
||||
if (playerData.getRideMode().equals("off") && !isAdmin(sender))
|
||||
{
|
||||
msg("That player cannot be ridden.", ChatColor.RED);
|
||||
return true;
|
||||
|
@ -17,7 +17,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Remove all blocks of a certain type in the radius of certain players.", usage = "/<command> <block> [radius (default=50)] [player]")
|
||||
public class Command_ro extends FreedomCommand
|
||||
{
|
||||
@ -95,7 +95,7 @@ public class Command_ro extends FreedomCommand
|
||||
World adminWorld = null;
|
||||
try
|
||||
{
|
||||
adminWorld = plugin.wm.staffworld.getWorld();
|
||||
adminWorld = plugin.wm.adminworld.getWorld();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -104,7 +104,7 @@ public class Command_ro extends FreedomCommand
|
||||
int affected = 0;
|
||||
if (targetPlayer == null)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Removing all " + names + " within " + radius + " blocks of all players... Brace for lag!", false);
|
||||
FUtil.adminAction(sender.getName(), "Removing all " + names + " within " + radius + " blocks of all players... Brace for lag!", false);
|
||||
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
{
|
||||
@ -123,7 +123,7 @@ public class Command_ro extends FreedomCommand
|
||||
{
|
||||
if (targetPlayer.getWorld() != adminWorld)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Removing all " + names + " within " + radius + " blocks of " + targetPlayer.getName(), false);
|
||||
FUtil.adminAction(sender.getName(), "Removing all " + names + " within " + radius + " blocks of " + targetPlayer.getName(), false);
|
||||
for (Material material : materials)
|
||||
{
|
||||
affected += replaceBlocks(targetPlayer.getLocation(), material, Material.AIR, radius);
|
||||
@ -131,7 +131,7 @@ public class Command_ro extends FreedomCommand
|
||||
}
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Remove complete! " + affected + " blocks removed.", false);
|
||||
FUtil.adminAction(sender.getName(), "Remove complete! " + affected + " blocks removed.", false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
@CommandPermissions(level = Rank.MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "You have thrown a rock, but you have also summoned a meteor!", usage = "/<command>")
|
||||
public class Command_rock extends FreedomCommand
|
||||
{
|
||||
|
@ -5,7 +5,7 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
@ -17,8 +17,8 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "List, add, remove, or set the rank of staff, clean or reload the admin list, or view the info of staff.", usage = "/<command> <list | clean | reload | | setrank <username> <rank> | <add | remove | info> <username>>")
|
||||
public class Command_slconfig extends FreedomCommand
|
||||
@CommandParameters(description = "List, add, remove, or set the rank of admins, clean or reload the admin list, or view the info of admins.", usage = "/<command> <list | clean | reload | | setrank <username> <rank> | <add | remove | info> <username>>")
|
||||
public class Command_saconfig extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
@ -33,36 +33,36 @@ public class Command_slconfig extends FreedomCommand
|
||||
{
|
||||
case "list":
|
||||
{
|
||||
msg("Staff: " + StringUtils.join(plugin.sl.getAdminNames(), ", "), ChatColor.GOLD);
|
||||
msg("Admins: " + StringUtils.join(plugin.al.getAdminNames(), ", "), ChatColor.GOLD);
|
||||
return true;
|
||||
}
|
||||
|
||||
case "clean":
|
||||
{
|
||||
checkConsole();
|
||||
checkRank(Rank.ADMIN);
|
||||
checkRank(Rank.SENIOR_ADMIN);
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Cleaning staff list", true);
|
||||
plugin.sl.deactivateOldEntries(true);
|
||||
msg("Staff: " + StringUtils.join(plugin.sl.getAdminNames(), ", "), ChatColor.GOLD);
|
||||
FUtil.adminAction(sender.getName(), "Cleaning admin list", true);
|
||||
plugin.al.deactivateOldEntries(true);
|
||||
msg("Admins: " + StringUtils.join(plugin.al.getAdminNames(), ", "), ChatColor.GOLD);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
case "reload":
|
||||
{
|
||||
checkRank(Rank.ADMIN);
|
||||
checkRank(Rank.SENIOR_ADMIN);
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Reloading the staff list", true);
|
||||
plugin.sl.load();
|
||||
msg("Staff list reloaded!");
|
||||
FUtil.adminAction(sender.getName(), "Reloading the admin list", true);
|
||||
plugin.al.load();
|
||||
msg("Admin list reloaded!");
|
||||
return true;
|
||||
}
|
||||
|
||||
case "setrank":
|
||||
{
|
||||
checkConsole();
|
||||
checkRank(Rank.ADMIN);
|
||||
checkRank(Rank.SENIOR_ADMIN);
|
||||
|
||||
if (args.length < 3)
|
||||
{
|
||||
@ -82,25 +82,25 @@ public class Command_slconfig extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!rank.isAtLeast(Rank.TRIAL_MOD))
|
||||
if (!rank.isAtLeast(Rank.SUPER_ADMIN))
|
||||
{
|
||||
msg("Rank must be Trial Mod or higher.", ChatColor.RED);
|
||||
msg("Rank must be Super Admin or higher.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
StaffMember staffMember = plugin.sl.getEntryByName(args[1]);
|
||||
if (staffMember == null)
|
||||
Admin admin = plugin.al.getEntryByName(args[1]);
|
||||
if (admin == null)
|
||||
{
|
||||
msg("Unknown staff member: " + args[1]);
|
||||
msg("Unknown admin: " + args[1]);
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Setting " + staffMember.getName() + "'s rank to " + rank.getName(), true);
|
||||
FUtil.adminAction(sender.getName(), "Setting " + admin.getName() + "'s rank to " + rank.getName(), true);
|
||||
|
||||
staffMember.setRank(rank);
|
||||
plugin.sl.save(staffMember);
|
||||
admin.setRank(rank);
|
||||
plugin.al.save(admin);
|
||||
|
||||
Player player = getPlayer(staffMember.getName());
|
||||
Player player = getPlayer(admin.getName());
|
||||
if (player != null)
|
||||
{
|
||||
plugin.rm.updateDisplay(player);
|
||||
@ -108,12 +108,12 @@ public class Command_slconfig extends FreedomCommand
|
||||
|
||||
if (plugin.dc.enabled && ConfigEntry.DISCORD_ROLE_SYNC.getBoolean())
|
||||
{
|
||||
plugin.dc.syncRoles(staffMember, plugin.pl.getData(staffMember.getName()).getDiscordID());
|
||||
plugin.dc.syncRoles(admin, plugin.pl.getData(admin.getName()).getDiscordID());
|
||||
}
|
||||
|
||||
plugin.amp.updateAccountStatus(staffMember);
|
||||
plugin.amp.updateAccountStatus(admin);
|
||||
|
||||
msg("Set " + staffMember.getName() + "'s rank to " + rank.getName());
|
||||
msg("Set " + admin.getName() + "'s rank to " + rank.getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -124,26 +124,26 @@ public class Command_slconfig extends FreedomCommand
|
||||
return false;
|
||||
}
|
||||
|
||||
checkRank(Rank.TRIAL_MOD);
|
||||
checkRank(Rank.SUPER_ADMIN);
|
||||
|
||||
StaffMember staffMember = plugin.sl.getEntryByName(args[1]);
|
||||
Admin admin = plugin.al.getEntryByName(args[1]);
|
||||
|
||||
if (staffMember == null)
|
||||
if (admin == null)
|
||||
{
|
||||
final Player player = getPlayer(args[1]);
|
||||
if (player != null)
|
||||
{
|
||||
staffMember = plugin.sl.getAdmin(player);
|
||||
admin = plugin.al.getAdmin(player);
|
||||
}
|
||||
}
|
||||
|
||||
if (staffMember == null)
|
||||
if (admin == null)
|
||||
{
|
||||
msg("Staff member not found: " + args[1]);
|
||||
msg("Admin not found: " + args[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg(staffMember.toString());
|
||||
msg(admin.toString());
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -157,7 +157,7 @@ public class Command_slconfig extends FreedomCommand
|
||||
}
|
||||
|
||||
checkConsole();
|
||||
checkRank(Rank.MOD);
|
||||
checkRank(Rank.TELNET_ADMIN);
|
||||
|
||||
// Player already an admin?
|
||||
final Player player = getPlayer(args[1]);
|
||||
@ -168,31 +168,31 @@ public class Command_slconfig extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (plugin.sl.isStaff(player))
|
||||
if (plugin.al.isAdmin(player))
|
||||
{
|
||||
msg("That player is already a staff member.");
|
||||
msg("That player is already admin.");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Find the old admin entry
|
||||
String name = player != null ? player.getName() : args[1];
|
||||
StaffMember staffMember = null;
|
||||
for (StaffMember loopStaffMember : plugin.sl.getAllStaffMembers())
|
||||
Admin admin = null;
|
||||
for (Admin loopAdmin : plugin.al.getAllAdmins())
|
||||
{
|
||||
if (loopStaffMember.getName().equalsIgnoreCase(name) || loopStaffMember.getIps().contains(FUtil.getIp(player)))
|
||||
if (loopAdmin.getName().equalsIgnoreCase(name) || loopAdmin.getIps().contains(FUtil.getIp(player)))
|
||||
{
|
||||
staffMember = loopStaffMember;
|
||||
admin = loopAdmin;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.pl.isPlayerImpostor(player))
|
||||
{
|
||||
msg("This player was labeled as a Player impostor and is not a staff member, therefore they cannot be added to the staff list.", ChatColor.RED);
|
||||
msg("This player was labeled as a Player impostor and is not an admin, therefore they cannot be added to the admin list.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (staffMember == null) // New staff member
|
||||
if (admin == null) // New admin
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
@ -200,39 +200,39 @@ public class Command_slconfig extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Adding " + player.getName() + " to the staff list", true);
|
||||
staffMember = new StaffMember(player);
|
||||
FUtil.adminAction(sender.getName(), "Adding " + player.getName() + " to the admin list", true);
|
||||
admin = new Admin(player);
|
||||
|
||||
plugin.sl.addAdmin(staffMember);
|
||||
plugin.al.addAdmin(admin);
|
||||
plugin.rm.updateDisplay(player);
|
||||
plugin.amp.updateAccountStatus(staffMember);
|
||||
plugin.amp.updateAccountStatus(admin);
|
||||
}
|
||||
else // Existing staff member
|
||||
else // Existing admin
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Re-adding " + player.getName() + " to the staff list", true);
|
||||
FUtil.adminAction(sender.getName(), "Re-adding " + player.getName() + " to the admin list", true);
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
String oldName = staffMember.getName();
|
||||
String oldName = admin.getName();
|
||||
if (oldName != player.getName())
|
||||
{
|
||||
staffMember.setName(player.getName());
|
||||
plugin.sql.updateStaffMemberName(oldName, staffMember.getName());
|
||||
admin.setName(player.getName());
|
||||
plugin.sql.updateAdminName(oldName, admin.getName());
|
||||
}
|
||||
staffMember.addIp(FUtil.getIp(player));
|
||||
admin.addIp(FUtil.getIp(player));
|
||||
}
|
||||
|
||||
staffMember.setActive(true);
|
||||
staffMember.setLastLogin(new Date());
|
||||
admin.setActive(true);
|
||||
admin.setLastLogin(new Date());
|
||||
|
||||
if (plugin.sl.isVerifiedAdmin(player))
|
||||
if (plugin.al.isVerifiedAdmin(player))
|
||||
{
|
||||
plugin.sl.verifiedNoStaff.remove(player.getName());
|
||||
plugin.sl.verifiedNoStaffIps.remove(player.getName());
|
||||
plugin.al.verifiedNoAdmins.remove(player.getName());
|
||||
plugin.al.verifiedNoAdminIps.remove(player.getName());
|
||||
}
|
||||
|
||||
plugin.sl.save(staffMember);
|
||||
plugin.sl.updateTables();
|
||||
plugin.al.save(admin);
|
||||
plugin.al.updateTables();
|
||||
if (player != null)
|
||||
{
|
||||
plugin.rm.updateDisplay(player);
|
||||
@ -240,9 +240,9 @@ public class Command_slconfig extends FreedomCommand
|
||||
|
||||
if (plugin.dc.enabled && ConfigEntry.DISCORD_ROLE_SYNC.getBoolean())
|
||||
{
|
||||
plugin.dc.syncRoles(staffMember, plugin.pl.getData(player).getDiscordID());
|
||||
plugin.dc.syncRoles(admin, plugin.pl.getData(player).getDiscordID());
|
||||
}
|
||||
plugin.amp.updateAccountStatus(staffMember);
|
||||
plugin.amp.updateAccountStatus(admin);
|
||||
}
|
||||
|
||||
if (player != null)
|
||||
@ -271,27 +271,27 @@ public class Command_slconfig extends FreedomCommand
|
||||
}
|
||||
|
||||
checkConsole();
|
||||
checkRank(Rank.MOD);
|
||||
checkRank(Rank.TELNET_ADMIN);
|
||||
|
||||
Player player = getPlayer(args[1]);
|
||||
StaffMember staffMember = player != null ? plugin.sl.getAdmin(player) : plugin.sl.getEntryByName(args[1]);
|
||||
Admin admin = player != null ? plugin.al.getAdmin(player) : plugin.al.getEntryByName(args[1]);
|
||||
|
||||
if (staffMember == null)
|
||||
if (admin == null)
|
||||
{
|
||||
msg("Staff member not found: " + args[1]);
|
||||
msg("Admin not found: " + args[1]);
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Removing " + staffMember.getName() + " from the staff list", true);
|
||||
staffMember.setActive(false);
|
||||
FUtil.adminAction(sender.getName(), "Removing " + admin.getName() + " from the admin list", true);
|
||||
admin.setActive(false);
|
||||
|
||||
if (plugin.pl.getPlayer(player).inAdminChat())
|
||||
{
|
||||
plugin.pl.getPlayer(player).setAdminChat(false);
|
||||
}
|
||||
|
||||
plugin.sl.save(staffMember);
|
||||
plugin.sl.updateTables();
|
||||
plugin.al.save(admin);
|
||||
plugin.al.updateTables();
|
||||
if (player != null)
|
||||
{
|
||||
plugin.rm.updateDisplay(player);
|
||||
@ -299,10 +299,10 @@ public class Command_slconfig extends FreedomCommand
|
||||
|
||||
if (plugin.dc.enabled && ConfigEntry.DISCORD_ROLE_SYNC.getBoolean())
|
||||
{
|
||||
plugin.dc.syncRoles(staffMember, plugin.pl.getData(staffMember.getName()).getDiscordID());
|
||||
plugin.dc.syncRoles(admin, plugin.pl.getData(admin.getName()).getDiscordID());
|
||||
}
|
||||
|
||||
plugin.amp.updateAccountStatus(staffMember);
|
||||
plugin.amp.updateAccountStatus(admin);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -321,16 +321,16 @@ public class Command_slconfig extends FreedomCommand
|
||||
{
|
||||
List<String> arguments = new ArrayList<>();
|
||||
arguments.add("list");
|
||||
if (plugin.sl.isStaff(sender))
|
||||
if (plugin.al.isAdmin(sender))
|
||||
{
|
||||
arguments.add("info");
|
||||
}
|
||||
if (plugin.sl.isMod(sender))
|
||||
if (plugin.al.isTelnetAdmin(sender))
|
||||
{
|
||||
arguments.add("add");
|
||||
arguments.add("remove");
|
||||
}
|
||||
if (plugin.sl.isAdmin(sender))
|
||||
if (plugin.al.isSeniorAdmin(sender))
|
||||
{
|
||||
arguments.add("reload");
|
||||
arguments.add("clean");
|
||||
@ -344,7 +344,7 @@ public class Command_slconfig extends FreedomCommand
|
||||
}
|
||||
if (args.length == 3 && args[0].equals("setrank"))
|
||||
{
|
||||
return Arrays.asList("TRIAL_MOD", "MOD", "ADMIN");
|
||||
return Arrays.asList("SUPER_ADMIN", "TELNET_ADMIN", "SENIOR_ADMIN");
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
@ -8,7 +8,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Broadcasts the given message as the server, includes sender name.", usage = "/<command> <message>")
|
||||
public class Command_say extends FreedomCommand
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Sends a guardian particle effect with an enderman scream to the specified player.", usage = "/<command> <player>")
|
||||
public class Command_scare extends FreedomCommand
|
||||
{
|
||||
@ -53,7 +53,7 @@ public class Command_scare extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1 && plugin.sl.isStaff(sender))
|
||||
if (args.length == 1 && plugin.al.isAdmin(sender))
|
||||
{
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ public class Command_serverstats extends FreedomCommand
|
||||
{
|
||||
msg("-==" + ConfigEntry.SERVER_NAME.getString() + " server stats==-", ChatColor.GOLD);
|
||||
msg("Total opped players: " + server.getOperators().size(), ChatColor.RED);
|
||||
msg("Total staff: " + plugin.sl.getAllStaffMembers().size() + " (" + plugin.sl.getActiveStaffMembers().size() + " active)", ChatColor.BLUE);
|
||||
msg("Total staff: " + plugin.al.getAllAdmins().size() + " (" + plugin.al.getActiveAdmins().size() + " active)", ChatColor.BLUE);
|
||||
int bans = plugin.im.getIndefBans().size();
|
||||
int nameBans = plugin.im.getNameBanCount();
|
||||
int uuidBans = plugin.im.getUuidBanCount();
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Sets everyone's WorldEdit block modification limit to the default limit or to a custom limit.", usage = "/<command> [limit]", aliases = "setl,swl")
|
||||
public class Command_setlimit extends FreedomCommand
|
||||
{
|
||||
@ -43,7 +43,7 @@ public class Command_setlimit extends FreedomCommand
|
||||
}
|
||||
if (success)
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Setting everyone's WorldEdit block modification limit to " + amount + ".", true);
|
||||
FUtil.adminAction(sender.getName(), "Setting everyone's WorldEdit block modification limit to " + amount + ".", true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.Location;
|
||||
@ -7,7 +8,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Set the spawn point of the world you are in.", usage = "/<command>")
|
||||
public class Command_setspawnworld extends FreedomCommand
|
||||
{
|
||||
@ -20,6 +21,11 @@ public class Command_setspawnworld extends FreedomCommand
|
||||
|
||||
msg("Spawn location for this world set to: " + FUtil.formatLocation(playerSender.getWorld().getSpawnLocation()));
|
||||
|
||||
if (ConfigEntry.PROTECTAREA_ENABLED.getBoolean() && ConfigEntry.PROTECTAREA_SPAWNPOINTS.getBoolean())
|
||||
{
|
||||
plugin.pa.addProtectedArea("spawn_" + playerSender.getWorld().getName(), pos, ConfigEntry.PROTECTAREA_RADIUS.getDouble());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandParameters(description = "Set a player's total votes", usage = "/<command> <player> <votes>")
|
||||
public class Command_settotalvotes extends FreedomCommand
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Someone being a little bitch? Smite them down...", usage = "/<command> <player> [reason] [-q]")
|
||||
public class Command_smite extends FreedomCommand
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Quickly spectate someone.", usage = "/<command> <playername>", aliases = "spec")
|
||||
public class Command_spectate extends FreedomCommand
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Quickly change your own gamemode to spectator, or define someone's username to change theirs.", usage = "/<command> <[partialname]>", aliases = "gmsp")
|
||||
public class Command_spectator extends FreedomCommand
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.BOTH)
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Kicks everyone and stops the server.", usage = "/<command> [reason]")
|
||||
public class Command_stop extends FreedomCommand
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ public class Command_survival extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
checkRank(Rank.TRIAL_MOD);
|
||||
checkRank(Rank.SUPER_ADMIN);
|
||||
|
||||
if (args[0].equals("-a"))
|
||||
{
|
||||
@ -37,7 +37,7 @@ public class Command_survival extends FreedomCommand
|
||||
targetPlayer.setGameMode(GameMode.SURVIVAL);
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Changing everyone's gamemode to survival", false);
|
||||
FUtil.adminAction(sender.getName(), "Changing everyone's gamemode to survival", false);
|
||||
msg("Your gamemode has been set to survival.");
|
||||
return true;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class Command_tag extends FreedomCommand
|
||||
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (plugin.sl.isVanished(player) && !plugin.sl.isStaff(sender))
|
||||
if (plugin.al.isVanished(player) && !plugin.al.isAdmin(sender))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -63,13 +63,13 @@ public class Command_tag extends FreedomCommand
|
||||
}
|
||||
else if ("clearall".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
noPerms();
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.staffAction(sender.getName(), "Removing all tags", false);
|
||||
FUtil.adminAction(sender.getName(), "Removing all tags", false);
|
||||
|
||||
int count = 0;
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
@ -113,7 +113,7 @@ public class Command_tag extends FreedomCommand
|
||||
{
|
||||
if ("clear".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
noPerms();
|
||||
return true;
|
||||
@ -156,7 +156,7 @@ public class Command_tag extends FreedomCommand
|
||||
});
|
||||
final String outputTag = FUtil.colorize(strippedTag);
|
||||
|
||||
int tagLimit = (plugin.sl.isStaff(sender) ? 30 : 20);
|
||||
int tagLimit = (plugin.al.isAdmin(sender) ? 30 : 20);
|
||||
|
||||
final String rawTag = ChatColor.stripColor(outputTag).toLowerCase();
|
||||
|
||||
@ -166,7 +166,7 @@ public class Command_tag extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
for (String word : FORBIDDEN_WORDS)
|
||||
{
|
||||
@ -233,7 +233,7 @@ public class Command_tag extends FreedomCommand
|
||||
tag = StringUtils.join(splitTag, "");
|
||||
final String outputTag = FUtil.colorize(tag);
|
||||
|
||||
int tagLimit = (plugin.sl.isStaff(sender) ? 30 : 20);
|
||||
int tagLimit = (plugin.al.isAdmin(sender) ? 30 : 20);
|
||||
|
||||
final String rawTag = ChatColor.stripColor(outputTag).toLowerCase();
|
||||
|
||||
@ -243,7 +243,7 @@ public class Command_tag extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!plugin.sl.isStaff(sender))
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
for (String word : FORBIDDEN_WORDS)
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user