Add null check for world

This commit is contained in:
Zax71 2024-03-08 18:02:15 +00:00
parent 1a508a5d14
commit 6982d8e7ba
1 changed files with 3 additions and 0 deletions

View File

@ -51,6 +51,9 @@ class SpawnCommand extends MultiverseCommand {
) {
// The player is in the world, so it must be loaded
LoadedMultiverseWorld world = worldManager.getLoadedWorld(player.getWorld().getName()).getOrNull();
if (world == null) {
issuer.sendMessage("The world the player you are trying to teleport is in, is not a multiverse world");
}
// TODO: Log when the player cannot be teleported there. No clue how to detect that
// Teleport the player