Jump to content

Yun-L

Members
  • Posts

    1
  • Joined

  • Last visited

Yun-L's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I'm currently working on a mod that adds in vehicles that players can ride and control with keyboard inputs. I've been looking at the `BoatEntity` code in vanilla Minecraft as reference but have been struggling to understand how motion is handled. For example, in `BoatEntity::tick` when a player is riding a boat, motion is updated on both the client side and server side with `BoatEntity::updateMotion` but then updated again only on the client side with `BoatEntity::controlBoat`. The logic seems like it would cause motion to desync between the client and server because the client side motion may include different values set in `BoatEntity::controlBoat`. Since this is code from vanilla Minecraft, I don't have much reason to think this is an error so it's not obvious to me why this works. Does anyone have an explanation for how entity motion logic is supposed to be handled? Thanks in advance for any help provided. Also, I just assumed that I'm not allowed to paste any of the vanilla Minecraft code in this post so I hope the MCP method names are good enough to reference anyone to the code I'm talking about.
×
×
  • Create New...

Important Information

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