mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 12:11:47 +01:00
[Bleeding] Fix NPE with a null bedSpawnLocation. Fixes BUKKIT-1500
This commit is contained in:
parent
4d2a92ed47
commit
f18b3cdc76
2 changed files with 7 additions and 2 deletions
|
@ -1094,6 +1094,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
|||
} else {
|
||||
this.c = null;
|
||||
this.d = false;
|
||||
this.spawnWorld = ""; // CraftBukkit
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -614,9 +614,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
}
|
||||
|
||||
public void setBedSpawnLocation(Location location, boolean override) {
|
||||
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) {
|
||||
Validate.notNull(player, "hidden player cannot be null");
|
||||
|
|
Loading…
Reference in a new issue