Skip to content

Commit

Permalink
[1.10.12-beta1]更改插件加载流程,修复ItemsAdder4存在时无法正确加载配方的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
YufiriaMazenta committed Oct 26, 2024
1 parent 7295252 commit ed40763
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 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.11"
version = "1.10.12-beta1"

plugins {
`java-library`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,21 @@ public void enable() {
throw new UnsupportedVersionException();
}
CrypticLib.setDebug(PluginConfigs.DEBUG.value());
PluginHookUtil.hookPlugins();

if (PluginHookUtil.isItemsAdderLoaded()) {
Bukkit.getPluginManager().registerEvents(ItemsAdderHandler.INSTANCE, this);
} else {
Bukkit.getPluginManager().registerEvents(this, this);
}

ItemManager.INSTANCE.loadItemManager();
regListeners();
initArcenciel();
loadBStat();

Bukkit.getPluginManager().registerEvents(OtherPluginsListenerProxy.INSTANCE, this);
PluginHookUtil.hookPlugins();
LangUtil.info(Languages.LOAD_FINISH);
UpdateUtil.pullUpdateCheckRequest(Bukkit.getConsoleSender());
}

@Override
Expand All @@ -58,10 +65,6 @@ private void loadBStat() {
metrics.addCustomChart(new Metrics.SingleLineChart("recipes", () -> RecipeManager.INSTANCE.getRecipeGroups().size()));
}

private void regListeners() {
Bukkit.getPluginManager().registerEvents(this, this);
}

private void initArcenciel() {
ArcencielDispatcher.INSTANCE.loadFuncFile();
}
Expand All @@ -83,12 +86,7 @@ public void onPlayerJoin(PlayerJoinEvent event) {

@EventHandler
public void onServerLoad(ServerLoadEvent event) {
if (!PluginHookUtil.isItemsAdderLoaded()) {
RecipeManager.INSTANCE.reloadRecipeManager();
OtherPluginsListenerProxy.INSTANCE.reloadOtherPluginsListener();
return;
}
Bukkit.getPluginManager().registerEvents(ItemsAdderHandler.INSTANCE, this);
UpdateUtil.pullUpdateCheckRequest(Bukkit.getConsoleSender());
RecipeManager.INSTANCE.reloadRecipeManager();
OtherPluginsListenerProxy.INSTANCE.reloadOtherPluginsListener();
}
}

0 comments on commit ed40763

Please sign in to comment.