Package org.mvplugins.multiverse.core
Class MultiverseCoreApi
java.lang.Object
org.mvplugins.multiverse.core.MultiverseCoreApi
Provides access to the MultiverseCore API.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull MultiverseCoreApi
get()
Gets the MultiverseCoreApi.@NotNull AnchorManager
Gets the instance of AnchorManager.@NotNull BiomeProviderFactory
Gets the instance of BiomeProviderFactory.@NotNull BlockSafety
Gets the instance of BlockSafety.@NotNull CoreConfig
Gets the instance of CoreConfig.@NotNull DestinationsProvider
Gets the instance of DestinationsProvider.@NotNull GeneratorProvider
Gets the instance of GeneratorProvider.@NotNull LocationManipulation
Gets the instance of LocationManipulation.@NotNull MVEconomist
Gets the instance of MVEconomist.@NotNull AsyncSafetyTeleporter
Gets the instance of SafetyTeleporter.@NotNull PluginServiceLocator
Gets the instance of Multiverse-Core's PluginServiceLocator.@NotNull WorldManager
Gets the instance of WorldManager.static boolean
isLoaded()
Checks if the MultiverseCoreApi has been initialized.static void
whenLoaded
(@NotNull Consumer<MultiverseCoreApi> consumer) Hook your plugin into the MultiverseCoreApi here to ensure you only start using the API after it has been initialized.
-
Method Details
-
whenLoaded
@AvailableSince("5.1") public static void whenLoaded(@NotNull @NotNull Consumer<MultiverseCoreApi> consumer) Hook your plugin into the MultiverseCoreApi here to ensure you only start using the API after it has been initialized. Use this if you know your plugin may load before Multiverse-Core is fully initialized.
This handy method removes the need for you to check with plugin manager or listen to plugin enable event.
Callback will be called immediately if the MultiverseCoreApi has already been initialized.- Parameters:
consumer
- The callback to execute when the MultiverseCoreApi has been initialized.- Since:
- 5.1
-
isLoaded
@AvailableSince("5.1") public static boolean isLoaded()Checks if the MultiverseCoreApi has been initialized.- Returns:
- True if the MultiverseCoreApi has been initialized, false otherwise
- Since:
- 5.1
-
get
Gets the MultiverseCoreApi. This will throw an exception if the Multiverse-Core has not been initialized.
You can check if the MultiverseCoreApi has been initialized withisLoaded()
before using this method.
Alternatively, you can usewhenLoaded(Consumer)
to hook into the MultiverseCoreApi if your plugin may load before Multiverse-Core is fully initialized.- Returns:
- The MultiverseCoreApi
- Throws:
IllegalStateException
- if the MultiverseCoreApi has not been initialized
-
getAnchorManager
Gets the instance of AnchorManager.- Returns:
- The AnchorManager instance
-
getBiomeProviderFactory
Gets the instance of BiomeProviderFactory.- Returns:
- The BiomeProviderFactory instance
-
getBlockSafety
Gets the instance of BlockSafety.- Returns:
- The BlockSafety instance
-
getCoreConfig
Gets the instance of CoreConfig.- Returns:
- The CoreConfig instance
-
getDestinationsProvider
Gets the instance of DestinationsProvider.- Returns:
- The DestinationsProvider instance
-
getGeneratorProvider
Gets the instance of GeneratorProvider.- Returns:
- The GeneratorProvider instance
-
getLocationManipulation
Gets the instance of LocationManipulation.- Returns:
- The LocationManipulation instance
-
getMVEconomist
Gets the instance of MVEconomist.- Returns:
- The MVEconomist instance
-
getSafetyTeleporter
Gets the instance of SafetyTeleporter.- Returns:
- The SafetyTeleporter instance
-
getWorldManager
Gets the instance of WorldManager.- Returns:
- The WorldManager instance
-
getServiceLocator
Gets the instance of Multiverse-Core's PluginServiceLocator.
You can use this to hook into the hk2 dependency injection system used by Multiverse-Core.- Returns:
- The Multiverse-Core's PluginServiceLocator
-