Jump to content

Recommended Posts

Posted

The Player Logged In Event gives an player entity as part of the event, but I need it as an Abstract Client Player a cast does not work is there a where I can this.

 

Or is there another way to get player in question

Posted

Why do you need AbstractClientPlayer specifically? That is a CLIENT side only class, for one, so you'll want to check side before you check for instanceof, and the possible actual classes could be either EntityOtherPlayerMP or EntityPlayerSP... neither of which seem particularly useful.

 

What are you trying to do, and what have you tried?

Posted

Allow the player to change there skin in game and to visible to every one on the server and the player's skin is defined in the AbstractClientPlayer yes EntityOtherPlayerMP or EntityPlayerSP could work but i believe the best way to go about is to use the AbstractClientPlayer.

 

Also the event is wired up in client proxy so is just running on the client side

Posted

Skins are entirely client side. So only people who have your mod installed can see any potentially changed skin.

 

I see you point but mod allows the change of player via i wardrobe which will loaded on the server.

Posted

Every client-sided EntityPlayer is an instance of AbstractClientPlayer (meaning you can freerly cast it, as long as you are on client thread and do it via proxy, since it is client side class). ACP does NOT exist on server thread.

 

To give you wider look - click on EntityPlayer and choose "Type Hierarchy". ACP is base of all client-sided players, EntityPlayerMP for all server-sided ones.

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

Posted

I know the skin is client size but how do i get the abstract client player from an entity player?

 

Use the EntityJoinWorldEvent and check the instance of the entity there compared to the AbstractClientPlayer. Then cast the event.entity to AbstractClientPlayer and do whatever you need.

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

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.