Skip to content

Commit

Permalink
修改插件hooker的执行时间到ACTIVE
Browse files Browse the repository at this point in the history
  • Loading branch information
YufiriaMazenta committed Dec 25, 2024
1 parent 1c9e426 commit 2fef438
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import java.text.SimpleDateFormat
version = "1.10.15-beta1"
version = "1.10.15-beta2"

plugins {
`java-library`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand All @@ -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();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import crypticlib.lifecycle.TaskRule;

@AutoTask(
rules = @TaskRule(lifeCycle = LifeCycle.ENABLE)
rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE)
)
public enum EcoItemsHooker implements ItemPluginHooker {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import crypticlib.lifecycle.TaskRule;

@AutoTask(
rules = @TaskRule(lifeCycle = LifeCycle.ENABLE)
rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE)
)
public enum ExecutableItemsHooker implements ItemPluginHooker {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.bukkit.Bukkit;

@AutoTask(
rules = @TaskRule(lifeCycle = LifeCycle.ENABLE)
rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE)
)
public enum ItemsAdderHooker implements ItemPluginHooker {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import crypticlib.lifecycle.TaskRule;

@AutoTask(
rules = @TaskRule(lifeCycle = LifeCycle.ENABLE)
rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE)
)
public enum MMOItemsHooker implements ItemPluginHooker {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import crypticlib.lifecycle.TaskRule;

@AutoTask(
rules = @TaskRule(lifeCycle = LifeCycle.ENABLE)
rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE)
)
public enum MythicMobs5Hooker implements ItemPluginHooker {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import crypticlib.lifecycle.TaskRule;

@AutoTask(
rules = @TaskRule(lifeCycle = LifeCycle.ENABLE)
rules = @TaskRule(lifeCycle = LifeCycle.ACTIVE)
)
public enum OraxenHooker implements ItemPluginHooker {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down

0 comments on commit 2fef438

Please sign in to comment.