Don't let someone join a party they are already in
This commit is contained in:
@@ -10,6 +10,7 @@ import com.alttd.velocitychat.VelocityChat;
|
||||
import com.alttd.velocitychat.commands.SubCommand;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -45,6 +46,10 @@ public class Join implements SubCommand {
|
||||
|
||||
// party.addUser(ChatUserManager.getChatUser(player.getUniqueId())); //Removed until we can get nicknames to translate to colors correctly
|
||||
ChatUser chatUser = ChatUserManager.getChatUser(player.getUniqueId());
|
||||
if (chatUser.getPartyId() == party.getPartyId()) {
|
||||
source.sendMessage(Utility.parseMiniMessage(Config.ALREADY_IN_THIS_PARTY, Placeholder.miniMessage("party", party.getPartyName())));
|
||||
return;
|
||||
}
|
||||
party.addUser(chatUser, player.getUsername());
|
||||
source.sendMessage(Utility.parseMiniMessage(Config.JOINED_PARTY, Placeholder.miniMessage("party_name", party.getPartyName())));
|
||||
VelocityChat.getPlugin().getChatHandler().sendPartyMessage(party,
|
||||
|
||||
Reference in New Issue
Block a user