Skip to content
This repository has been archived by the owner on May 18, 2020. It is now read-only.

Failed to set SkinUrl of empty Skin #63

Open
higgs01 opened this issue Jul 1, 2018 · 3 comments
Open

Failed to set SkinUrl of empty Skin #63

higgs01 opened this issue Jul 1, 2018 · 3 comments

Comments

@higgs01
Copy link

higgs01 commented Jul 1, 2018

Hello

When i try to set the Skin-Url from a Empty skin:

ItemStack is = new ItemStack(Material.SKULL_ITEM, 1, (short) 3) {
    @Override
    public void click(Click click) {

    }
};
SkullMeta meta = (SkullMeta) is.getItemMeta();
meta.setDisplayName(ProxyServer.getInstance().getPlayer(clientProfile.getLastName()) == null ? "§7" + clientProfile.getLastName() : "§6" + clientProfile.getLastName());
Skin skin = SkinFactory.createEmptySkin();
skin.setSkin(clientProfile.getTexture());
meta.setSkin(skin);

I get following error:

09:06:11 [SCHWERWIEGEND] Caused by: org.json.JSONException: JSONObject["textures"] not found.
09:06:11 [SCHWERWIEGEND]     at org.json.JSONObject.get(JSONObject.java:471)
09:06:11 [SCHWERWIEGEND]     at org.json.JSONObject.getJSONObject(JSONObject.java:636)
09:06:11 [SCHWERWIEGEND]     at dev.wolveringer.bungeeutil.profile.Skin.setSkin(Skin.java:207)
09:06:11 [SCHWERWIEGEND]     at my.own.package.FriendsGui.createPlayerSkull(FriendsGui.java:76)
09:06:11 [SCHWERWIEGEND]     at my.own.package.FriendsGui.buildGui(FriendsGui.java:40)
09:06:11 [SCHWERWIEGEND]     at my.own.package.FriendsGui.<init>(FriendsGui.java:31)
09:06:11 [SCHWERWIEGEND]     at my.own.package.FriendCommandList.onFriend(FriendCommandList.java:154)
09:06:11 [SCHWERWIEGEND]     ... 46 more

BungeeUtils-Version: 2.6.1
BungeeCord-Version: 1.12.-SNAPSHOT

@kaerns
Copy link
Contributor

kaerns commented Jul 7, 2018

well makes sense that you can't have an skin without texture. if you want to set a steve-skin then you should get the actual texture for it and set it.

@WolverinDEV
Copy link
Owner

Hmm well I'm a little bit Co fused why the empty skin does not contains these properties.
Well Im currently really buissy so it may take a bit of time before I research and fix this

@kaerns
Copy link
Contributor

kaerns commented Jul 7, 2018

maybe found the reason:
put "value" instead of "textures" as key: https://github.com/WolverinDEV/BungeeUtil/blob/2.0/src/main/java/dev/wolveringer/bungeeutil/profile/Skin.java#L205

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants