mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-02 12:56:40 +00:00
Now buildable.
This commit is contained in:
@ -1,47 +1,80 @@
|
||||
package me.totalfreedom.totalfreedommod.rank;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.JoinConfiguration;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
|
||||
public enum Title implements Displayable
|
||||
{
|
||||
|
||||
MASTER_BUILDER("a", "Master Builder", "Master Builders", ChatColor.DARK_AQUA, org.bukkit.ChatColor.DARK_AQUA, "MB", true, true),
|
||||
EXECUTIVE("an", "Executive", "Executives", ChatColor.RED, org.bukkit.ChatColor.RED, "Exec", true, true),
|
||||
ASSTEXEC("an", "Assistant Executive", "Assistant Executives", ChatColor.RED, org.bukkit.ChatColor.RED, "Asst Exec", true, true),
|
||||
DEVELOPER("a", "Developer", "Developers", ChatColor.DARK_PURPLE, org.bukkit.ChatColor.DARK_PURPLE, "Dev", true, true),
|
||||
OWNER("the", "Owner", "Owners", ChatColor.DARK_RED, org.bukkit.ChatColor.DARK_RED, "Owner", true, true);
|
||||
MASTER_BUILDER(Component.text("a"),
|
||||
Component.text("Master Builder"),
|
||||
Component.text("Master Builders"),
|
||||
NamedTextColor.DARK_AQUA,
|
||||
org.bukkit.ChatColor.DARK_AQUA,
|
||||
Component.text("MB"),
|
||||
true,
|
||||
true),
|
||||
EXECUTIVE(Component.text("an"),
|
||||
Component.text("Executive"),
|
||||
Component.text("Executives"),
|
||||
NamedTextColor.RED,
|
||||
org.bukkit.ChatColor.RED,
|
||||
Component.text("Exec"),
|
||||
true,
|
||||
true),
|
||||
ASST_EXEC(Component.text("an"),
|
||||
Component.text("Assistant Executive"),
|
||||
Component.text("Assistant Executives"),
|
||||
NamedTextColor.RED,
|
||||
org.bukkit.ChatColor.RED,
|
||||
Component.text("Asst Exec"),
|
||||
true,
|
||||
true),
|
||||
DEVELOPER(Component.text("a"),
|
||||
Component.text("Developer"),
|
||||
Component.text("Developers"),
|
||||
NamedTextColor.DARK_PURPLE,
|
||||
org.bukkit.ChatColor.DARK_PURPLE,
|
||||
Component.text("Dev"),
|
||||
true,
|
||||
true),
|
||||
OWNER(Component.text("an"),
|
||||
Component.text("Owner"),
|
||||
Component.text("Owners"),
|
||||
NamedTextColor.DARK_RED,
|
||||
org.bukkit.ChatColor.DARK_RED,
|
||||
Component.text("Owner"),
|
||||
true,
|
||||
true);
|
||||
|
||||
|
||||
private final String article;
|
||||
private final Component article;
|
||||
|
||||
private final String name;
|
||||
private final Component name;
|
||||
|
||||
private final String abbr;
|
||||
private final String plural;
|
||||
private final Component abbr;
|
||||
private final Component plural;
|
||||
|
||||
private final String tag;
|
||||
private final Component tag;
|
||||
|
||||
private final Component coloredTag;
|
||||
|
||||
private final ChatColor color;
|
||||
private final TextColor color;
|
||||
|
||||
private final org.bukkit.ChatColor teamColor;
|
||||
|
||||
private final boolean hasTeam;
|
||||
private final boolean hasDefaultLoginMessage;
|
||||
|
||||
Title(String article, String name, String plural, ChatColor color, org.bukkit.ChatColor teamColor, String tag, Boolean hasTeam, Boolean hasDefaultLoginMessage)
|
||||
Title(Component article, Component name, Component plural, TextColor color, org.bukkit.ChatColor teamColor, Component tag, Boolean hasTeam, Boolean hasDefaultLoginMessage)
|
||||
{
|
||||
this.article = article;
|
||||
this.name = name;
|
||||
this.plural = plural;
|
||||
this.coloredTag = generateColoredTag(color + tag);
|
||||
this.coloredTag = tag.color(color);
|
||||
this.abbr = tag;
|
||||
this.tag = "[" + tag + "]";
|
||||
this.tag = GroupProvider.OPEN.append(tag).append(GroupProvider.CLOSE);
|
||||
this.color = color;
|
||||
this.teamColor = teamColor;
|
||||
this.hasTeam = hasTeam;
|
||||
@ -49,9 +82,9 @@ public enum Title implements Displayable
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColoredName()
|
||||
public Component getColoredName()
|
||||
{
|
||||
return color + name;
|
||||
return name.color(color);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -67,37 +100,37 @@ public enum Title implements Displayable
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColoredLoginMessage()
|
||||
public Component getColoredLoginMessage()
|
||||
{
|
||||
return article + " " + color + name;
|
||||
return article.append(Component.text(" ").append(name.color(color)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArticle()
|
||||
public Component getArticle()
|
||||
{
|
||||
return article;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
public Component getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAbbr()
|
||||
public Component getAbbr()
|
||||
{
|
||||
return abbr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlural()
|
||||
public Component getPlural()
|
||||
{
|
||||
return plural;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag()
|
||||
public Component getTag()
|
||||
{
|
||||
return tag;
|
||||
}
|
||||
@ -109,7 +142,7 @@ public enum Title implements Displayable
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatColor getColor()
|
||||
public TextColor getColor()
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
Reference in New Issue
Block a user