Replies: 1 comment 1 reply
-
Use either one SkullMeta meta;
URI uri; // In the example is http://textures.minecraft.net/texture/98ced74a22021a535f6bce21c8c632b273dc2d9552b71a38d57269b3538cf
// Set both to actual values here
var profile = Bukkit.createProfile(new UUID(0, 0), "");
var textures = profile.getTextures();
textures.setSkin(uri.toURL());
profile.setTextures(textures);
meta.setPlayerProfile(profile); or SkullMeta meta;
String base64; // In the example is eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOThjZWQ3NGEyMjAyMWE1MzVmNmJjZTIxYzhjNjMyYjI3M2RjMmQ5NTUyYjcxYTM4ZDU3MjY5YjM1MzhjZiJ9fX0=
// Set both to actual values here
var profile = Bukkit.createProfile(new UUID(0, 0), "");
var property = new ProfileProperty("textures", base64);
// var property = new ProfileProperty("textures", base64, signature);
profile.setProperty(property);
meta.setPlayerProfile(profile); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem?
This feature request is related to the problem that it is -- as plugin developer -- unnecessarily difficult to set the texture of a player head to a signed texture, often I solve this using some reflection (which became more difficult in the later versions due to ResolvableProfile), but I think it'd be beneficial to all plugin to implement an more straight forward way to achieve this.
Describe the solution you'd like.
I'd introduce this in either one of the following ways, I'd be happy to hear some feedback if there're other ideas to achieve this!
Introduce a setTextureProperty method using the PlayerProperty class to directly set this textures tag of the skull, under the hood it can create a resolvable profile from a mock profile with this property set
Introduce a (private) setProfile(GameProfile) method so plugin developers can set the profile of a skull without having to use paperweight and only mojang authlib, they would still be required access this method with reflection however.
Describe alternatives you've considered.
Like listed above, an alternative would be to use lots of reflection and nowadays paperweight userdev to be able to create a resolvable profile.
Other
PS: if accepted I'd love to add this :D
Beta Was this translation helpful? Give feedback.
All reactions