From 0b0c2f46ebfb330e059445923179a014bd84f73c Mon Sep 17 00:00:00 2001 From: Cjsah <2684117397@qq.com> Date: Fri, 26 Nov 2021 18:23:12 +0800 Subject: [PATCH] update --- src/main/java/net/cjsah/console/plugin/PluginLoader.java | 1 - src/main/kotlin/net/cjsah/console/Main.kt | 2 ++ src/main/kotlin/net/cjsah/console/Permissions.kt | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/cjsah/console/plugin/PluginLoader.java b/src/main/java/net/cjsah/console/plugin/PluginLoader.java index fb8efe6..e0fd982 100644 --- a/src/main/java/net/cjsah/console/plugin/PluginLoader.java +++ b/src/main/java/net/cjsah/console/plugin/PluginLoader.java @@ -87,7 +87,6 @@ private static Plugin getPlugin(File file) throws Exception { Class clazz = Class.forName(main, true, ucl); Plugin plugin = (Plugin) clazz.getDeclaredConstructor().newInstance(); plugin.init(info); - return plugin; } } diff --git a/src/main/kotlin/net/cjsah/console/Main.kt b/src/main/kotlin/net/cjsah/console/Main.kt index 8b0e7c5..a741267 100644 --- a/src/main/kotlin/net/cjsah/console/Main.kt +++ b/src/main/kotlin/net/cjsah/console/Main.kt @@ -12,6 +12,8 @@ fun main() { return } + Console.permissions.init() + ConsoleCommand.register() Console.start(config.getLong("account"), config.getString("password")) diff --git a/src/main/kotlin/net/cjsah/console/Permissions.kt b/src/main/kotlin/net/cjsah/console/Permissions.kt index 3594634..fe56168 100644 --- a/src/main/kotlin/net/cjsah/console/Permissions.kt +++ b/src/main/kotlin/net/cjsah/console/Permissions.kt @@ -8,12 +8,14 @@ class Permissions { private val list = HashMap() private val permissions = HashMap>() - init { load() } - companion object { fun getEmpty() = WBList(false, listOf(), listOf(), listOf(), listOf()) } + fun init() { + load() + } + fun reload() { list.clear() load()