refactor: getOrDefault in PersistentDataUtilities
This commit is contained in:
@@ -14,16 +14,10 @@ import net.kyori.adventure.text.format.NamedTextColor;
|
||||
public class MailPlugin extends PlayersPlugin.Listener {
|
||||
private final Bot bot;
|
||||
|
||||
public static JsonArray mails = new JsonArray();
|
||||
public static JsonArray mails = PersistentDataUtilities.getOrDefault("mails", new JsonArray()).getAsJsonArray();
|
||||
|
||||
private final Gson gson = new Gson();
|
||||
|
||||
static {
|
||||
if (PersistentDataUtilities.has("mails")) {
|
||||
mails = PersistentDataUtilities.get("mails").getAsJsonArray();
|
||||
}
|
||||
}
|
||||
|
||||
public MailPlugin (Bot bot) {
|
||||
this.bot = bot;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user