Fix the fix that doesn't fix.

This commit is contained in:
Chayapak 2024-10-26 20:35:46 +07:00
parent 32c3801acf
commit 4142875c06

View file

@ -29,10 +29,12 @@ public class PlayersPersistentDataPlugin extends PlayersPlugin.Listener {
@Override @Override
public void playerJoined(PlayerEntry target) { public void playerJoined(PlayerEntry target) {
final JsonElement originalObject = playersObject.get(target.profile.getName());
final JsonObject object = new JsonObject(); final JsonObject object = new JsonObject();
object.addProperty("uuid", target.profile.getIdAsString()); object.addProperty("uuid", target.profile.getIdAsString());
if (!object.has("lastSeen")) object.add("lastSeen", new JsonObject()); if (originalObject != null && !originalObject.getAsJsonObject().has("lastSeen")) object.add("lastSeen", new JsonObject());
if (!object.has("ips")) object.add("ips", new JsonObject()); if (originalObject != null && !originalObject.getAsJsonObject().has("ips")) object.add("ips", new JsonObject());
final CompletableFuture<String> future = bot.players.getPlayerIP(target); final CompletableFuture<String> future = bot.players.getPlayerIP(target);