2020-10-27 21:56:05 +00:00
|
|
|
package me.totalfreedom.plex.rank.enums;
|
2020-10-27 20:12:38 +00:00
|
|
|
|
2020-10-28 19:07:02 +00:00
|
|
|
import com.google.common.collect.Lists;
|
2020-10-27 20:12:38 +00:00
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
|
2020-10-28 19:07:02 +00:00
|
|
|
import java.util.List;
|
|
|
|
|
2020-10-27 20:12:38 +00:00
|
|
|
public enum Rank
|
|
|
|
{
|
2020-10-31 04:51:22 +00:00
|
|
|
IMPOSTOR(-1, ChatColor.AQUA + "an " + ChatColor.YELLOW + "Impostor", ChatColor.YELLOW + "[Imp]"),
|
2020-10-28 03:49:56 +00:00
|
|
|
NONOP(0, ChatColor.WHITE + "a " + ChatColor.WHITE + "Non-Op", ChatColor.WHITE + ""),
|
|
|
|
OP(1, ChatColor.GREEN + "an " + ChatColor.GREEN + "Operator", ChatColor.GREEN + "[OP]"),
|
|
|
|
ADMIN(2, ChatColor.DARK_GREEN + "an " + ChatColor.DARK_GREEN + "Admin", ChatColor.DARK_GREEN + "[Admin]"),
|
|
|
|
SENIOR_ADMIN(3, ChatColor.GOLD + "a " + ChatColor.GOLD + "Senior Admin", ChatColor.GOLD + "[SrA]"),
|
|
|
|
EXECUTIVE(4, ChatColor.RED + "an " + ChatColor.RED + "Executive", ChatColor.RED + "[Exec]");
|
2020-10-27 20:12:38 +00:00
|
|
|
|
2020-10-28 19:07:02 +00:00
|
|
|
private String loginMessage;
|
|
|
|
private String prefix;
|
|
|
|
private int level;
|
|
|
|
private List<String> permissions;
|
2020-10-27 20:12:38 +00:00
|
|
|
|
2020-10-28 03:49:56 +00:00
|
|
|
Rank(int level, String loginMessage, String prefix)
|
2020-10-27 20:12:38 +00:00
|
|
|
{
|
2020-10-28 19:07:02 +00:00
|
|
|
this.level = level;
|
2020-10-28 03:49:56 +00:00
|
|
|
this.loginMessage = loginMessage;
|
2020-10-27 20:12:38 +00:00
|
|
|
this.prefix = prefix;
|
2020-10-28 19:07:02 +00:00
|
|
|
this.permissions = Lists.newArrayList();
|
2020-10-27 20:12:38 +00:00
|
|
|
}
|
|
|
|
|
2020-10-28 03:49:56 +00:00
|
|
|
public String getPrefix()
|
|
|
|
{
|
2020-10-28 19:14:44 +00:00
|
|
|
return ChatColor.translateAlternateColorCodes('&', prefix);
|
2020-10-27 21:56:05 +00:00
|
|
|
}
|
|
|
|
|
2020-10-28 03:49:56 +00:00
|
|
|
public String getLoginMSG()
|
|
|
|
{
|
2020-10-28 19:14:44 +00:00
|
|
|
return ChatColor.translateAlternateColorCodes('&', loginMessage);
|
2020-10-27 21:56:05 +00:00
|
|
|
}
|
2020-10-28 19:07:02 +00:00
|
|
|
|
|
|
|
public int getLevel() {
|
|
|
|
return level;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLoginMessage(String msg)
|
|
|
|
{
|
|
|
|
this.loginMessage = msg;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setPrefix(String prefix) {
|
|
|
|
this.prefix = prefix;
|
|
|
|
}
|
|
|
|
|
2020-11-02 00:06:08 +00:00
|
|
|
public boolean isAtLeast(Rank rank)
|
2020-10-28 19:07:02 +00:00
|
|
|
{
|
|
|
|
return getLevel() >= rank.getLevel();
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<String> getPermissions() {
|
|
|
|
return permissions;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setPermissions(List<String> permissions) {
|
|
|
|
this.permissions = permissions;
|
|
|
|
}
|
2020-10-27 20:12:38 +00:00
|
|
|
}
|