33import cn .handyplus .chat .PlayerChat ;
44import cn .handyplus .chat .constants .ChatConstants ;
55import cn .handyplus .chat .core .ChatUtil ;
6+ import cn .handyplus .chat .core .HornUtil ;
67import cn .handyplus .chat .enter .ChatPlayerChannelEnter ;
78import cn .handyplus .chat .event .PlayerChannelChatEvent ;
89import cn .handyplus .chat .param .ChatParam ;
1516import org .bukkit .Bukkit ;
1617import org .bukkit .entity .Player ;
1718import org .bukkit .plugin .Plugin ;
19+ import org .jetbrains .annotations .NotNull ;
1820
1921import java .util .ArrayList ;
2022import java .util .List ;
@@ -196,7 +198,7 @@ private String getPluginChannelName(Plugin plugin, String channel) {
196198 * @return true成功
197199 * @since 1.2.4
198200 */
199- public boolean sendMessage (Player player , String channel , String message , String source ) {
201+ public boolean sendMessage (@ NotNull Player player , @ NotNull String channel , @ NotNull String message , @ NotNull String source ) {
200202 // @处理
201203 List <String > mentionedPlayers = new ArrayList <>();
202204 message = ChatUtil .at (mentionedPlayers , message );
@@ -221,4 +223,23 @@ public boolean sendMessage(Player player, String channel, String message, String
221223 return true ;
222224 }
223225
226+ /**
227+ * 发送喇叭消息
228+ * @param player 玩家
229+ * @param type 类型
230+ * @param message 消息
231+ * @since 1.2.7
232+ */
233+ public void sendLb (@ NotNull Player player , @ NotNull String type , @ NotNull String message ) {
234+ BcUtil .BcMessageParam param = new BcUtil .BcMessageParam ();
235+ param .setPluginName (PlayerChat .INSTANCE .getName ());
236+ param .setType (type );
237+ param .setMessage (message );
238+ param .setTimestamp (System .currentTimeMillis ());
239+ param .setPlayerName (player .getName ());
240+ BcUtil .sendParamForward (player , param );
241+ // 发送消息
242+ HornUtil .sendMsg (player , param );
243+ }
244+
224245}
0 commit comments