Skip to content
Merged
Show file tree
Hide file tree
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 @@ -44,17 +44,22 @@ public final class LastLocationDestinationInstance extends DestinationInstance<L

var playerWorld = player.getWorld().getName();
if (playerWorld.equals(worldName)) {
// teleporting within same world
return worldManager.getLoadedWorld(worldName).map(MultiverseWorld::getSpawnLocation);
}

for (var group : worldGroupManager.getGroupsForWorld(worldName)) {
Logging.finer("LastLocationDestination: group: " + group);
if (!group.containsWorld(playerWorld) && group.getApplicableShares().contains(Sharables.LAST_LOCATION)) {
// teleporting to a different world group
return Option.of(profileContainerStoreProvider.getStore(ContainerType.GROUP)
.getContainer(group.getName())
.getPlayerProfileNow(player)
.get(Sharables.LAST_LOCATION))
.orElse(() -> worldManager.getLoadedWorld(worldName).map(MultiverseWorld::getSpawnLocation));
} else if (group.getDisabledShares().contains(Sharables.LAST_LOCATION)) {
// last location disabled for the group and hence should not apply, defaulting to world's spawn
return worldManager.getLoadedWorld(worldName).map(MultiverseWorld::getSpawnLocation);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ protected void prepareProfiles() {
for (WorldGroup worldGroup : worldGroups) {
affectedProfiles.addReadProfile(worldGroup.getGroupProfileContainer().getProfileKey(player), worldGroup.getApplicableShares());
unhandledShares.removeAll(worldGroup.getApplicableShares());
unhandledShares.removeAll(worldGroup.getDisabledShares());
}
if (!unhandledShares.isEmpty()) {
affectedProfiles.addReadProfile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ protected void prepareProfiles() {
worldGroup.getApplicableShares()
);
unhandledShares.removeAll(worldGroup.getApplicableShares());
unhandledShares.removeAll(worldGroup.getDisabledShares());
}
Shares sharesToWrite = inventoriesConfig.getAlwaysWriteWorldProfile()
? Sharables.enabled()
Expand Down
Loading