-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from HQService/dev/paper
Dev/paper
- Loading branch information
Showing
36 changed files
with
742 additions
and
267 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
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
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
15 changes: 15 additions & 0 deletions
15
...s/bukkit-core/src/main/kotlin/kr/hqservice/framework/bukkit/core/scheduler/HQScheduler.kt
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,15 @@ | ||
package kr.hqservice.framework.bukkit.core.scheduler | ||
|
||
interface HQScheduler { | ||
fun runTask(runnable: () -> Unit) | ||
|
||
fun runTaskLater(delay: Long, runnable: () -> Unit): HQTask | ||
|
||
fun runTaskTimer(delay: Long, period: Long, runnable: () -> Unit): HQTask | ||
|
||
fun runTaskAsynchronously(runnable: () -> Unit): HQTask | ||
|
||
fun runTaskLaterAsynchronously(delay: Long, runnable: () -> Unit): HQTask | ||
|
||
fun runTaskTimerAsynchronously(delay: Long, period: Long, runnable: () -> Unit): HQTask | ||
} |
7 changes: 7 additions & 0 deletions
7
modules/bukkit-core/src/main/kotlin/kr/hqservice/framework/bukkit/core/scheduler/HQTask.kt
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,7 @@ | ||
package kr.hqservice.framework.bukkit.core.scheduler | ||
|
||
interface HQTask { | ||
fun isCancelled(): Boolean | ||
|
||
fun cancel() | ||
} |
16 changes: 16 additions & 0 deletions
16
...t-core/src/main/kotlin/kr/hqservice/framework/bukkit/core/scheduler/SchedulerExtension.kt
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,16 @@ | ||
package kr.hqservice.framework.bukkit.core.scheduler | ||
|
||
import kr.hqservice.framework.bukkit.core.HQBukkitPlugin | ||
import kr.hqservice.framework.bukkit.core.scheduler.bukkit.HQBukkitScheduler | ||
import org.bukkit.Location | ||
import org.bukkit.plugin.Plugin | ||
|
||
fun Plugin.getScheduler(): HQScheduler { | ||
return if (this is HQBukkitPlugin) getScheduler() | ||
else HQBukkitScheduler(this) | ||
} | ||
|
||
fun Plugin.getScheduler(location: Location): HQScheduler { | ||
return if (this is HQBukkitPlugin) getScheduler(location) | ||
else HQBukkitScheduler(this) | ||
} |
Oops, something went wrong.