mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
dissalow use of gui and add warning for folia.
This commit is contained in:
parent
80aeb165cc
commit
1ec4bc27f2
3 changed files with 22 additions and 7 deletions
|
|
@ -6,7 +6,7 @@ import org.bukkit.entity.Entity
|
|||
import org.bukkit.plugin.Plugin
|
||||
import java.util.function.Consumer
|
||||
|
||||
class PaperScheduler : TaskScheduler {
|
||||
class FoliaScheduler : TaskScheduler {
|
||||
override fun scheduleGlobally(plugin: Plugin, task: Runnable, time: Long): Any? {
|
||||
if(time < 1){
|
||||
return Bukkit.getGlobalRegionScheduler().run(
|
||||
|
|
@ -39,11 +39,11 @@ class PaperScheduler : TaskScheduler {
|
|||
}
|
||||
|
||||
companion object {
|
||||
fun isPaper(): Boolean {
|
||||
fun isFolia(): Boolean {
|
||||
try {
|
||||
Bukkit::class.java.getDeclaredMethod("getGlobalRegionScheduler")
|
||||
Class.forName("io.papermc.paper.threadedregions.RegionizedServer")
|
||||
return true
|
||||
} catch (e: NoSuchMethodException) {
|
||||
} catch (e: ClassNotFoundException) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue