Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit ea861d3

Browse files
author
Svenja Reissaus
committed
Fixed no confirmation message when inviting offline players
1 parent d6d8031 commit ea861d3

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/main/java/com/massivecraft/factions/cmd/CmdInvite.java

+15-17
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,22 @@ public void perform() {
6565
}
6666

6767
myFaction.invite(target);
68-
if (!target.isOnline()) {
69-
return;
68+
// Send the invitation to the target player when online, otherwise just ignore
69+
if (target.isOnline()) {
70+
// Tooltips, colors, and commands only apply to the string immediately before it.
71+
FancyMessage message = new FancyMessage(fme.describeTo(target, true))
72+
.tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString())
73+
.command("/" + Conf.baseCommandAliases.get(0) + " join " + myFaction.getTag())
74+
.then(TL.COMMAND_INVITE_INVITEDYOU.toString())
75+
.color(ChatColor.YELLOW)
76+
.tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString())
77+
.command("/" + Conf.baseCommandAliases.get(0) + " join " + myFaction.getTag())
78+
.then(myFaction.describeTo(target)).tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString())
79+
.command("/" + Conf.baseCommandAliases.get(0) + " join " + myFaction.getTag());
80+
81+
message.send(target.getPlayer());
7082
}
71-
72-
// Tooltips, colors, and commands only apply to the string immediately before it.
73-
FancyMessage message = new FancyMessage(fme.describeTo(target, true))
74-
.tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString())
75-
.command("/" + Conf.baseCommandAliases.get(0) + " join " + myFaction.getTag())
76-
.then(TL.COMMAND_INVITE_INVITEDYOU.toString())
77-
.color(ChatColor.YELLOW)
78-
.tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString())
79-
.command("/" + Conf.baseCommandAliases.get(0) + " join " + myFaction.getTag())
80-
.then(myFaction.describeTo(target)).tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString())
81-
.command("/" + Conf.baseCommandAliases.get(0) + " join " + myFaction.getTag());
82-
83-
message.send(target.getPlayer());
84-
85-
//you.msg("%s<i> invited you to %s", fme.describeTo(you, true), myFaction.describeTo(you));
83+
8684
myFaction.msg(TL.COMMAND_INVITE_INVITED, fme.describeTo(myFaction, true), target.describeTo(myFaction));
8785
}
8886

0 commit comments

Comments
 (0)