Synchronize BrowserIds List and update the browser GUI when a contained community is disbanded

This commit is contained in:
AlexTheCoder 2016-12-16 23:17:06 -05:00 committed by cnr
parent 941b33bcfc
commit cc3842f019

View File

@ -391,7 +391,13 @@ public class CommunityManager extends MiniDbClientPlugin<CommunityMemberData>
UtilServer.GetPlayers().stream().filter(player -> Get(player).Invites.contains(community.getId())).forEach(player -> Get(player).Invites.remove(community.getId()));
community.getMembers().keySet().stream().filter(uuid -> Bukkit.getPlayer(uuid) != null).forEach(uuid -> Get(Bukkit.getPlayer(uuid)).leaveCommunity(community));
_loadedCommunities.remove(community.getId());
BrowserIds.remove(community.getId());
runSync(() ->
{
if (BrowserIds.remove(community.getId()))
{
UtilServer.CallEvent(new CommunityBrowserUpdateEvent());
}
});
}
public void handleToggleReadingCommunityChat(Integer id, UUID uuid, boolean reading)