Posted July 13, 20169 yr 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?
July 13, 20169 yr 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.
July 13, 20169 yr Author 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?
July 13, 20169 yr 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.
July 15, 20169 yr Author I got the model now, but is there even any way I could render the player skin on the item, because I would need a TextureAtlasSprite for it.
July 15, 20169 yr 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.
July 22, 20169 yr Author 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.