Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ public ExactDestination(CoreConfig config, WorldManager worldManager, WorldEntry
return Attempt.failure(InstanceFailureReason.INVALID_FORMAT);
}

String worldName = items[0];
String worldNameOrAlias = items[0];
String positionStr = items[1];

World world = getLoadedMultiverseWorld(worldName).flatMap(LoadedMultiverseWorld::getBukkitWorld).getOrNull();
World world = getLoadedMultiverseWorld(worldNameOrAlias)
.flatMap(LoadedMultiverseWorld::getBukkitWorld)
.getOrNull();
if (world == null) {
return Attempt.failure(InstanceFailureReason.WORLD_NOT_FOUND, Replace.WORLD.with(worldName));
return Attempt.failure(InstanceFailureReason.WORLD_NOT_FOUND, Replace.WORLD.with(worldNameOrAlias));
}

EntityPosition position;
Expand All @@ -111,7 +113,7 @@ public ExactDestination(CoreConfig config, WorldManager worldManager, WorldEntry
return Attempt.failure(InstanceFailureReason.INVALID_NUMBER_FORMAT, Replace.ERROR.with(e));
}

return Attempt.success(new ExactDestinationInstance(this, worldManager, worldName, position));
return Attempt.success(new ExactDestinationInstance(this, worldManager, world.getName(), position));
}

//TODO: Extract to a world finder class
Expand Down
Loading