浏览代码

Replaced Bukkit schedulers in mcMMO.java

Rockyers 1 年之前
父节点
当前提交
7f756c25ab
共有 1 个文件被更改,包括 9 次插入7 次删除
  1. 9 7
      src/main/java/com/gmail/nossr50/mcMMO.java

+ 9 - 7
src/main/java/com/gmail/nossr50/mcMMO.java

@@ -75,6 +75,7 @@ import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
 
 
 public class mcMMO extends JavaPlugin {
 public class mcMMO extends JavaPlugin {
 
 
@@ -236,18 +237,19 @@ public class mcMMO extends JavaPlugin {
 
 
             if(serverAPIOutdated)
             if(serverAPIOutdated)
             {
             {
-                Bukkit
-                        .getScheduler()
-                        .scheduleSyncRepeatingTask(this,
+                foliaLib
+                        .getImpl()
+                        .runTimer(
                                 () -> getLogger().severe("You are running an outdated version of "+platformManager.getServerSoftware()+", mcMMO will not work unless you update to a newer version!"),
                                 () -> getLogger().severe("You are running an outdated version of "+platformManager.getServerSoftware()+", mcMMO will not work unless you update to a newer version!"),
-                        20, 20*60*30);
+                        20 * 50L, 1000 * 60 * 30, TimeUnit.MILLISECONDS);
 
 
                 if(platformManager.getServerSoftware() == ServerSoftwareType.CRAFT_BUKKIT)
                 if(platformManager.getServerSoftware() == ServerSoftwareType.CRAFT_BUKKIT)
                 {
                 {
-                    Bukkit.getScheduler()
-                            .scheduleSyncRepeatingTask(this,
+                    foliaLib
+                            .getImpl()
+                            .runTimer(
                                     () -> getLogger().severe("We have detected you are using incompatible server software, our best guess is that you are using CraftBukkit. mcMMO requires Spigot or Paper, if you are not using CraftBukkit, you will still need to update your custom server software before mcMMO will work."),
                                     () -> getLogger().severe("We have detected you are using incompatible server software, our best guess is that you are using CraftBukkit. mcMMO requires Spigot or Paper, if you are not using CraftBukkit, you will still need to update your custom server software before mcMMO will work."),
-                    20, 20*60*30);
+                            20 * 50L, 1000 * 60 * 30, TimeUnit.MILLISECONDS);
                 }
                 }
             } else {
             } else {
                 registerEvents();
                 registerEvents();