@@ -65,24 +65,22 @@ public void perform() {
65
65
}
66
66
67
67
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 ());
70
82
}
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
+
86
84
myFaction .msg (TL .COMMAND_INVITE_INVITED , fme .describeTo (myFaction , true ), target .describeTo (myFaction ));
87
85
}
88
86
0 commit comments