diff --git a/api/src/main/java/com/alttd/chat/config/Config.java b/api/src/main/java/com/alttd/chat/config/Config.java index d0ba019..43cd242 100755 --- a/api/src/main/java/com/alttd/chat/config/Config.java +++ b/api/src/main/java/com/alttd/chat/config/Config.java @@ -271,6 +271,7 @@ public final class Config { public static String REMOVED_USER_FROM_PARTY = "You removed from the chat party!"; public static String NOT_A_PARTY_MEMBER = " is not a member of your party!"; public static String ALREADY_IN_PARTY = "You're already in a party!"; + public static String ALREADY_IN_THIS_PARTY = "You're already in !"; public static String SENT_PARTY_INV = "You send a chat party invite to !"; public static String JOIN_PARTY_CLICK_MESSAGE = " '>" + "You received an invite to join , click this message to accept."; diff --git a/velocity/src/main/java/com/alttd/velocitychat/commands/partysubcommands/Join.java b/velocity/src/main/java/com/alttd/velocitychat/commands/partysubcommands/Join.java index e17198f..ceeb60c 100644 --- a/velocity/src/main/java/com/alttd/velocitychat/commands/partysubcommands/Join.java +++ b/velocity/src/main/java/com/alttd/velocitychat/commands/partysubcommands/Join.java @@ -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,