浏览代码

Separation of the query from PlaceholderAPI

RedstoneFuture 2 年之前
父节点
当前提交
fce3a6d00d
共有 1 个文件被更改,包括 15 次插入8 次删除
  1. 15 8
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/MissileWars.java

+ 15 - 8
missilewars-plugin/src/main/java/de/butzlabben/missilewars/MissileWars.java

@@ -125,13 +125,9 @@ public class MissileWars extends JavaPlugin {
         if (Config.isPrefetchPlayers()) {
             PreFetcher.preFetchPlayers(new StatsFetcher(new Date(0L), ""));
         }
-
-        // Small check to make sure that PlaceholderAPI is installed
-        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
-            new MissileWarsPlaceholder(this).register();
-            Logger.NORMAL.log("The PlaceholderAPI is installed. New placeholders are provided by MissileWars.");
-        }
-
+        
+        checkPlaceholderAPI();
+        
         endTime = System.currentTimeMillis();
         Logger.SUCCESS.log("MissileWars was enabled in " + (endTime - startTime) + "ms");
     }
@@ -143,7 +139,18 @@ public class MissileWars extends JavaPlugin {
 
         ConnectionHolder.close();
     }
-
+    
+    /**
+     * This method checks if the PlaceholderAPI is installed. When it is 
+     * installed, a message is sent to the log.
+     */
+    private void checkPlaceholderAPI() {
+        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
+            new MissileWarsPlaceholder(this).register();
+            Logger.NORMAL.log("The PlaceholderAPI is installed. New placeholders are provided by MissileWars.");
+        }
+    }
+    
     /**
      * This method registers all events of the missilewars event listener.
      */