Skip to content

Commit 2445464

Browse files
authored
Merge pull request #3504 from Multiverse/fix/exact-dest-alias
Fix exact destination not working with alias names
2 parents a8c0b22 + 7fad9aa commit 2445464

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/main/java/org/mvplugins/multiverse/core/destination/core/ExactDestination.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,14 @@ public ExactDestination(CoreConfig config, WorldManager worldManager, WorldEntry
9696
return Attempt.failure(InstanceFailureReason.INVALID_FORMAT);
9797
}
9898

99-
String worldName = items[0];
99+
String worldNameOrAlias = items[0];
100100
String positionStr = items[1];
101101

102-
World world = getLoadedMultiverseWorld(worldName).flatMap(LoadedMultiverseWorld::getBukkitWorld).getOrNull();
102+
World world = getLoadedMultiverseWorld(worldNameOrAlias)
103+
.flatMap(LoadedMultiverseWorld::getBukkitWorld)
104+
.getOrNull();
103105
if (world == null) {
104-
return Attempt.failure(InstanceFailureReason.WORLD_NOT_FOUND, Replace.WORLD.with(worldName));
106+
return Attempt.failure(InstanceFailureReason.WORLD_NOT_FOUND, Replace.WORLD.with(worldNameOrAlias));
105107
}
106108

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

114-
return Attempt.success(new ExactDestinationInstance(this, worldManager, worldName, position));
116+
return Attempt.success(new ExactDestinationInstance(this, worldManager, world.getName(), position));
115117
}
116118

117119
//TODO: Extract to a world finder class

0 commit comments

Comments
 (0)