use of org.dragonet.common.data.entity.Skin.Cape in project DragonProxy by DragonetMC.
the class SkinFetcher method getPlayerProfile.
private PlayerProfile getPlayerProfile(GameProfile gameProfile) {
try {
return profilesCache.get(gameProfile.getId(), () -> {
Property property = getProfileProperty(gameProfile.getId());
System.out.println(property.toString());
Skin skin = Skin.DEFAULT_SKIN_STEVE;
if (gameProfile.getTextures().containsKey(GameProfile.TextureType.SKIN)) {
System.out.println(gameProfile.getTexture(GameProfile.TextureType.SKIN).getURL());
System.out.println(Skin.getModelFromJava(gameProfile.getTexture(GameProfile.TextureType.SKIN).getModel()));
skin = new Skin(new URL(gameProfile.getTexture(GameProfile.TextureType.SKIN).getURL()), Skin.getModelFromJava(gameProfile.getTexture(GameProfile.TextureType.SKIN).getModel()));
}
if (gameProfile.getTextures().containsKey(GameProfile.TextureType.CAPE))
skin.setCape(skin.new Cape(new URL(gameProfile.getTexture(GameProfile.TextureType.CAPE).getURL())));
PlayerProfile profile = new PlayerProfile(gameProfile.getId(), property, skin);
if (property != null) {
// profilesCache.put(gameProfile.getId(), profile);
return profile;
}
return null;
});
} catch (CacheLoader.InvalidCacheLoadException | ExecutionException ex) {
return null;
}
}
Aggregations