#Load player skulls without delay?

1 messages ยท Page 1 of 1 (latest)

steel spindle
#

Hey guys!

I've got some inventory menus which contain a bunch of player skulls (From uuid, not from a texture url). Everytime I open the inventory however there is a small delay where the skull has no texture.

Is there some way to get around this, perhaps by storing the texture in cache somewhere so it doesn't need to load the texture again every time?

Thanks! :D

hollow flint
#

If the skull is always the same, sure you can cache it

#

Something like a headdb or a minigame

steel spindle
#

My question is kinda how would I do that... I tried saving the SkullMeta everytime a new uuid was loaded to a hashmap... but when I grab that meta and apply it a different ItemStack it just shows a steve skin...

hollow flint
#

The skullmeta is linked to that specific item

#

Skulls internally grab the game profile from mojang's api

#

which can be done async

steel spindle
#

so what should I be storing in the hashmap then? :)

#

the game profile?

hollow flint
#

You need to cache each gameprofile and use some reflections to apply it

candid dust
#

commandgeek wow ok

#

this guy is a pro

steel spindle
hollow flint
#

Pros also ask for help sometimes

candid dust
steel spindle
#

I'll give the gameprofile a try and sees how it goes!

hollow flint
#

I've actually used one of your datapacks on a commission ๐Ÿ˜‹

candid dust
#

tried reflection and a few other things but ill have another look and see

#

Are you trying to load a GUI with these items? or give yoursef an item

steel spindle
#

GUI

candid dust
# steel spindle GUI

ah ok idk, maybe just load the GUI first, then open it to the play a couple ticks later?

dreamy blaze
#

you can fabricate custom game profiles right

#

then you can cache the texture of the player in there

#

and set tit

#

it

#

to your custom game profile

candid dust
#

not sure

dreamy blaze
#

and then load that into the skull

steel spindle
#

how do I get the texture of a player tho?

candid dust
#

it has the player and a custom one

dreamy blaze
#

maybe you can get it from the players original game profile

candid dust
#

utility thing

dreamy blaze
#

yeah and there get like the skin.texture property

#

or something

#

i dont know for sure

candid dust
#

first one is the reflection and the second is the utility

#

you can use getPlayerSkull(String playerName)

#

te reflection is only for the custom one so i dont thikn you will need it if you only use the getplayerskull method

steel spindle
#

Got it working, thanks guys!