File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/main/java/org/mvplugins/multiverse/inventories/handleshare Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 66import org .mvplugins .multiverse .external .jakarta .inject .Inject ;
77import org .mvplugins .multiverse .inventories .share .Sharable ;
88
9- import java .util .HashMap ;
109import java .util .Map ;
1110import java .util .UUID ;
11+ import java .util .concurrent .ConcurrentHashMap ;
1212
1313/**
1414 * Keeps track of players who are currently having their sharable handling processed.
@@ -26,7 +26,7 @@ public final class PlayerShareHandlingState {
2626
2727 @ Inject
2828 PlayerShareHandlingState () {
29- this .playerAffectedProfiles = new HashMap <>();
29+ this .playerAffectedProfiles = new ConcurrentHashMap <>();
3030 }
3131
3232 void setPlayerAffectedProfiles (Player player , AffectedProfiles status ) {
Original file line number Diff line number Diff line change @@ -93,7 +93,6 @@ private void updatePlayer() {
9393 for (PersistingProfile readProfile : affectedProfiles .getReadProfiles ()) {
9494 ShareHandlingUpdater .updatePlayer (inventories , player , readProfile );
9595 }
96- playerShareHandlingState .removePlayerAffectedProfiles (player );
9796 }
9897
9998 private CompletableFuture <Void > updateProfiles (ProfileDataSnapshot snapshot ) {
@@ -104,7 +103,8 @@ private CompletableFuture<Void> updateProfiles(ProfileDataSnapshot snapshot) {
104103 return CompletableFuture .allOf (affectedProfiles .getWriteProfiles ()
105104 .stream ()
106105 .map (writeProfile -> updatePersistingProfile (writeProfile , snapshot ))
107- .toArray (CompletableFuture []::new ));
106+ .toArray (CompletableFuture []::new ))
107+ .thenRun (() -> playerShareHandlingState .removePlayerAffectedProfiles (player ));
108108 }
109109
110110 private CompletableFuture <Void > updatePersistingProfile (PersistingProfile persistingProfile , ProfileDataSnapshot snapshot ) {
You can’t perform that action at this time.
0 commit comments