mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
Remove EagerlyLoaded from MVCommandManager.
This commit is contained in:
parent
8b244e7d3b
commit
e8a33c0cdf
@ -59,6 +59,8 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
|||||||
private Provider<MVWorldManager> worldManagerProvider;
|
private Provider<MVWorldManager> worldManagerProvider;
|
||||||
@Inject
|
@Inject
|
||||||
private Provider<AnchorManager> anchorManagerProvider;
|
private Provider<AnchorManager> anchorManagerProvider;
|
||||||
|
@Inject
|
||||||
|
private Provider<MVCommandManager> commandManagerProvider;
|
||||||
|
|
||||||
// Counter for the number of plugins that have registered with us
|
// Counter for the number of plugins that have registered with us
|
||||||
private int pluginCount;
|
private int pluginCount;
|
||||||
@ -183,8 +185,12 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
|||||||
* Register Multiverse-Core commands to Command Manager.
|
* Register Multiverse-Core commands to Command Manager.
|
||||||
*/
|
*/
|
||||||
private void registerCommands() {
|
private void registerCommands() {
|
||||||
var commandManager = serviceLocator.getService(MVCommandManager.class);
|
Try.of(() -> commandManagerProvider.get())
|
||||||
serviceLocator.getAllServices(MultiverseCommand.class).forEach(commandManager::registerCommand);
|
.andThenTry(commandManager -> {
|
||||||
|
serviceLocator.getAllServices(MultiverseCommand.class)
|
||||||
|
.forEach(commandManager::registerCommand);
|
||||||
|
})
|
||||||
|
.onFailure(throwable -> Logging.severe("Failed to register commands", throwable));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,7 +13,6 @@ import com.onarandombox.MultiverseCore.MultiverseCore;
|
|||||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
||||||
import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlagsManager;
|
import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlagsManager;
|
||||||
import com.onarandombox.MultiverseCore.commandtools.queue.CommandQueueManager;
|
import com.onarandombox.MultiverseCore.commandtools.queue.CommandQueueManager;
|
||||||
import com.onarandombox.MultiverseCore.inject.EagerlyLoaded;
|
|
||||||
import jakarta.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import jakarta.inject.Provider;
|
import jakarta.inject.Provider;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@ -23,7 +22,7 @@ import org.jvnet.hk2.annotations.Service;
|
|||||||
* Main class to manage permissions.
|
* Main class to manage permissions.
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class MVCommandManager extends PaperCommandManager implements EagerlyLoaded {
|
public class MVCommandManager extends PaperCommandManager {
|
||||||
|
|
||||||
private final CommandFlagsManager flagsManager;
|
private final CommandFlagsManager flagsManager;
|
||||||
private final CommandQueueManager commandQueueManager;
|
private final CommandQueueManager commandQueueManager;
|
||||||
|
Loading…
Reference in New Issue
Block a user