Jump to content

Recommended Posts

Posted

I want to make a mod that allows the user to change there skin game (well looks likes to to them and other players), my idea that a player one skin which just there players head and hands and that get combined with an outfit skin, and then mod makes it look like that is the player skins to every one on the sever/multiplayer world. What i am asking is who to give the appearance that the player skin has been changed.

Posted

Make sure when using the RenderPlayerEvent, use the subclasses pre and post. The RenderPlayerEvent class itself is abstract I believe, and only its subclasses are properly called - just something to look out for. To the other modders - no it isn't deprecated, it is not marked as deprecated (if I'm wrong, feel encouraged to correct me).

@SubscribeEvent
public void renderPlayerEvent(RenderPlayerEvent.Pre event)
{
    //do your rendering / skin loading here
}

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

Posted

Just confirm the RenderPlayerEvent will render my skins over the top of original and not replace? that is fine but I am think will they come above armour, if it does it could be a problem.

 

P.S.

A example of how the RenderPlayerEvent works would go a long way in helping understand how to use my self.

Posted

Player's model and any other (maybe not all, I think dragon has few) model as you know it (vanilla) takes only one texture in consideration.

It will then use this particular ResourceLocation and grab u/v coordinates from it which then will be placed onto model.

 

Changing player's skin can be done in client-sided cache map which can be accessed via AbstractClientPlayer (you will need to dig deep and long and most likely use reflection).

 

Aside from that - it will still give you one .png file. As i understand - you want to put player's texture from parts. In that case you will need to generate dynamic image. This is purely Java stuff - go goole it.

 

This above would work like:

1. Gather few textures based on EntityPlayer

2. Blend them together into skin.png

3. Place skin.png into player's skin location

4. Lock skin-change (vanilla will try to override it)

Above is how it can be done using vanilla itself.

 

Other way is to totally ignore vanilla - in that case - indeed - you will use RenderPlayerEvent - cancel normal rendering (event.setCanceled(true)) and then render totally different model (custom copy of ModelBiped) that will accept few textures instead of one, or like proposed previously - will take one texture that is put together from parts.

 

Note: If you want to save textures per-player you can utilize IExtendedEntityProperties.

 

P.S - What I know is based off mod I made in 1.6.4 that was setting players' skins from server (not mojang). I never updated (and i plan to) because in 1.7 they added skin-caching, which gave me code-headache, so I postponed update.

1.7.10 is no longer supported by forge, you are on your own.

Posted

Aside from that - it will still give you one .png file. As i understand - you want to put player's texture from parts. In that case you will need to generate dynamic image. This is purely Java stuff - go goole it.

 

I already have code that should cover this

but it comes to Minecraft modding i do not know that much, i will look deeper in the RenderPlayerEvent see what i can find.

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.