aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-07-23 22:11:59 -0400
committerbowser0000 <bowser0000@gmail.com>2020-07-23 22:11:59 -0400
commit0f36b9862ce9d49c45e4bb53a913a37477181992 (patch)
treeafccbd48de6dfa68724bef0e285d1f12c5a7b4ae
parent286f10b9dfd86ebb336ffc18b76935d32c943158 (diff)
downloadSkyblockMod-0f36b9862ce9d49c45e4bb53a913a37477181992.tar.gz
SkyblockMod-0f36b9862ce9d49c45e4bb53a913a37477181992.tar.bz2
SkyblockMod-0f36b9862ce9d49c45e4bb53a913a37477181992.zip
Fix last_save profile values
Sometimes the last_save would rollover into the negatives, and would return null profile.
-rw-r--r--me/Danker/handlers/APIHandler.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/me/Danker/handlers/APIHandler.java b/me/Danker/handlers/APIHandler.java
index 006842b..67527b3 100644
--- a/me/Danker/handlers/APIHandler.java
+++ b/me/Danker/handlers/APIHandler.java
@@ -120,12 +120,12 @@ public class APIHandler {
// Loop through profiles to find latest
System.out.println("Looping through profiles...");
String latestProfile = "";
- int latestSave = 0;
+ long latestSave = 0;
JsonArray profilesArray = profilesResponse.get("profiles").getAsJsonArray();
for (JsonElement profile : profilesArray) {
JsonObject profileJSON = profile.getAsJsonObject();
- int profileLastSave = profileJSON.get("members").getAsJsonObject().get(UUID).getAsJsonObject().get("last_save").getAsInt();
+ long profileLastSave = profileJSON.get("members").getAsJsonObject().get(UUID).getAsJsonObject().get("last_save").getAsLong();
if (profileLastSave > latestSave) {
latestProfile = profileJSON.get("profile_id").getAsString();