mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-10-04 01:27:42 +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 {
|
} else {
|
||||||
// Last resort
|
// Last resort
|
||||||
((Player)entity).setGameMode(GameMode.SURVIVAL);
|
((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