diff --git a/src/main/java/org/simplemc/simpleannounce/SimpleAnnounce.java b/src/main/java/org/simplemc/simpleannounce/SimpleAnnounce.java index da737ef..db716f5 100755 --- a/src/main/java/org/simplemc/simpleannounce/SimpleAnnounce.java +++ b/src/main/java/org/simplemc/simpleannounce/SimpleAnnounce.java @@ -1,5 +1,6 @@ package org.simplemc.simpleannounce; +import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -14,7 +15,7 @@ import org.bukkit.plugin.java.JavaPlugin; import org.simplemc.simpleannounce.message.Message; -import org.simplemc.simpleannounce.message.RepeatingMessage; +import org.simplemc.simpleannounce.message.MessageGroup; import org.simplemc.simpleannounce.message.sender.BossBarSender; import org.simplemc.simpleannounce.message.sender.ChatMessageSender; import org.simplemc.simpleannounce.message.sender.MessageSender; @@ -108,17 +109,33 @@ private void validateConfig() // messages if (!getConfig().contains("messages")) { - getConfig().set("messages.default1.message", "This is an automatically generated repeating message!"); - getConfig().set("messages.default1.delay", 15); - getConfig().set("messages.default1.repeat", 60); - getConfig().set("messages.default2.message", "This is another automatically generated repeating message for people with build permission!"); - getConfig().set("messages.default2.delay", 30); - getConfig().set("messages.default2.repeat", 60); - List df2Includes = new LinkedList<>(); - df2Includes.add("permissions.build"); - getConfig().set("messages.default2.includesperms", df2Includes); - getConfig().set("messages.default3.message", "This is an automatically generated one-time message!"); - getConfig().set("messages.default3.delay", 45); + // example repeating message + getConfig().set("messages.repeating-example.message", "This is an automatically generated repeating message!"); + getConfig().set("messages.repeating-example.delay", 15); + getConfig().set("messages.repeating-example.repeat", 60); + + // example repeating message with perms + getConfig().set("messages.permissions-example.message", "This is another automatically generated repeating message for people with build permission!"); + getConfig().set("messages.permissions-example.delay", 30); + getConfig().set("messages.permissions-example.repeat", 60); + getConfig().set("messages.permissions-example.includesperms", Arrays.asList(new String[]{"permissions.build"})); + + // example one time message + getConfig().set("messages.one-time-example.message", "This is an automatically generated one-time message!"); + getConfig().set("messages.one-time-example.delay", 45); + + // example message group with boss bar sender + getConfig().set("messages.message-group-example.messages", + Arrays.asList(new String[] + { + "This is an automatically generated sequential message group (1 of 3)!", + "This is an automatically generated sequential message group (2 of 3)!", + "This is an automatically generated sequential message group (3 of 3)!" + })); + getConfig().set("messages.message-group-example.delay", 30); + getConfig().set("messages.message-group-example.repeat", 30); + getConfig().set("messages.message-group-example.sender", "bossbar"); + getConfig().set("messages.message-group-example.random-order", false); updated = true; } @@ -138,7 +155,8 @@ private void validateConfig() "-------------------------\n" + "\n" + "(String, must be unique):\n" + - " message(String, required): \n" + + " message(String, required) OR messages(String list, see sample config): \n" + + " random-order(boolean, optional): \n" + " sender(String, optional): \n" + " bar(section, optional):\n" + " hold(int, optional):