File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed
src/main/java/org/mvplugins/multiverse/inventories Expand file tree Collapse file tree 3 files changed +7
-0
lines changed 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
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ protected void prepareProfiles() {
2323 for (WorldGroup worldGroup : worldGroups ) {
2424 affectedProfiles .addReadProfile (worldGroup .getGroupProfileContainer ().getProfileKey (player ), worldGroup .getApplicableShares ());
2525 unhandledShares .removeAll (worldGroup .getApplicableShares ());
26+ unhandledShares .removeAll (worldGroup .getDisabledShares ());
2627 }
2728 if (!unhandledShares .isEmpty ()) {
2829 affectedProfiles .addReadProfile (
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ protected void prepareProfiles() {
3838 worldGroup .getApplicableShares ()
3939 );
4040 unhandledShares .removeAll (worldGroup .getApplicableShares ());
41+ unhandledShares .removeAll (worldGroup .getDisabledShares ());
4142 }
4243 Shares sharesToWrite = inventoriesConfig .getAlwaysWriteWorldProfile ()
4344 ? Sharables .enabled ()
You can’t perform that action at this time.
0 commit comments