@@ -43,36 +43,36 @@ public static void sendMsg(Player player, BcUtil.BcMessageParam bcMessageParam)
43
43
boolean actionbar = ConfigUtil .LB_CONFIG .getBoolean ("lb." + type + ".actionbar.enable" );
44
44
boolean boss = ConfigUtil .LB_CONFIG .getBoolean ("lb." + type + ".boss.enable" );
45
45
boolean title = ConfigUtil .LB_CONFIG .getBoolean ("lb." + type + ".title.enable" , true );
46
-
47
- // 解析变量
46
+ // 解析内部变量
48
47
rgb = rgb .replace ("${player}" , bcMessageParam .getPlayerName ());
49
- rgb = PlaceholderApiUtil .set (player , rgb );
50
48
// 加载rgb颜色
51
49
String msgRgb = BaseUtil .replaceChatColor (rgb + msg );
52
50
if (message ) {
53
51
List <String > messageFormatList = ConfigUtil .LB_CONFIG .getStringList ("lb." + type + ".message.format" );
54
52
for (String messageFormat : messageFormatList ) {
55
- MessageUtil .sendAllMessage (messageFormat .replace ("${message}" , msgRgb ));
53
+ messageFormat = messageFormat .replace ("${message}" , msgRgb );
54
+ MessageUtil .sendAllMessage (PlaceholderApiUtil .set (player , messageFormat ));
56
55
}
57
56
}
58
57
// 1.9+ 才可使用
59
58
if (actionbar && BaseConstants .VERSION_ID > VersionCheckEnum .V_1_8 .getVersionId ()) {
60
59
String actionbarRgb = ConfigUtil .LB_CONFIG .getString ("lb." + type + ".actionbar.rgb" );
61
60
String actionbarRgbMsg = BaseUtil .replaceChatColor (actionbarRgb + msg );
62
- actionbarRgbMsg = PlaceholderApiUtil .set (player , actionbarRgbMsg );
63
61
String actionbarFormat = ConfigUtil .LB_CONFIG .getString ("lb." + type + ".actionbar.format" , "${message}" );
64
- MessageUtil .sendAllActionbar (actionbarFormat .replace ("${message}" , actionbarRgbMsg ));
62
+ actionbarFormat = actionbarFormat .replace ("${message}" , actionbarRgbMsg );
63
+ MessageUtil .sendAllActionbar (PlaceholderApiUtil .set (player , actionbarFormat ));
65
64
}
66
65
// 1.9+ 才可使用
67
66
if (title && BaseConstants .VERSION_ID > VersionCheckEnum .V_1_8 .getVersionId ()) {
68
- name = PlaceholderApiUtil .set (player , name );
69
67
String titleFormat = ConfigUtil .LB_CONFIG .getString ("lb." + type + ".title.format" , "${message}" );
70
- MessageUtil .sendAllTitle (name , titleFormat .replace ("${message}" , msgRgb ));
68
+ titleFormat = titleFormat .replace ("${message}" , msgRgb );
69
+ MessageUtil .sendAllTitle (PlaceholderApiUtil .set (player , name ), PlaceholderApiUtil .set (player , titleFormat ));
71
70
}
72
71
// 1.13+ 才可使用
73
72
if (boss && BaseConstants .VERSION_ID > VersionCheckEnum .V_1_12 .getVersionId ()) {
74
73
String bossFormat = ConfigUtil .LB_CONFIG .getString ("lb." + type + ".boss.format" , "${message}" );
75
74
String bossFormatStr = bossFormat .replace ("${message}" , msgRgb );
75
+ bossFormatStr = PlaceholderApiUtil .set (player , bossFormatStr );
76
76
KeyedBossBar bossBar = BossBarUtil .createBossBar (ConfigUtil .LB_CONFIG , "lb." + type + ".boss" , bossFormatStr );
77
77
BossBarUtil .addAllPlayer (bossBar );
78
78
int time = ConfigUtil .LB_CONFIG .getInt ("lb." + type + ".boss.time" , 3 );
0 commit comments