hypherionmc / simple-rpc-public

Simple-RPC Issues, wiki and data github
https://www.curseforge.com/minecraft/mc-mods/simple-discord-rpc/
14 stars 1 forks source link

[Suggestion] A new variable that replaces itself with the player UUID #36

Closed Socketlike closed 2 years ago

Socketlike commented 2 years ago

Is your feature request related to a problem? Please describe. My feature request is not related to a problem

Describe the solution you'd like Add a new variable that replaces itself with the player UUID so that it can be used with Crafatar (or other image APIs) for presence image keys Ex: smallImageKey = "https://crafatar.com/avatars/%playeruuid%.png"

Describe alternatives you've considered None

Additional context None

hypherionmc commented 2 years ago

We do have a built in variable that allows you to use the player head as an image.

%playerhead%. I could expose more options to change what type of skin is returned from the API

Socketlike commented 2 years ago

I couldn't really figure out how to use %playerhead%, could you explain how it works?

hypherionmc commented 2 years ago

You place it inside your config, in one of the imageKeys, and it automatically pulls the player head from gravatar. So basically, this: https://crafatar.com/avatars/%playeruuid%.png but it's all done internally so you don't need to include the URL as well

Socketlike commented 2 years ago

Thank you for the speedy reply! However it just doesn't work for some reason. I'm pretty sure I did it right https://www.toptal.com/developers/hastebin/raw/iqocapiqay Verified it with TOML Lint as well

hypherionmc commented 2 years ago

Hmmm sounds like a bug then. Which Game Version and Mod version are you using?

Socketlike commented 2 years ago

I am using Minecraft 1.18.2 with Fabric version 0.14.7 Mod version is 3.0.1

hypherionmc commented 2 years ago

Let me get one of our devs to check this out. Definitely sounds like it's not returning the url format correctly internally

Socketlike commented 2 years ago

Thank you very much c:

Socketlike commented 2 years ago

Let me get one of our devs to check this out. Definitely sounds like it's not returning the url format correctly internally

I've just realized that if I join a world / server / realms the %playerhead% variable returns the correct value Not in the title screen or anywhere else

hypherionmc commented 2 years ago

Huh. Thanks for the feedback. I think I know what the problem is.... I never allowed that variable to be used everywhere

Socketlike commented 2 years ago

I never allowed that variable to be used everywhere

Is there a specific reason why?

hypherionmc commented 2 years ago

No reason, just an oversight on my part. Actually this is a bug... It's pulling the UUID of the player, from the actual player instead of the game profile, which means, outside of a world, the player would be null and the UUID won't resolve