mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-21 05:42:20 +00:00
feat: rename enum AuthlibField
This commit is contained in:
1 parent
9a55a4c615
commit
119892489f
4 files changed
+10
-12
No files matched your search
@@ -163,8 +163,8 @@ public class MojangAPILoader implements ICustomSkinLoaderPlugin, ProfileLoader.I
|
||||
|
||||
Gson gson = new GsonBuilder().registerTypeAdapter(UUID.class, new UUIDTypeAdapter()).registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer()).create();
|
||||
MinecraftProfilePropertiesResponse propertiesResponce = gson.fromJson(responce.content, MinecraftProfilePropertiesResponse.class);
|
||||
GameProfile newGameProfile = new GameProfile(TextureUtil.AuthlibField.MINECRAFTPROFILEPROPERTIESRESPONSE_ID.get(propertiesResponce), TextureUtil.AuthlibField.MINECRAFTPROFILEPROPERTIESRESPONSE_NAME.get(propertiesResponce));
|
||||
newGameProfile.getProperties().putAll(TextureUtil.AuthlibField.MINECRAFTPROFILEPROPERTIESRESPONSE_PROPERTIES.get(propertiesResponce));
|
||||
GameProfile newGameProfile = new GameProfile(TextureUtil.AuthlibField.MINECRAFT_PROFILE_PROPERTIES_RESPONSE_ID.get(propertiesResponce), TextureUtil.AuthlibField.MINECRAFT_PROFILE_PROPERTIES_RESPONSE_NAME.get(propertiesResponce));
|
||||
newGameProfile.getProperties().putAll(TextureUtil.AuthlibField.MINECRAFT_PROFILE_PROPERTIES_RESPONSE_PROPERTIES.get(propertiesResponce));
|
||||
|
||||
return newGameProfile;
|
||||
}
|
||||
@@ -185,10 +185,10 @@ public class MojangAPILoader implements ICustomSkinLoaderPlugin, ProfileLoader.I
|
||||
Gson gson = new GsonBuilder().registerTypeAdapter(UUID.class, new UUIDTypeAdapter()).create();
|
||||
MinecraftTexturesPayload result = gson.fromJson(json, MinecraftTexturesPayload.class);
|
||||
|
||||
if (result == null || TextureUtil.AuthlibField.MINECRAFTTEXTURESPAYLOAD_TEXTURES.get(result) == null) {
|
||||
if (result == null || TextureUtil.AuthlibField.MINECRAFT_TEXTURES_PAYLOAD_TEXTURES.get(result) == null) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return TextureUtil.AuthlibField.MINECRAFTTEXTURESPAYLOAD_TEXTURES.get(result);
|
||||
return TextureUtil.AuthlibField.MINECRAFT_TEXTURES_PAYLOAD_TEXTURES.get(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,10 +2,8 @@ package customskinloader.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import com.mojang.authlib.yggdrasil.response.MinecraftProfilePropertiesResponse;
|
||||
import com.mojang.authlib.yggdrasil.response.MinecraftTexturesPayload;
|
||||
@@ -43,10 +41,10 @@ public class TextureUtil {
|
||||
// resulting in changes to method names, so reflection is used here to be compatible with these changes.
|
||||
public enum AuthlibField {
|
||||
PROPERTY_VALUE_FIELD(Property.class, "value"),
|
||||
MINECRAFTPROFILEPROPERTIESRESPONSE_ID(MinecraftProfilePropertiesResponse.class, "id"),
|
||||
MINECRAFTPROFILEPROPERTIESRESPONSE_NAME(MinecraftProfilePropertiesResponse.class, "name"),
|
||||
MINECRAFTPROFILEPROPERTIESRESPONSE_PROPERTIES(MinecraftProfilePropertiesResponse.class, "properties"),
|
||||
MINECRAFTTEXTURESPAYLOAD_TEXTURES(MinecraftTexturesPayload.class, "textures");
|
||||
MINECRAFT_PROFILE_PROPERTIES_RESPONSE_ID(MinecraftProfilePropertiesResponse.class, "id"),
|
||||
MINECRAFT_PROFILE_PROPERTIES_RESPONSE_NAME(MinecraftProfilePropertiesResponse.class, "name"),
|
||||
MINECRAFT_PROFILE_PROPERTIES_RESPONSE_PROPERTIES(MinecraftProfilePropertiesResponse.class, "properties"),
|
||||
MINECRAFT_TEXTURES_PAYLOAD_TEXTURES(MinecraftTexturesPayload.class, "textures");
|
||||
|
||||
private final Field field;
|
||||
|
||||
|
||||
Reference in new issue
Block a user