From 6982d8e7ba3939753b5feee521e447e3bda1570d Mon Sep 17 00:00:00 2001 From: Zax71 Date: Fri, 8 Mar 2024 18:02:15 +0000 Subject: [PATCH] Add null check for world --- .../org/mvplugins/multiverse/core/commands/SpawnCommand.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java index 22ba9fab..ceafc938 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java @@ -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