Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.bukkit.ChatColor;
- import org.bukkit.block.Sign;
- public class RepeatingTask implements Runnable {
- private MyPlugin plugin;
- public RepeatingTask(MyPlugin plugin) {
- this.plugin = plugin;
- }
- @Override
- public void run() {
- /* Do stuff here like checking statuses 'n stuff
- * The SurvivalGames plugin also uses syncronous repeating task for updating stuff
- *
- * Never use Thread.sleep() or Thread.wait() or people who use y
- * our plugin will not like it and complain it lags the server
- *
- * If this thread stops, the whole server stops, so if you use sleep or wait,
- * the whole server will lag.
- *
- * You MUST use syncronous if you want to use the Bukkit API
- *
- */
- for (Sign s : plugin.signs) {
- s.setLine(0, ChatColor.GOLD + "[CastleWars]");
- s.setLine(1, "Second line");
- s.setLine(2, "Second to last line");
- s.setLine(3, "Last line");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement