diff --git a/src/main/java/org/samo_lego/simpleauth/storage/PlayerCache.java b/src/main/java/org/samo_lego/simpleauth/storage/PlayerCache.java index 9d4bb49..7986772 100644 --- a/src/main/java/org/samo_lego/simpleauth/storage/PlayerCache.java +++ b/src/main/java/org/samo_lego/simpleauth/storage/PlayerCache.java @@ -83,8 +83,13 @@ public class PlayerCache { logInfo("Creating cache for " + Objects.requireNonNull(player).getGameProfile().getName()); String json = DB.getUserData(fakeUuid); - // Parsing data from DB - PlayerCache playerCache = gson.fromJson(json, PlayerCache.class); + PlayerCache playerCache; + if(!json.isEmpty()) { + // Parsing data from DB + playerCache = gson.fromJson(json, PlayerCache.class); + } + else + playerCache = new PlayerCache(); if(player != null) { // Setting position cache playerCache.lastLocation.dimension = player.getServerWorld();