Giter Site home page Giter Site logo

Comments (6)

Naruyoko avatar Naruyoko commented on September 28, 2024

Does this explain the apparent oscillation of the velocities?

from minecrafttassimulator.

Naruyoko avatar Naruyoko commented on September 28, 2024

Correction: the interval is 0.03125, although they don't seem to be always updated.
The code that seems to be responsible for this is inside net.minecraft.entity.EntityTrackerEntity#updatePlayerList(List<EntityPlayer>). In it, the positions are compressed into an int, where the unit is 1/32. The same thing happens to the rotations, where 360 degrees is mapped to 256 values.

from minecrafttassimulator.

Naruyoko avatar Naruyoko commented on September 28, 2024

The game plan is to send the entity's position and rotation encoded in the binary representation of double and float if that entity is recursively ridden by the player by listening to onPostWorldTick.

from minecrafttassimulator.

Naruyoko avatar Naruyoko commented on September 28, 2024

The "same" entity on the client and server side does not share their ids... Here are the possible ways:

  1. Instead of trying to send unconnected packets of data, send the position of the entity in the tower of riders. Cheaty and possibly unreliable?
  2. Figure out how client-side entities are synchronized with the server-side counterpart. This seems okay, but is it really necessary?

from minecrafttassimulator.

Naruyoko avatar Naruyoko commented on September 28, 2024

I found a way to go with option 2. It turns out the id by getEntityId is the same among the sides. So I can simply keep track of that.

from minecrafttassimulator.

Naruyoko avatar Naruyoko commented on September 28, 2024

Done! 8f1185b

from minecrafttassimulator.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.