mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
#1338: Introduce getRespawnLocation as a replacement for getBedSpawnLocation
By: Nothixal <nothixal@gmail.com>
This commit is contained in:
parent
5165e97c74
commit
e6b4a5f109
2 changed files with 20 additions and 0 deletions
|
@ -297,6 +297,11 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
|||
|
||||
@Override
|
||||
public Location getBedSpawnLocation() {
|
||||
return getRespawnLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getRespawnLocation() {
|
||||
NBTTagCompound data = getData();
|
||||
if (data == null) return null;
|
||||
|
||||
|
|
|
@ -1008,6 +1008,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
|
||||
@Override
|
||||
public Location getBedSpawnLocation() {
|
||||
return getRespawnLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getRespawnLocation() {
|
||||
WorldServer world = getHandle().server.getLevel(getHandle().getRespawnDimension());
|
||||
BlockPosition bed = getHandle().getRespawnPosition();
|
||||
|
||||
|
@ -1026,8 +1031,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
setBedSpawnLocation(location, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRespawnLocation(Location location) {
|
||||
setRespawnLocation(location, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBedSpawnLocation(Location location, boolean override) {
|
||||
setRespawnLocation(location, override);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRespawnLocation(Location location, boolean override) {
|
||||
if (location == null) {
|
||||
getHandle().setRespawnPosition(null, null, 0.0F, override, false, PlayerSpawnChangeEvent.Cause.PLUGIN);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue