1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

Fix checking for existing skins on Spigot (#362)

This commit is contained in:
Konicai
2022-10-27 15:10:22 -04:00
committed by GitHub
parent 49cf3a0a94
commit 90e9b1e3fc

View File

@@ -25,7 +25,6 @@
package org.geysermc.floodgate.pluginmessage;
import com.destroystokyo.paper.profile.ProfileProperty;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import com.mojang.authlib.properties.PropertyMap;
@@ -63,11 +62,16 @@ public final class SpigotSkinApplier implements SkinApplier {
return false;
}
for (ProfileProperty property : player.getPlayerProfile().getProperties()) {
if (property.getName().equals("textures")) {
if (!property.getValue().isEmpty()) {
return true;
}
GameProfile profile = ReflectionUtils.castedInvoke(player, ClassNames.GET_PROFILE_METHOD);
if (profile == null) {
throw new IllegalStateException("The GameProfile cannot be null! " + player.getName());
}
// Need to be careful here - getProperties() returns an authlib PropertyMap, which extends
// MultiMap from Guava. Floodgate relocates Guava.
for (Property textures : profile.getProperties().get("textures")) {
if (!textures.getValue().isEmpty()) {
return true;
}
}
return false;