Skip to content

Commit c145c3f

Browse files
Fix: Don't include player offset when querying player position in the api (#5168)
1 parent 47b68f8 commit c145c3f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

api/src/main/java/org/geysermc/geyser/api/entity/type/player/GeyserPlayerEntity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
public interface GeyserPlayerEntity extends GeyserEntity {
3232

3333
/**
34-
* Gets the position of the player.
34+
* Gets the position of the player, as it is known to the Java server.
3535
*
36-
* @return the position of the player.
36+
* @return the player's position
3737
*/
3838
Vector3f position();
3939
}

core/src/main/java/org/geysermc/geyser/entity/type/player/PlayerEntity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ public class PlayerEntity extends LivingEntity implements GeyserPlayerEntity {
9797
/**
9898
* Saves the parrot currently on the player's left shoulder; otherwise null
9999
*/
100-
private ParrotEntity leftParrot;
100+
private @Nullable ParrotEntity leftParrot;
101101
/**
102102
* Saves the parrot currently on the player's right shoulder; otherwise null
103103
*/
104-
private ParrotEntity rightParrot;
104+
private @Nullable ParrotEntity rightParrot;
105105

106106
public PlayerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, Vector3f position,
107107
Vector3f motion, float yaw, float pitch, float headYaw, String username, @Nullable String texturesProperty) {
@@ -450,6 +450,6 @@ public UUID getTabListUuid() {
450450

451451
@Override
452452
public Vector3f position() {
453-
return this.position.clone();
453+
return this.position.down(definition.offset());
454454
}
455455
}

0 commit comments

Comments
 (0)