mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
assistant executive title now exists
This commit is contained in:
parent
fd809a0d33
commit
e0bbbbdda8
2
.idea/modules.xml
generated
2
.idea/modules.xml
generated
@ -2,7 +2,7 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/totalfreedom.iml" filepath="$PROJECT_DIR$/totalfreedom.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/TotalFreedomMod.iml" filepath="$PROJECT_DIR$/TotalFreedomMod.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -47,6 +47,7 @@ public enum ConfigEntry
|
||||
SERVER_MOTD(String.class, "server.motd"),
|
||||
SERVER_OWNERS(List.class, "server.owners"),
|
||||
SERVER_EXECUTIVES(List.class, "server.executives"),
|
||||
SERVER_ASSISTANT_EXECUTIVES(List.class, "server.assistant_executives"),
|
||||
SERVER_MASTER_BUILDER_MANAGEMENT(List.class, "server.master_builder_management"),
|
||||
SERVER_BAN_URL(String.class, "server.ban_url"),
|
||||
SERVER_PERMBAN_URL(String.class, "server.permban_url"),
|
||||
|
@ -5,7 +5,6 @@ import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -34,6 +33,7 @@ public class Module_list extends HTTPDModule
|
||||
final JSONArray telnetadmins = new JSONArray();
|
||||
final JSONArray senioradmins = new JSONArray();
|
||||
final JSONArray developers = new JSONArray();
|
||||
final JSONArray assistant_executives = new JSONArray();
|
||||
final JSONArray executives = new JSONArray();
|
||||
final JSONArray owners = new JSONArray();
|
||||
|
||||
@ -60,6 +60,11 @@ public class Module_list extends HTTPDModule
|
||||
executives.add(player.getName());
|
||||
}
|
||||
|
||||
if (ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) && !FUtil.DEVELOPERS.contains(player.getName()))
|
||||
{
|
||||
executives.add(player.getName());
|
||||
}
|
||||
|
||||
if (ConfigEntry.SERVER_OWNERS.getList().contains(player.getName()))
|
||||
{
|
||||
owners.add(player.getName());
|
||||
@ -96,6 +101,7 @@ public class Module_list extends HTTPDModule
|
||||
responseObject.put("telnetadmins", telnetadmins);
|
||||
responseObject.put("senioradmins", senioradmins);
|
||||
responseObject.put("developers", developers);
|
||||
responseObject.put("assistant_executives", assistant_executives);
|
||||
responseObject.put("executives", executives);
|
||||
responseObject.put("owners", owners);
|
||||
responseObject.put("online", server.getOnlinePlayers().size());
|
||||
@ -140,7 +146,7 @@ public class Module_list extends HTTPDModule
|
||||
|
||||
public boolean hasSpecialTitle(Player player)
|
||||
{
|
||||
if (FUtil.DEVELOPERS.contains(player.getName()) || ConfigEntry.SERVER_EXECUTIVES.getList().contains(player.getName()) || ConfigEntry.SERVER_OWNERS.getList().contains(player.getName()))
|
||||
if (FUtil.DEVELOPERS.contains(player.getName()) || ConfigEntry.SERVER_EXECUTIVES.getList().contains(player.getName()) || ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) || ConfigEntry.SERVER_OWNERS.getList().contains(player.getName()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -67,6 +67,11 @@ public class RankManager extends FreedomService
|
||||
return Title.EXECUTIVE;
|
||||
}
|
||||
|
||||
if (ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) && plugin.al.isAdmin(player))
|
||||
{
|
||||
return Title.ASSISTANT_EXECUTIVE;
|
||||
}
|
||||
|
||||
if (plugin.al.isVerifiedAdmin(player))
|
||||
{
|
||||
return Title.VERIFIED_ADMIN;
|
||||
|
@ -8,6 +8,7 @@ public enum Title implements Displayable
|
||||
|
||||
MASTER_BUILDER("a", "Master Builder", ChatColor.DARK_AQUA, "MB"),
|
||||
VERIFIED_ADMIN("a", "Verified Admin", ChatColor.LIGHT_PURPLE, "VA"),
|
||||
ASSISTANT_EXECUTIVE("an", "Assistant Executive", ChatColor.RED, "Asst Exec"),
|
||||
EXECUTIVE("an", "Executive", ChatColor.RED, "Exec"),
|
||||
DEVELOPER("a", "Developer", ChatColor.DARK_PURPLE, "Dev"),
|
||||
OWNER("the", "Owner", ChatColor.DARK_RED, "Owner");
|
||||
|
@ -82,7 +82,7 @@ public class FUtil
|
||||
|
||||
public static boolean isExecutive(String name)
|
||||
{
|
||||
return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name);
|
||||
return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name) || ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getStringList().contains(name);
|
||||
}
|
||||
|
||||
public static boolean isDeveloper(String name)
|
||||
|
@ -24,6 +24,9 @@ server:
|
||||
# All players who show up as executive
|
||||
executives: []
|
||||
|
||||
# All players who show up as assistant executive
|
||||
assistant_executives: []
|
||||
|
||||
# All those who can manage the master builder list
|
||||
master_builder_management: []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user