mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-26 10:11:27 +01:00
Add null check for world
This commit is contained in:
parent
1a508a5d14
commit
6982d8e7ba
@ -51,6 +51,9 @@ class SpawnCommand extends MultiverseCommand {
|
|||||||
) {
|
) {
|
||||||
// The player is in the world, so it must be loaded
|
// The player is in the world, so it must be loaded
|
||||||
LoadedMultiverseWorld world = worldManager.getLoadedWorld(player.getWorld().getName()).getOrNull();
|
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
|
// TODO: Log when the player cannot be teleported there. No clue how to detect that
|
||||||
// Teleport the player
|
// Teleport the player
|
||||||
|
Loading…
Reference in New Issue
Block a user