Open dktapps opened 1 week ago
As for teleport()
, perhaps it should work like this:
Entity::teleport(Vector3, ?World = null)
Living::teleport(Vector3, ?World = null, ?LivingRotation = null)
Arrow::teleport(Vector3, ?World = null, ?SimpleRotation = null)
Painting::teleport(Vector3, ?World = null, ?HorizontalFacing = null)
These overloads should work fine if the proper hierarchies are used.
Description
This has been a thing at the network level for a long time, but never supported in the core code.
As seen in #4819 this raised some interesting issues around Location, since not all entities have a head, and therefore head yaw.
However, many entities also don't need basic yaw/pitch either (projectiles, dropped items, XP orbs, paintings), so it raises the question of whether
Location
should be rethought, considering that adding headYaw will probably break BC anyway.My current thought is that
Location
should probably be deleted altogether, or renamed. It's only really suited toLiving
inheritors, and many non-living entities either don't need rotation info (round projectiles, items, XP orbs), or use an entirely different mechanism for rotation (like paintings). Even the likes of arrows don't follow the expected rules for yaw/pitch despite using them.Possibly these instead:
SimpleRotation
- yaw, pitchLivingRotation
- yaw, pitch, headyawI leave this as an exercise for future developers.