Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.logging.Logger;
- import org.bukkit.Bukkit;
- import org.bukkit.block.Sign;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- public class MyPlugin extends JavaPlugin {
- public static final Logger logger = Logger.getLogger("Minecraft");
- public ArrayList<Sign> signs = new ArrayList<Sign>();
- public int taskId = -1;
- @Override
- public void onDisable() {
- PluginDescriptionFile pdfFile = this.getDescription();
- /* Cancels all tasks from this plugin */
- Bukkit.getScheduler().cancelTasks(this);
- logger.info(pdfFile.getName() + " version " + pdfFile.getVersion() + " is now disabled.");
- }
- @Override
- public void onEnable() {
- PluginDescriptionFile pdfFile = this.getDescription();
- /* Schedule your task in your onEnable()
- *
- * You can set it to an integer if you want to cancel individual tasks with
- * Bukkit.getScheduler().cancelTask(taskId);
- */
- taskId = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new RepeatingTask(this), 0, 1200);
- logger.info(pdfFile.getName() + " version " + pdfFile.getVersion() + " is now enabled.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement