001 package org.bukkit.scheduler; 002 003 import org.bukkit.plugin.Plugin; 004 005 /** 006 * Represents a task being executed by the scheduler 007 */ 008 public interface BukkitTask { 009 010 /** 011 * Returns the taskId for the task. 012 * 013 * @return Task id number 014 */ 015 public int getTaskId(); 016 017 /** 018 * Returns the Plugin that owns this task. 019 * 020 * @return The Plugin that owns the task 021 */ 022 public Plugin getOwner(); 023 024 /** 025 * Returns true if the Task is a sync task. 026 * 027 * @return true if the task is run by main thread 028 */ 029 public boolean isSync(); 030 031 /** 032 * Will attempt to cancel this task. 033 */ 034 public void cancel(); 035 }