Jump to content

[1.8] Having some more modeling issues -.-


NovaViper

Recommended Posts

Nvm that post, for the entity's bounding box to update, how do I let the client know that I am changing the entity's bounding box? Should I send a packet to the client via packethandler?

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

  • Replies 78
  • Created
  • Last Reply

Top Posters In This Topic

Depends - is your 'evolution stage' or whatever stored in DataWatcher?

 

If so, the client already knows about it and you can just set the bounding box on both sides.

 

If not, then you'll need to tell the client what stage the entity is at so it can set the bounding box.

 

One way to do that is custom packets; another is to use worldObj.setEntityState(this, some_byte_flag) which automatically sends a packet for you and that packet calls your entity's handleHealthUpdate(some_byte_flag) method. This is the method wolves and other animals use to spawn hearts when in love, villagers use to spawn various particles, and even golems use this to initiate their attack animation.

 

So you could define some byte flags, e.g. FIRST_STAGE = 5, FINAL_STAGE = 6, and send those via the entity state. Just take a look at every class that your entity inherits from to make sure you are not duplicating any byte flags. Won't cause any critical bugs if you don't (unlike DataWatcher indices), but it's better to check.

Link to comment
Share on other sites

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.