Create plugins folder by default

This commit is contained in:
RaphiMC 2023-02-02 14:02:31 +01:00
parent 883a239af8
commit 3d64b3cc57

View File

@ -39,7 +39,11 @@ public class PluginManager {
private static final List<ViaProxyPlugin> PLUGINS = new ArrayList<>(); private static final List<ViaProxyPlugin> PLUGINS = new ArrayList<>();
public static void loadPlugins() { public static void loadPlugins() {
if (!PLUGINS_DIR.exists() || !PLUGINS_DIR.isDirectory()) return; if (!PLUGINS_DIR.exists() || !PLUGINS_DIR.isDirectory()) {
if (!PLUGINS_DIR.mkdirs()) {
return;
}
}
File[] files = PLUGINS_DIR.listFiles(); File[] files = PLUGINS_DIR.listFiles();
if (files == null) return; if (files == null) return;