From 2fef438488d987c1d6af8739332c64b3cf0314e6 Mon Sep 17 00:00:00 2001 From: YufiriaMazenta Date: Wed, 25 Dec 2024 09:59:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=92=E4=BB=B6hooker?= =?UTF-8?q?=E7=9A=84=E6=89=A7=E8=A1=8C=E6=97=B6=E9=97=B4=E5=88=B0ACTIVE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 2 +- .../craftorithm/Craftorithm.java | 22 +++++++++++-------- .../craftorithm/hook/impl/EcoItemsHooker.java | 2 +- .../hook/impl/ExecutableItemsHooker.java | 2 +- .../hook/impl/ItemsAdderHooker.java | 2 +- .../craftorithm/hook/impl/MMOItemsHooker.java | 2 +- .../hook/impl/MythicMobs5Hooker.java | 2 +- .../hook/impl/NeigeItemsHooker.java | 2 +- .../craftorithm/hook/impl/OraxenHooker.java | 2 +- .../hook/impl/PlayerPointsHooker.java | 2 +- .../craftorithm/hook/impl/VaultHooker.java | 2 +- 11 files changed, 23 insertions(+), 19 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 587090c8..1b7c7510 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ import java.text.SimpleDateFormat -version = "1.10.15-beta1" +version = "1.10.15-beta2" plugins { `java-library` diff --git a/src/main/java/com/github/yufiriamazenta/craftorithm/Craftorithm.java b/src/main/java/com/github/yufiriamazenta/craftorithm/Craftorithm.java index a466ab0d..3073a36d 100644 --- a/src/main/java/com/github/yufiriamazenta/craftorithm/Craftorithm.java +++ b/src/main/java/com/github/yufiriamazenta/craftorithm/Craftorithm.java @@ -24,11 +24,12 @@ import org.bukkit.event.server.ServerLoadEvent; import org.bukkit.plugin.Plugin; +import java.util.Objects; + @AutoTask( rules = { - @TaskRule( - lifeCycle = LifeCycle.RELOAD - ) + @TaskRule(lifeCycle = LifeCycle.ACTIVE, priority = 1), + @TaskRule(lifeCycle = LifeCycle.RELOAD) } ) @EventListener @@ -59,11 +60,6 @@ public void disable() { @EventHandler public void onServerLoad(ServerLoadEvent event) { - CrypticLibBukkit.scheduler().runTask(this, () -> { - RecipeManager.INSTANCE.reloadRecipeManager(); - OtherPluginsListenerManager.INSTANCE.convertOtherPluginsListeners(); - LangUtils.info(Languages.LOAD_FINISH); - }); } private void loadBStat() { @@ -83,7 +79,15 @@ public static CraftorithmAPI api() { @Override public void run(Plugin plugin, LifeCycle lifeCycle) { - CrypticLib.DEBUG = PluginConfigs.DEBUG.value(); + if (lifeCycle == LifeCycle.ACTIVE) { + CrypticLibBukkit.scheduler().runTask(this, () -> { + RecipeManager.INSTANCE.reloadRecipeManager(); + OtherPluginsListenerManager.INSTANCE.convertOtherPluginsListeners(); + LangUtils.info(Languages.LOAD_FINISH); + }); + } else { + CrypticLib.DEBUG = PluginConfigs.DEBUG.value(); + } } } diff --git a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/EcoItemsHooker.java b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/EcoItemsHooker.java index 883bf383..c4e51689 100644 --- a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/EcoItemsHooker.java +++ b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/EcoItemsHooker.java @@ -8,7 +8,7 @@ import crypticlib.lifecycle.TaskRule; @AutoTask( - rules = @TaskRule(lifeCycle = LifeCycle.ENABLE) + rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE) ) public enum EcoItemsHooker implements ItemPluginHooker { diff --git a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/ExecutableItemsHooker.java b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/ExecutableItemsHooker.java index 5cea4c52..a61ed803 100644 --- a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/ExecutableItemsHooker.java +++ b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/ExecutableItemsHooker.java @@ -8,7 +8,7 @@ import crypticlib.lifecycle.TaskRule; @AutoTask( - rules = @TaskRule(lifeCycle = LifeCycle.ENABLE) + rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE) ) public enum ExecutableItemsHooker implements ItemPluginHooker { diff --git a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/ItemsAdderHooker.java b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/ItemsAdderHooker.java index fdf04035..2c63a7c8 100644 --- a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/ItemsAdderHooker.java +++ b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/ItemsAdderHooker.java @@ -12,7 +12,7 @@ import org.bukkit.Bukkit; @AutoTask( - rules = @TaskRule(lifeCycle = LifeCycle.ENABLE) + rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE) ) public enum ItemsAdderHooker implements ItemPluginHooker { diff --git a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/MMOItemsHooker.java b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/MMOItemsHooker.java index dee74f8d..35fe117d 100644 --- a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/MMOItemsHooker.java +++ b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/MMOItemsHooker.java @@ -8,7 +8,7 @@ import crypticlib.lifecycle.TaskRule; @AutoTask( - rules = @TaskRule(lifeCycle = LifeCycle.ENABLE) + rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE) ) public enum MMOItemsHooker implements ItemPluginHooker { diff --git a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/MythicMobs5Hooker.java b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/MythicMobs5Hooker.java index c6c2a4ff..013356e9 100644 --- a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/MythicMobs5Hooker.java +++ b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/MythicMobs5Hooker.java @@ -8,7 +8,7 @@ import crypticlib.lifecycle.TaskRule; @AutoTask( - rules = @TaskRule(lifeCycle = LifeCycle.ENABLE) + rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE) ) public enum MythicMobs5Hooker implements ItemPluginHooker { diff --git a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/NeigeItemsHooker.java b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/NeigeItemsHooker.java index f114c7ed..3f1dba60 100644 --- a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/NeigeItemsHooker.java +++ b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/NeigeItemsHooker.java @@ -8,7 +8,7 @@ import crypticlib.lifecycle.TaskRule; @AutoTask( - rules = @TaskRule(lifeCycle = LifeCycle.ENABLE, priority = -1)//因为NeigeItems的物品可能包含其他插件的物品,所以需要让它先注册以保证他先识别 + rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE, priority = -1)//因为NeigeItems的物品可能包含其他插件的物品,所以需要让它先注册以保证他先识别 ) public enum NeigeItemsHooker implements ItemPluginHooker { diff --git a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/OraxenHooker.java b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/OraxenHooker.java index 33ceac48..4b599c07 100644 --- a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/OraxenHooker.java +++ b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/OraxenHooker.java @@ -8,7 +8,7 @@ import crypticlib.lifecycle.TaskRule; @AutoTask( - rules = @TaskRule(lifeCycle = LifeCycle.ENABLE) + rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE) ) public enum OraxenHooker implements ItemPluginHooker { diff --git a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/PlayerPointsHooker.java b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/PlayerPointsHooker.java index 0da3ef7d..d8995e0f 100644 --- a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/PlayerPointsHooker.java +++ b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/PlayerPointsHooker.java @@ -8,7 +8,7 @@ import org.jetbrains.annotations.Nullable; @AutoTask( - rules = @TaskRule(lifeCycle = LifeCycle.ENABLE) + rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE) ) public enum PlayerPointsHooker implements PluginHooker { diff --git a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/VaultHooker.java b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/VaultHooker.java index 31f496b7..e540de2e 100644 --- a/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/VaultHooker.java +++ b/src/main/java/com/github/yufiriamazenta/craftorithm/hook/impl/VaultHooker.java @@ -10,7 +10,7 @@ import org.jetbrains.annotations.Nullable; @AutoTask( - rules = @TaskRule(lifeCycle = LifeCycle.ENABLE) + rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE) ) public enum VaultHooker implements PluginHooker {