Pass accountId at community creation time
This commit is contained in:
parent
623703cc76
commit
69670a4b99
@ -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 ->
|
||||
|
@ -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]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user