Old admin mode and commandspy saving

This commit is contained in:
ZeroEpoch1969
2018-04-19 07:29:19 -07:00
parent 200a856413
commit ffbe71f5dd
10 changed files with 135 additions and 29 deletions

View File

@ -9,6 +9,8 @@ public interface Displayable
public String getTag();
public String getAbbr();
public ChatColor getColor();
public String getColoredName();

View File

@ -18,6 +18,8 @@ public enum Rank implements Displayable
private final Type type;
@Getter
private final String name;
@Getter
private final String abbr;
private final String determiner;
@Getter
private final String tag;
@ -30,9 +32,10 @@ public enum Rank implements Displayable
{
this.type = type;
this.name = name;
this.abbr = abbr;
this.determiner = determiner;
this.tag = abbr.isEmpty() ? "" : "[" + abbr + "]";
this.coloredTag = abbr.isEmpty() ? "" : ChatColor.DARK_GRAY + "[" + color + abbr + ChatColor.DARK_GRAY + "]" + color;
this.coloredTag = ChatColor.DARK_GRAY + "[" + color + abbr + ChatColor.DARK_GRAY + "]" + color;
this.color = color;
}
@ -48,6 +51,12 @@ public enum Rank implements Displayable
return determiner + " " + color + ChatColor.ITALIC + name;
}
@Override
public String getAbbr()
{
return abbr;
}
public boolean isConsole()
{
return getType() == Type.ADMIN_CONSOLE;
@ -98,21 +107,6 @@ public enum Rank implements Displayable
}
}
public Rank getPlayerVariant()
{
switch (this)
{
case TELNET_ADMIN:
case TELNET_CONSOLE:
return TELNET_ADMIN;
case SENIOR_ADMIN:
case SENIOR_CONSOLE:
return SENIOR_ADMIN;
default:
return null;
}
}
public static Rank findRank(String string)
{
try

View File

@ -13,6 +13,8 @@ public enum Title implements Displayable
@Getter
private final String name;
@Getter
private final String abbr;
@Getter
private final String tag;
@Getter
private final String coloredTag;
@ -23,8 +25,9 @@ public enum Title implements Displayable
{
this.determiner = determiner;
this.name = name;
this.tag = "[" + tag + "]";
this.coloredTag = ChatColor.DARK_GRAY + "[" + color + tag + ChatColor.DARK_GRAY + "]" + color;
this.abbr = tag;
this.tag = "[" + tag + "]";
this.color = color;
}
@ -40,4 +43,10 @@ public enum Title implements Displayable
return determiner + " " + color + ChatColor.ITALIC + name;
}
@Override
public String getAbbr()
{
return abbr;
}
}