File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/java/sensen1234/sencraft/tips Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1111public class TIPS extends JavaPlugin {
1212
1313 private List <String > tips ;
14+ private String tipstext ;
15+ private String tipstextcolor ;
1416 private Random random ;
1517
1618 @ Override
@@ -23,6 +25,8 @@ public void onEnable() {
2325 private void loadConfig () {
2426 FileConfiguration config = getConfig ();
2527 tips = config .getStringList ("tips" );
28+ tipstext = config .getString ("tipstext" , "" );
29+ tipstextcolor = config .getString ("tipstextcolor" , "" );
2630 random = new Random ();
2731 }
2832
@@ -37,9 +41,9 @@ public void run() {
3741 }
3842
3943 private void sendRandomTip () {
40- if (!tips .isEmpty ()) {
44+ if (tips != null && !tips .isEmpty ()) {
4145 String tip = tips .get (random .nextInt (tips .size ()));
42- Bukkit .broadcastMessage ("[TIPS] " + tip ); // 发送小提示到公屏
46+ Bukkit .broadcastMessage (tipstextcolor + tipstext + tip ); // 发送小提示到公屏
4347 }
4448 }
4549}
You can’t perform that action at this time.
0 commit comments