Jump to content

Recommended Posts

Posted

I want to make an Item the binds to a player on right-click. So far so good, I got that but now I want to render the face of the bound player on it.

Is it possible in 1.10 to render an item like this, since there is no IItemRenderer anymore?

Posted

This is probably possible with a custom model, though the asynchronous nature of skin downloading may make things tricky.

 

You'll need an

ICustomModelLoader

,

IModel

and

ItemOverridesList

for your model. I don't know of any tutorials on these, but there are several examples in Forge itself.

 

diesieben07 talks about a custom model in this thread, though it was for 1.8.9 so things are slightly different now.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Thanks for the link.

 

But I basically want to be able to change that texture at runtime, aren't models only loaded at the start of the game, or can they change during runtime? If not, could I reload a single model?

Posted

Models can be generated on demand and cached. I suggest looking at

ModelDynBucket

, it uses an

ItemOverridesList

to generate a model with the texture of the

Fluid

contained in the bucket.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

I'm not entirely sure about that part.

 

I think the skin texture will be added to the texture atlas if you override

IModel#getTextures

to return it, you can then use the

bakedTextureGetter

argument in your override of

IModel#bake

to get the

TextureAtlasSprite

.

 

You can probably create and store an instance of

NetworkPlayerInfo

in your

IModel

's constructor, creating a

GameProfile

from the

IModel

's

UUID

. Use

NetworkPlayerInfo#getLocationSkin

to get the

ResourceLocation

of the skin texture. If you call this early (e.g. in the constructor), the skin should be downloaded in the background and may be available by the time the texture atlas is created.

 

 

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
If you call this early (e.g. in the constructor), the skin should be downloaded in the background and may be available by the time the texture atlas is created.

 

And there lies the problem again, the texture atlas is only constructed if the whole texture manager is reloaded.

 

I think it is basically not possible to render a changing player skin on an item. It would have to be a specific skin that will not change, which is not what I want.

 

I will work on another neat effect, that isn't as complicated as this.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.