mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
1 parent
474db95b1a
commit
dd6c23168d
4 files changed
+15
-13
No files matched your search
@@ -23,6 +23,7 @@ import net.william278.huskhomes.HuskHomes;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public interface TaskRunner {
|
||||
@@ -41,6 +42,17 @@ public interface TaskRunner {
|
||||
|
||||
void cancelAllTasks();
|
||||
|
||||
@NotNull
|
||||
ConcurrentHashMap<Integer, ?> getTasks();
|
||||
|
||||
default int getNextTaskId() {
|
||||
int taskId = 0;
|
||||
while (getTasks().containsKey(taskId)) {
|
||||
taskId++;
|
||||
}
|
||||
return taskId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
HuskHomes getPlugin();
|
||||
|
||||
|
||||
Reference in new issue
Block a user