Fix /com <name> for communities not explicitly loaded

This commit is contained in:
Dan Mulloy 2018-06-19 21:31:51 -04:00 committed by Alexander Meech
parent 73674d56f7
commit 51443ebd46

View File

@ -8,6 +8,7 @@ import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.communities.data.Community; import mineplex.core.communities.data.Community;
import mineplex.core.communities.CommunityManager; import mineplex.core.communities.CommunityManager;
import mineplex.core.communities.data.ICommunity;
import mineplex.core.communities.gui.pages.CommunityMembersPage; import mineplex.core.communities.gui.pages.CommunityMembersPage;
import mineplex.core.communities.gui.pages.CommunityOverviewPage; import mineplex.core.communities.gui.pages.CommunityOverviewPage;
@ -50,14 +51,14 @@ public class CommunityCommand extends MultiCommandBase<CommunityManager>
return; return;
} }
Community community = Plugin.getLoadedCommunity(args[0]); ICommunity community = Plugin.getCommunity(args[0]);
if (community == null) if (community == null)
{ {
UtilPlayer.message(caller, F.main(Plugin.getName(), "Could not find community " + F.name(args[0]) + "!")); UtilPlayer.message(caller, F.main(Plugin.getName(), "Could not find community " + F.name(args[0]) + "!"));
} }
else else
{ {
new CommunityMembersPage(caller, community); Plugin.tempLoadCommunity(community.getId(), real -> new CommunityMembersPage(caller, real));
} }
return; return;
} }