Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //CONFIG
- automsg:
- time: 50
- prefix: '&2[&l!&2] '
- messages:
- - '&7Wiadomosc testowa &a#1'
- - '&7Wiadomosc testowa &a#2'
- - '&7Wiadomosc testowa &a#3'
- - '&7Wiadomosc testowa &a#4'
- - '&7Wiadomosc testowa &a#5'
- //AUTOMSG-CLASS
- public AutoMsg(CorePlugin msg) {
- plugin = msg;
- }
- public static void start() {
- (new BukkitRunnable() {
- int i = 0;
- List<String> Messages = AutoMsg.plugin.getConfig().getStringList("automsg.messages");
- String prefix = AutoMsg.plugin.getConfig().getString("automsg.prefix");
- public void run() {
- if (this.i < this.Messages.size()) {
- Bukkit.broadcastMessage(ChatUtil.fixColor(this.prefix + (String)this.Messages.get(this.i)));
- this.i++;
- } else {
- this.i = 0;
- }
- }
- }).runTaskTimer((Plugin)plugin, 20L * plugin.getConfig().getInt("automsg.time"), 20L * plugin.getConfig().getInt("automsg.time"));
- }
- }
- //REGISTER W ONENABLE
- new AutoMsg(this);
- AutoMsg.start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement