Pass accountId at community creation time

This commit is contained in:
cnr 2016-12-22 01:17:44 -07:00
parent 623703cc76
commit 69670a4b99
2 changed files with 4 additions and 3 deletions

View File

@ -586,9 +586,8 @@ public class CommunityManager extends MiniDbClientPlugin<CommunityMemberData>
new CommunityUpdateMemberRole(community.getId(), sender.getName(), info.UUID.toString(), role.toString()).publish();
}
public void handleCreate(Player sender, String name)
public void handleCreate(Player sender, int accountId, String name)
{
int accountId = Managers.get(CoreClientManager.class).getAccountId(sender);
runAsync(() ->
{
_repo.createCommunity(name, accountId, id ->

View File

@ -6,6 +6,7 @@ import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import mineplex.core.Managers;
import mineplex.core.account.CoreClientManager;
import mineplex.core.chat.Chat;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
@ -52,13 +53,14 @@ public class CommunityCreateCommand extends CommandBase<CommunityManager>
}
Plugin.runAsync(() ->
{
int accountId = Managers.get(CoreClientManager.class).getAccountId(caller);
if (Managers.get(Chat.class).getFilteredMessage(caller, args[0]).contains("*"))
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "That name is not allowed!"));
}
else
{
Plugin.handleCreate(caller, args[0]);
Plugin.handleCreate(caller, accountId, args[0]);
}
});
}