PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
10.03k stars 2.33k forks source link

Player vs OfflinePlayer getBedSpawnLocation #7860

Open Machine-Maker opened 2 years ago

Machine-Maker commented 2 years ago

Expected behavior

When calling getBedSpawnLocation on an instance of CraftPlayer or CraftOfflinePlayer the result should be the same (or the discrepancy should be documented and predictable)

Observed/Actual behavior

They are different as shown here

test
[16:05:20 INFO]: [Paper-Test-Plugin] [STDOUT] online: true
[16:05:20 INFO]: [Paper-Test-Plugin] [STDOUT] spawn: Location{world=CraftWorld{name=world_nether},x=-7.5,y=89.0,z=-18.5,pitch=0.0,yaw=0.0}
[16:05:22 INFO]: Machine_Maker lost connection: Disconnected
[16:05:22 INFO]: Machine_Maker left the game
test
[16:05:27 INFO]: [Paper-Test-Plugin] [STDOUT] online: false
[16:05:27 INFO]: [Paper-Test-Plugin] [STDOUT] spawn: Location{world=CraftWorld{name=world_nether},x=-8.0,y=89.0,z=-18.0,pitch=0.0,yaw=0.0}

Steps/models to reproduce

  1. Set your spawn in the world
  2. Log the player's bed spawn loc
  3. log out
  4. get the instance of offlineplayer
  5. log the bed spawn loc

Plugin and Datapack List

none

Paper version

af3b3778f6de06af48de08d41a43565d3ff19976

Other

No response

Doc94 commented 2 years ago

This is already fixed not?

Machine-Maker commented 2 years ago

Afaik, no. The location is still different.

Doc94 commented 2 years ago

Afaik, no. The location is still different.

Ahhh i see now.. the issue is more like by "findRespawnPositionAndUseSpawnBlock" where change the position a few... then not sure if is better try using this in OfflinePlayer or only add in docs for OfflinePlayer about the "exactly" position for bed?