staff -> admins

* rename everything containing staff back to admin (as requested by ryan i've renamed commands like slconfig to saconfig but left "slconfig" as an alias)
* format almost every file correctly
* a few other improvements
This commit is contained in:
speed
2020-12-03 19:28:53 -05:00
parent aae1f524ea
commit 293ea04c56
205 changed files with 1667 additions and 1696 deletions

View File

@ -6,7 +6,7 @@ import java.util.Collections;
import java.util.List;
import me.totalfreedom.totalfreedommod.player.PlayerData;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.staff.StaffMember;
import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
@ -41,12 +41,12 @@ public class Command_panel extends FreedomCommand
return false;
}
if (args[0].equals("create"))
if (args[0].equalsIgnoreCase("create"))
{
msg("Creating your Pterodactyl account...", ChatColor.GREEN);
StaffMember staffMember = getStaffMember(playerSender);
Admin admin = getAdmin(playerSender);
if (staffMember.getPteroID() != null)
if (admin.getPteroID() != null)
{
msg("You already have a Pterodactyl account.", ChatColor.RED);
return true;
@ -64,26 +64,26 @@ public class Command_panel extends FreedomCommand
plugin.ptero.addAccountToServer(id);
staffMember.setPteroID(id);
plugin.sl.save(staffMember);
plugin.sl.updateTables();
admin.setPteroID(id);
plugin.al.save(admin);
plugin.al.updateTables();
plugin.dc.sendPteroInfo(playerData, username, password);
msg("Successfully created your Pterodactyl account. Check your DMs from " + plugin.dc.formatBotTag() + " on discord to get your credentials.", ChatColor.GREEN);
return true;
}
else if (args[0].equals("delete"))
else if (args[0].equalsIgnoreCase("delete"))
{
msg("Deleting your Pterodactyl account...", ChatColor.GREEN);
StaffMember staffMember = getStaffMember(playerSender);
Admin admin = getAdmin(playerSender);
if (staffMember.getPteroID() == null)
if (admin.getPteroID() == null)
{
msg("You do not have a Pterodactyl account.", ChatColor.RED);
return true;
}
boolean deleted = plugin.ptero.deleteAccount(staffMember.getPteroID());
boolean deleted = plugin.ptero.deleteAccount(admin.getPteroID());
if (!deleted)
{
@ -91,18 +91,18 @@ public class Command_panel extends FreedomCommand
return true;
}
staffMember.setPteroID(null);
plugin.sl.save(staffMember);
plugin.sl.updateTables();
admin.setPteroID(null);
plugin.al.save(admin);
plugin.al.updateTables();
msg("Successfully deleted your Pterodactyl account.", ChatColor.GREEN);
return true;
}
/*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 a Pterodactyl account.", ChatColor.RED);
return true;
@ -110,7 +110,7 @@ public class Command_panel extends FreedomCommand
msg("Resetting your password...", ChatColor.GREEN);
String id = staffMember.getPteroID();
String id = admin.getPteroID();
String password = FUtil.randomString(30);
plugin.ptero.setPassword(id, password);
plugin.dc.sendPteroInfo(playerData, null, password);
@ -125,12 +125,11 @@ public class Command_panel 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", "delete");
}
return Collections.emptyList();
}
}
}