[Bleeding] Fix NPE with a null bedSpawnLocation. Fixes BUKKIT-1500
By: EdGruberman <ed@rjump.com>
This commit is contained in:
@@ -614,8 +614,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setBedSpawnLocation(Location location, boolean override) {
|
public void setBedSpawnLocation(Location location, boolean override) {
|
||||||
getHandle().setRespawnPosition(new ChunkCoordinates(location.getBlockX(), location.getBlockY(), location.getBlockZ()), override);
|
if (location == null) {
|
||||||
getHandle().spawnWorld = location.getWorld().getName();
|
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) {
|
public void hidePlayer(Player player) {
|
||||||
|
|||||||
Reference in New Issue
Block a user