Plex/src/main/java/dev/plex/rank/enums/Rank.java

69 lines
1.7 KiB
Java
Raw Normal View History

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