mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
Use Provider for MultiverseCorePlaceholders in MultiverseCore.
This commit is contained in:
parent
573b424efe
commit
1f134d4501
@ -64,6 +64,8 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
||||
private Provider<DestinationsProvider> destinationsProviderProvider;
|
||||
@Inject
|
||||
private Provider<MetricsConfigurator> metricsConfiguratorProvider;
|
||||
@Inject
|
||||
private Provider<MultiverseCorePlaceholders> placeholdersProvider;
|
||||
|
||||
// Counter for the number of plugins that have registered with us
|
||||
private int pluginCount;
|
||||
@ -252,10 +254,9 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
||||
|
||||
private void setupPlaceholderAPI() {
|
||||
if(getServer().getPluginManager().getPlugin("PlaceholderAPI") != null) {
|
||||
var placeholders = serviceLocator.getService(MultiverseCorePlaceholders.class);
|
||||
if (placeholders != null) {
|
||||
placeholders.register();
|
||||
}
|
||||
Try.of(() -> placeholdersProvider.get())
|
||||
.onSuccess(MultiverseCorePlaceholders::register)
|
||||
.onFailure(e -> Logging.severe("Failed to load PlaceholderAPI integration.", e));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user