Runs /spawn command for player if no safe teleport spot

https://github.com/BentoBoxWorld/BentoBox/issues/479
This commit is contained in:
tastybento 2019-01-24 08:30:43 -08:00
parent e4d2c0b3cf
commit 5f49e2b17b

View File

@ -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"));
}
}
}
}