Check if bed respawn location exists

This commit is contained in:
mathias 2019-06-16 04:31:07 +03:00
parent be2cc420a2
commit 6a7efad7b6

View file

@ -616,6 +616,9 @@ class Events implements Listener {
player.getLastDamageCause().getCause() != DamageCause.SUICIDE) {
Bukkit.getScheduler().scheduleSyncDelayedTask(main, new Runnable() {
public void run() {
if (player.getBedSpawnLocation() != null) {
player.teleport(player.getBedSpawnLocation());
} else {
World world = Bukkit.getWorld("world");
Location spawnLoc = world.getSpawnLocation();
@ -630,6 +633,7 @@ class Events implements Listener {
}
}
}
}
});
}
}