From 4142875c06e430bd66d03537c2c91a4eec7b69f8 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 26 Oct 2024 20:35:46 +0700 Subject: [PATCH] Fix the fix that doesn't fix. --- .../chomens_bot/plugins/PlayersPersistentDataPlugin.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/PlayersPersistentDataPlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/PlayersPersistentDataPlugin.java index a401e0b..f5d9a56 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/PlayersPersistentDataPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/PlayersPersistentDataPlugin.java @@ -29,10 +29,12 @@ public class PlayersPersistentDataPlugin extends PlayersPlugin.Listener { @Override public void playerJoined(PlayerEntry target) { + final JsonElement originalObject = playersObject.get(target.profile.getName()); + final JsonObject object = new JsonObject(); object.addProperty("uuid", target.profile.getIdAsString()); - if (!object.has("lastSeen")) object.add("lastSeen", new JsonObject()); - if (!object.has("ips")) object.add("ips", new JsonObject()); + if (originalObject != null && !originalObject.getAsJsonObject().has("lastSeen")) object.add("lastSeen", new JsonObject()); + if (originalObject != null && !originalObject.getAsJsonObject().has("ips")) object.add("ips", new JsonObject()); final CompletableFuture future = bot.players.getPlayerIP(target);