mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 14:38:52 +00:00
Offload importer registration from initialization
This commit is contained in:
3 files changed
+13
No files matched your search
@@ -48,6 +48,7 @@ public class HuskHomesCommand extends Command implements TabProvider {
|
||||
"update", true
|
||||
);
|
||||
|
||||
private boolean importersLoaded = false;
|
||||
private final UpdateChecker updateChecker;
|
||||
private final AboutMenu aboutMenu;
|
||||
|
||||
@@ -117,6 +118,10 @@ public class HuskHomesCommand extends Command implements TabProvider {
|
||||
plugin.getVersion().toString()).ifPresent(executor::sendMessage);
|
||||
});
|
||||
case "import" -> {
|
||||
if (!importersLoaded) {
|
||||
importersLoaded = true;
|
||||
plugin.registerImporters();
|
||||
}
|
||||
if (plugin.getImporters().isEmpty()) {
|
||||
plugin.getLocales().getLocale("error_no_importers_available")
|
||||
.ifPresent(executor::sendMessage);
|
||||
|
||||
Reference in new issue
Block a user