File tree Expand file tree Collapse file tree
src/main/java/org/mvplugins/multiverse/inventories/destination Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,17 +44,22 @@ public final class LastLocationDestinationInstance extends DestinationInstance<L
4444
4545 var playerWorld = player .getWorld ().getName ();
4646 if (playerWorld .equals (worldName )) {
47+ // teleporting within same world
4748 return worldManager .getLoadedWorld (worldName ).map (MultiverseWorld ::getSpawnLocation );
4849 }
4950
5051 for (var group : worldGroupManager .getGroupsForWorld (worldName )) {
5152 Logging .finer ("LastLocationDestination: group: " + group );
5253 if (!group .containsWorld (playerWorld ) && group .getApplicableShares ().contains (Sharables .LAST_LOCATION )) {
54+ // teleporting to a different world group
5355 return Option .of (profileContainerStoreProvider .getStore (ContainerType .GROUP )
5456 .getContainer (group .getName ())
5557 .getPlayerProfileNow (player )
5658 .get (Sharables .LAST_LOCATION ))
5759 .orElse (() -> worldManager .getLoadedWorld (worldName ).map (MultiverseWorld ::getSpawnLocation ));
60+ } else if (group .getDisabledShares ().contains (Sharables .LAST_LOCATION )) {
61+ // last location disabled for the group and hence should not apply, defaulting to world's spawn
62+ return worldManager .getLoadedWorld (worldName ).map (MultiverseWorld ::getSpawnLocation );
5863 }
5964 }
6065
You can’t perform that action at this time.
0 commit comments