mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-02-16 12:31:59 +01:00
Remove EagerlyLoaded from MVEconomist.
This commit is contained in:
parent
6f86416310
commit
52a2ff78c8
@ -24,6 +24,7 @@ import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
|
||||
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
|
||||
import com.onarandombox.MultiverseCore.config.MVCoreConfigProvider;
|
||||
import com.onarandombox.MultiverseCore.destination.DestinationsProvider;
|
||||
import com.onarandombox.MultiverseCore.economy.MVEconomist;
|
||||
import com.onarandombox.MultiverseCore.inject.InjectableListener;
|
||||
import com.onarandombox.MultiverseCore.inject.PluginInjection;
|
||||
import com.onarandombox.MultiverseCore.placeholders.MultiverseCorePlaceholders;
|
||||
@ -66,6 +67,8 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
||||
private Provider<MetricsConfigurator> metricsConfiguratorProvider;
|
||||
@Inject
|
||||
private Provider<MultiverseCorePlaceholders> placeholdersProvider;
|
||||
@Inject
|
||||
private Provider<MVEconomist> economistProvider;
|
||||
|
||||
// Counter for the number of plugins that have registered with us
|
||||
private int pluginCount;
|
||||
@ -123,8 +126,7 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
||||
}
|
||||
|
||||
//Setup economy here so vault is loaded
|
||||
// TODO we may need to change MVEconomist to have an enable method or something
|
||||
// this.economist = new MVEconomist(this);
|
||||
this.loadEconomist();
|
||||
|
||||
// Init all the other stuff
|
||||
this.loadAnchors();
|
||||
@ -171,6 +173,11 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
||||
return !getConfigProvider().getConfig().getSilentStart();
|
||||
}
|
||||
|
||||
private void loadEconomist() {
|
||||
Try.run(() -> economistProvider.get())
|
||||
.onFailure(e -> Logging.severe("Failed to load economy integration", e));
|
||||
}
|
||||
|
||||
private void loadAnchors() {
|
||||
Try.of(() -> anchorManagerProvider.get())
|
||||
.onSuccess(AnchorManager::loadAnchors)
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.onarandombox.MultiverseCore.economy;
|
||||
|
||||
import com.onarandombox.MultiverseCore.inject.EagerlyLoaded;
|
||||
import jakarta.inject.Inject;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
@ -13,7 +12,7 @@ import org.jvnet.hk2.annotations.Service;
|
||||
* Multiverse's Friendly Economist. This is used to deal with external economies and also item costs for stuff in MV.
|
||||
*/
|
||||
@Service
|
||||
public class MVEconomist implements EagerlyLoaded {
|
||||
public class MVEconomist {
|
||||
|
||||
private final VaultHandler vaultHandler;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user