mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-10 05:39:11 +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) {
|
private void refreshCoordinate(Point newPosition) {
|
||||||
if (hasPassenger()) {
|
if (hasPassenger()) {
|
||||||
for (Entity passenger : getPassengers()) {
|
for (Entity passenger : getPassengers()) {
|
||||||
passenger.position = passenger.position.withCoord(newPosition);
|
final Pos oldPassengerPos = passenger.position;
|
||||||
passenger.previousPosition = passenger.position;
|
final Pos newPassengerPos = oldPassengerPos.withCoord(newPosition.x(),
|
||||||
passenger.refreshCoordinate(newPosition);
|
newPosition.y() + getEyeHeight(),
|
||||||
|
newPosition.z());
|
||||||
|
passenger.position = newPassengerPos;
|
||||||
|
passenger.previousPosition = oldPassengerPos;
|
||||||
|
passenger.refreshCoordinate(newPassengerPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final Instance instance = getInstance();
|
final Instance instance = getInstance();
|
||||||
|
Loading…
Reference in New Issue
Block a user