Plex/server/src/main/java/dev/plex/rank/enums/Title.java

53 lines
1.5 KiB
Java
Raw Normal View History

2021-01-03 07:21:15 +00:00
package dev.plex.rank.enums;
2022-04-10 01:53:27 +00:00
import dev.plex.util.PlexUtils;
import lombok.Getter;
import lombok.Setter;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.json.JSONObject;
@Getter
public enum Title
{
2022-03-19 19:37:11 +00:00
MASTER_BUILDER(0, "<aqua>a <dark_aqua>Master Builder<reset>", "Master Builder", "<dark_gray>[<dark_aqua>Master Builder<dark_gray>]", NamedTextColor.DARK_AQUA),
DEV(1, "<aqua>a <dark_purple>Developer<reset>", "Developer", "<dark_gray>[<dark_purple>Developer<dark_gray>]", NamedTextColor.DARK_PURPLE),
OWNER(2, "<aqua>an <blue>Owner<reset>", "Owner", "<dark_gray>[<blue>Owner<dark_gray>]", NamedTextColor.BLUE);
private final int level;
@Setter
private String loginMessage;
@Setter
private String readable;
@Setter
private String prefix;
@Getter
2022-05-10 05:08:45 +00:00
private final NamedTextColor color;
Title(int level, String loginMessage, String readable, String prefix, NamedTextColor color)
{
this.level = level;
this.loginMessage = loginMessage;
this.readable = readable;
this.prefix = prefix;
this.color = color;
}
public Component getPrefix()
{
2022-04-10 01:53:27 +00:00
return PlexUtils.mmDeserialize(this.prefix);
}
public JSONObject toJSON()
{
JSONObject object = new JSONObject();
object.put("prefix", this.prefix);
object.put("loginMessage", this.loginMessage);
return new JSONObject().put(this.name(), object);
}
}