mirror of
https://github.com/kaboomserver/extras.git
synced 2024-11-27 09:55:36 -05:00
Check if bed respawn location exists
This commit is contained in:
parent
be2cc420a2
commit
6a7efad7b6
1 changed files with 13 additions and 9 deletions
|
@ -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 {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue