Skip to content

Commit f1990f3

Browse files
committed
feat: Ignoring players stops party invites
1 parent 95c3831 commit f1990f3

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

common/src/main/java/net/draycia/carbon/common/command/commands/PartyCommands.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ private void invitePlayer(final CommandContext<PlayerCommander> ctx) {
220220
return;
221221
}
222222

223+
if (player.ignoring(recipient)) {
224+
this.messages.partyTargetIgnoring(player, recipient.displayName());
225+
return;
226+
}
227+
228+
if (recipient.ignoring(player)) {
229+
this.messages.partyIgnoringTarget(player, recipient.displayName());
230+
return;
231+
}
232+
223233
final @Nullable Party recipientParty = recipient.party().join();
224234
if (recipientParty != null && recipientParty.id().equals(party.id())) {
225235
this.messages.alreadyInParty(player, recipient.displayName());

common/src/main/java/net/draycia/carbon/common/messages/CarbonMessages.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,12 @@ void errorCommandCommandExecution(
573573
@Message("command.party.already_in_party")
574574
void alreadyInParty(Audience audience, Component displayName);
575575

576+
@Message("command.party.ignoring_target")
577+
void partyTargetIgnoring(Audience audience, Component target);
578+
579+
@Message("command.party.ignored_by_target")
580+
void partyIgnoringTarget(Audience audience, Component target);
581+
576582
@Message("command.party.description")
577583
Component partyDesc();
578584

common/src/main/resources/locale/messages-en_US.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ command.party.accept.description=Accept party invites.
9090
command.party.leave.description=Leave your current party.
9191
command.party.already_in_party=<display_name><red> is already in your party.
9292
command.party.disband.description=Disband your current party.
93+
command.party.ignoring_target=<red>You are ignoring <target>
94+
command.party.ignored_by_target=<red><target> <red>is ignoring you
9395
command.spy.enabled=<green>Spying is now enabled.
9496
command.spy.disabled=<red>Spying is now disabled.
9597
command.spy.description=Allows a player to view all private and channel messages they otherwise wouldn't see.

0 commit comments

Comments
 (0)