mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-09 21:29:08 +01:00
Take the vehicle eye height into consideration
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
d8abdef1da
commit
22ead81ebe
@ -1188,9 +1188,13 @@ public class Entity implements Viewable, Tickable, TagHandler, PermissionHandler
|
||||
private void refreshCoordinate(Point newPosition) {
|
||||
if (hasPassenger()) {
|
||||
for (Entity passenger : getPassengers()) {
|
||||
passenger.position = passenger.position.withCoord(newPosition);
|
||||
passenger.previousPosition = passenger.position;
|
||||
passenger.refreshCoordinate(newPosition);
|
||||
final Pos oldPassengerPos = passenger.position;
|
||||
final Pos newPassengerPos = oldPassengerPos.withCoord(newPosition.x(),
|
||||
newPosition.y() + getEyeHeight(),
|
||||
newPosition.z());
|
||||
passenger.position = newPassengerPos;
|
||||
passenger.previousPosition = oldPassengerPos;
|
||||
passenger.refreshCoordinate(newPassengerPos);
|
||||
}
|
||||
}
|
||||
final Instance instance = getInstance();
|
||||
|
Loading…
Reference in New Issue
Block a user