Delete new communities if the leader has been transferred a new community during creation

This commit is contained in:
AlexTheCoder 2016-12-23 15:07:52 -05:00
parent 1e0ba62557
commit 4ae21e66c9

View File

@ -688,6 +688,13 @@ public class CommunityManager extends MiniDbClientPlugin<CommunityMemberData>
}
else
{
if (ownsCommunity(sender.getUniqueId()))
{
UtilPlayer.message(sender, F.main(getName(), "You already own a community!"));
_repo.deleteCommunity(id);
runSync(() -> _creating.remove(sender.getUniqueId()));
return;
}
new CommunityCreate(sender.getUniqueId().toString(), senderName, accountId, id, name).publish();
runSync(() -> _creating.remove(sender.getUniqueId()));
}