Slimefun / dough

Library containing a lot of useful utility classes for the everyday Java and Spigot/Paper developer.
MIT License
32 stars 31 forks source link

Make CustomGameProfile public and add a getBase64Texture to fix Slimefun4#4071 #240

Closed WalshyDev closed 10 months ago

WalshyDev commented 10 months ago

Allows fixing https://github.com/Slimefun/Slimefun4/issues/4071

In GitHubTask we're doing Optional<String> skin = Optional.of(future.get().toString()); where future.get() returns PlayerSkin. However, PlayerSkin does not have a toString() function and therefore this was resulting in the normal Object#toString meaning skin was like io.github.thebusybiscuit.slimefun4.libraries.dough.skins.PlayerSkin@abcdef123 instead of the base64 texture.

This update allows us to get the CustomGameProfile from the PlayerSkin (function made available here: https://github.com/baked-libs/dough/commit/08722d5b889632fbc5d22f31508a2fec424dc112) and we can now do getBase64Texture to grab the needed texture.

Slimefun PR pending dough merge: https://github.com/Slimefun/Slimefun4/pull/4072