mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-23 08:59:28 +00:00
1.5.0-SNAPSHOT
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package net.momirealms.customcrops.timer;
|
||||
|
||||
import net.momirealms.customcrops.CustomCrops;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
public class CropTimerAsync {
|
||||
|
||||
private final int taskID;
|
||||
|
||||
public CropTimerAsync(CustomCrops plugin) {
|
||||
TimeCheck tc = new TimeCheck(plugin);
|
||||
BukkitTask task = tc.runTaskTimerAsynchronously(CustomCrops.instance, 1,1);
|
||||
this.taskID = task.getTaskId();
|
||||
}
|
||||
|
||||
public void stopTimer(int ID) {
|
||||
Bukkit.getScheduler().cancelTask(ID);
|
||||
Bukkit.getServer().getScheduler().cancelTask(ID);
|
||||
}
|
||||
|
||||
public int getTaskID() {
|
||||
return this.taskID;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user