- Add unmute & mute and some checks as well as fix prefix bug

This commit is contained in:
Taah
2022-02-25 00:59:48 -08:00
parent bc461ee870
commit 1b856db297
12 changed files with 197 additions and 5 deletions

View File

@ -2,6 +2,8 @@ package dev.plex.rank.enums;
import lombok.Getter;
import lombok.Setter;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.ChatColor;
import org.json.JSONObject;
@ -39,6 +41,11 @@ public enum Rank
return this.level >= rank.getLevel();
}
public String getPrefix()
{
return MiniMessage.miniMessage().serialize(LegacyComponentSerializer.legacyAmpersand().deserialize(this.prefix));
}
public JSONObject toJSON()
{
JSONObject object = new JSONObject();

View File

@ -2,6 +2,8 @@ package dev.plex.rank.enums;
import lombok.Getter;
import lombok.Setter;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.ChatColor;
import org.json.JSONObject;
@ -31,6 +33,11 @@ public enum Title
this.prefix = prefix;
}
public String getPrefix()
{
return MiniMessage.miniMessage().serialize(LegacyComponentSerializer.legacyAmpersand().deserialize(this.prefix));
}
public JSONObject toJSON()
{
JSONObject object = new JSONObject();