mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
[Bleeding] Fix NPE with a null bedSpawnLocation. Fixes BUKKIT-1500
By: EdGruberman <ed@rjump.com>
This commit is contained in:
parent
7aea414399
commit
3f11c5df16
@ -614,8 +614,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
public void setBedSpawnLocation(Location location, boolean override) {
|
||||
getHandle().setRespawnPosition(new ChunkCoordinates(location.getBlockX(), location.getBlockY(), location.getBlockZ()), override);
|
||||
getHandle().spawnWorld = location.getWorld().getName();
|
||||
if (location == null) {
|
||||
getHandle().setRespawnPosition(null, override);
|
||||
} else {
|
||||
getHandle().setRespawnPosition(new ChunkCoordinates(location.getBlockX(), location.getBlockY(), location.getBlockZ()), override);
|
||||
getHandle().spawnWorld = location.getWorld().getName();
|
||||
}
|
||||
}
|
||||
|
||||
public void hidePlayer(Player player) {
|
||||
|
Loading…
Reference in New Issue
Block a user