Skip to content

Commit

Permalink
fix error in gameprofilebuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-naegele committed Jan 14, 2024
1 parent f8776aa commit 761f4c1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion missilewars-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>1.5.25</version>
<version>4.0.43</version>
<scope>provided</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void onRecommendations(CommandSender sender, String[] args) {
}
// TODO implement more features

if (recommendations.size() == 0) {
if (recommendations.isEmpty()) {
player.sendMessage(Messages.getPrefix() + "§aThere are currently no recommendations, everything seems fine :)");
} else {
player.sendMessage(Messages.getPrefix() + "§7=====[ §eMissileWars recommendations §7]=====");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,32 @@

package de.butzlabben.missilewars.util.stats;

import com.google.gson.*;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import com.mojang.authlib.properties.PropertyMap;
import com.mojang.util.UUIDTypeAdapter;
import lombok.Getter;
import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import lombok.Getter;
import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder;

/**
* @author Butzlabben
Expand All @@ -59,7 +70,7 @@ public static GameProfile fetch(UUID uuid, boolean forceNew) throws IOException
}

String json = getText(String.format("https://sessionserver.mojang.com/session/minecraft/profile/%s?unsigned=false",
UUIDTypeAdapter.fromUUID(uuid)));
uuid.toString().replace("-", "")));

try {
GameProfile result = gson.fromJson(json, GameProfile.class);
Expand All @@ -80,7 +91,7 @@ public static GameProfile getProfile(UUID uuid, String name, String skinUrl, Str

List<Object> args = new ArrayList<>();
args.add(System.currentTimeMillis());
args.add(UUIDTypeAdapter.fromUUID(uuid));
args.add(uuid.toString().replaceAll("-", ""));
args.add(name);
args.add(skinUrl);
if (cape) {
Expand Down

0 comments on commit 761f4c1

Please sign in to comment.