mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 09:51:12 +01:00
implementation of isQueued()
This commit is contained in:
parent
6335a5af76
commit
6269c1e633
1 changed files with 14 additions and 0 deletions
|
@ -223,4 +223,18 @@ public class CraftScheduler implements BukkitScheduler, Runnable {
|
||||||
public boolean isCurrentlyRunning(int taskId){
|
public boolean isCurrentlyRunning(int taskId){
|
||||||
return craftThreadManager.isAlive(taskId);
|
return craftThreadManager.isAlive(taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isQueued(int taskId) {
|
||||||
|
synchronized (schedulerQueue) {
|
||||||
|
Iterator<CraftTask> itr = schedulerQueue.keySet().iterator();
|
||||||
|
while (itr.hasNext()) {
|
||||||
|
CraftTask current = itr.next();
|
||||||
|
if (current.getIdNumber() == taskId) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue