mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fixed bugs that could occur while updating old DBs to have UUIDs
This commit is contained in:
parent
588b6f3692
commit
23b7e11dd1
@ -1,3 +1,6 @@
|
|||||||
|
Version 2.1.55
|
||||||
|
Fixed a bug that could occur when adding UUIDs to old outdated DBs
|
||||||
|
|
||||||
Version 2.1.54
|
Version 2.1.54
|
||||||
Fixed a bug where the Skill 'Understanding the Art' was preventing vanilla experience orbs from furnaces
|
Fixed a bug where the Skill 'Understanding the Art' was preventing vanilla experience orbs from furnaces
|
||||||
Fixed 'Understanding the Art' not correctly boosting vanilla XP from furnaces
|
Fixed 'Understanding the Art' not correctly boosting vanilla XP from furnaces
|
||||||
|
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||||
<artifactId>mcMMO</artifactId>
|
<artifactId>mcMMO</artifactId>
|
||||||
<version>2.1.54</version>
|
<version>2.1.55</version>
|
||||||
<name>mcMMO</name>
|
<name>mcMMO</name>
|
||||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||||
<scm>
|
<scm>
|
||||||
|
@ -68,6 +68,8 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable {
|
|||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
// Handle 429
|
// Handle 429
|
||||||
|
if(e.getMessage() != null)
|
||||||
|
{
|
||||||
if (e.getMessage().contains("429")) {
|
if (e.getMessage().contains("429")) {
|
||||||
size += userNamesSection.size();
|
size += userNamesSection.size();
|
||||||
try {
|
try {
|
||||||
@ -78,6 +80,7 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
plugin.getLogger().log(Level.SEVERE, "Unable to fetch UUIDs!", e);
|
plugin.getLogger().log(Level.SEVERE, "Unable to fetch UUIDs!", e);
|
||||||
return;
|
return;
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package com.gmail.nossr50.util.uuid;
|
package com.gmail.nossr50.util.uuid;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonPrimitive;
|
import com.google.gson.JsonPrimitive;
|
||||||
|
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@ -43,10 +45,13 @@ public class UUIDFetcher implements Callable<Map<String, UUID>> {
|
|||||||
array.add(element);
|
array.add(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
String body = array.getAsString();
|
Gson gson = new Gson();
|
||||||
|
String body = array.toString();
|
||||||
|
|
||||||
writeBody(connection, body);
|
writeBody(connection, body);
|
||||||
for (Object profile : array) {
|
JsonObject[] jsonStreamArray = gson.fromJson(new InputStreamReader(connection.getInputStream()), JsonObject[].class);
|
||||||
JsonObject jsonProfile = (JsonObject) profile;
|
|
||||||
|
for (JsonObject jsonProfile : jsonStreamArray) {
|
||||||
String id = jsonProfile.get("id").getAsString();
|
String id = jsonProfile.get("id").getAsString();
|
||||||
String name = jsonProfile.get("name").getAsString();
|
String name = jsonProfile.get("name").getAsString();
|
||||||
UUID uuid = UUIDFetcher.getUUID(id);
|
UUID uuid = UUIDFetcher.getUUID(id);
|
||||||
|
Loading…
Reference in New Issue
Block a user