mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-07-02 17:54:59 +02:00
Runs /spawn command for player if no safe teleport spot
https://github.com/BentoBoxWorld/BentoBox/issues/479
This commit is contained in:
parent
e4d2c0b3cf
commit
5f49e2b17b
|
@ -129,6 +129,11 @@ public class SafeSpotTeleport {
|
|||
} else {
|
||||
// Last resort
|
||||
((Player)entity).setGameMode(GameMode.SURVIVAL);
|
||||
if (Bukkit.getServer().isPrimaryThread()) {
|
||||
((Player)entity).performCommand("spawn");
|
||||
} else {
|
||||
Bukkit.getScheduler().runTask(plugin, () -> ((Player)entity).performCommand("spawn"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user