3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-27 08:30:12 +01:00

Fix regression in properties get

Dieser Commit ist enthalten in:
Camotoy 2024-06-26 22:35:54 -04:00
Ursprung add02cadd7
Commit db9b951352
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
4 geänderte Dateien mit 24 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -57,4 +57,14 @@ public class GeyserCustomSkullConfiguration {
public List<String> getPlayerSkinHashes() {
return Objects.requireNonNullElse(skinHashes, Collections.emptyList());
}
@Override
public String toString() {
return "GeyserCustomSkullConfiguration{" +
"playerUsernames=" + playerUsernames +
", playerUUIDs=" + playerUUIDs +
", playerProfiles=" + playerProfiles +
", skinHashes=" + skinHashes +
'}';
}
}

Datei anzeigen

@ -65,6 +65,7 @@ public class CustomSkullRegistryPopulator {
Path skullConfigPath = bootstrap.getConfigFolder().resolve("custom-skulls.yml");
File skullConfigFile = FileUtils.fileOrCopiedFromResource(skullConfigPath.toFile(), "custom-skulls.yml", Function.identity(), bootstrap);
skullConfig = FileUtils.loadConfigNew(skullConfigFile, GeyserCustomSkullConfiguration.class);
System.out.println(skullConfig);
} catch (IOException e) {
GeyserImpl.getInstance().getLogger().severe(GeyserLocale.getLocaleStringLog("geyser.config.failed"), e);
return;

Datei anzeigen

@ -27,6 +27,7 @@ package org.geysermc.geyser.skin;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import it.unimi.dsi.fastutil.bytes.ByteArrays;
@ -487,12 +488,12 @@ public class SkinProvider {
return CompletableFuture.supplyAsync(() -> {
try {
JsonObject node = WebUtils.getJson("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid);
JsonObject properties = node.getAsJsonObject("properties");
JsonArray properties = node.getAsJsonArray("properties");
if (properties == null) {
GeyserImpl.getInstance().getLogger().debug("No properties found in Mojang response for " + uuid);
return null;
}
return node.getAsJsonArray("properties").get(0).getAsJsonObject().get("value").getAsString();
return properties.get(0).getAsJsonObject().get("value").getAsString();
} catch (Exception e) {
GeyserImpl.getInstance().getLogger().debug("Unable to request textures for " + uuid);
if (GeyserImpl.getInstance().getConfig().isDebugMode()) {
@ -514,6 +515,7 @@ public class SkinProvider {
try {
// Offline skin, or no present UUID
JsonObject node = WebUtils.getJson("https://api.mojang.com/users/profiles/minecraft/" + username);
System.out.println(node);
JsonElement id = node.get("id");
if (id == null) {
GeyserImpl.getInstance().getLogger().debug("No UUID found in Mojang response for " + username);

Datei anzeigen

@ -296,6 +296,15 @@ public final class AssetUtils {
@SerializedName("url")
private String url;
@Override
public String toString() {
return "VersionDownload{" +
"sha1='" + sha1 + '\'' +
", size=" + size +
", url='" + url + '\'' +
'}';
}
}
@Getter