forked from tebexio/Tebex-Minecraft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd3b30d
commit 3a05993
Showing
8 changed files
with
437 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
bukkit/src/main/java/io/tebex/plugin/scheduling/FoliaScheduledTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package io.tebex.plugin.scheduling; | ||
|
||
import io.papermc.paper.threadedregions.scheduler.ScheduledTask; | ||
import org.bukkit.plugin.Plugin; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class FoliaScheduledTask implements io.tebex.plugin.scheduling.ScheduledTask { | ||
private final ScheduledTask task; | ||
|
||
public FoliaScheduledTask(final ScheduledTask task) { | ||
this.task = task; | ||
} | ||
|
||
@Override | ||
public void cancel() { | ||
this.task.cancel(); | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() { | ||
return this.task.isCancelled(); | ||
} | ||
|
||
@Override | ||
public @NotNull Plugin getOwningPlugin() { | ||
return this.task.getOwningPlugin(); | ||
} | ||
|
||
@Override | ||
public boolean isCurrentlyRunning() { | ||
final ScheduledTask.ExecutionState state = this.task.getExecutionState(); | ||
return state == ScheduledTask.ExecutionState.RUNNING || state == ScheduledTask.ExecutionState.CANCELLED_RUNNING; | ||
} | ||
|
||
@Override | ||
public boolean isRepeatingTask() { | ||
return this.task.isRepeatingTask(); | ||
} | ||
} |
Oops, something went wrong.