Class MultiverseCoreApi

java.lang.Object
org.mvplugins.multiverse.core.MultiverseCoreApi

public class MultiverseCoreApi extends Object
Provides access to the MultiverseCore API.
  • 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

      @NotNull public static @NotNull MultiverseCoreApi 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 with isLoaded() before using this method.
      Alternatively, you can use whenLoaded(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

      @NotNull public @NotNull AnchorManager getAnchorManager()
      Gets the instance of AnchorManager.
      Returns:
      The AnchorManager instance
    • getBiomeProviderFactory

      @NotNull public @NotNull BiomeProviderFactory getBiomeProviderFactory()
      Gets the instance of BiomeProviderFactory.
      Returns:
      The BiomeProviderFactory instance
    • getBlockSafety

      @NotNull public @NotNull BlockSafety getBlockSafety()
      Gets the instance of BlockSafety.
      Returns:
      The BlockSafety instance
    • getCoreConfig

      @NotNull public @NotNull CoreConfig getCoreConfig()
      Gets the instance of CoreConfig.
      Returns:
      The CoreConfig instance
    • getDestinationsProvider

      @NotNull public @NotNull DestinationsProvider getDestinationsProvider()
      Gets the instance of DestinationsProvider.
      Returns:
      The DestinationsProvider instance
    • getGeneratorProvider

      @NotNull public @NotNull GeneratorProvider getGeneratorProvider()
      Gets the instance of GeneratorProvider.
      Returns:
      The GeneratorProvider instance
    • getLocationManipulation

      @NotNull public @NotNull LocationManipulation getLocationManipulation()
      Gets the instance of LocationManipulation.
      Returns:
      The LocationManipulation instance
    • getMVEconomist

      @NotNull public @NotNull MVEconomist getMVEconomist()
      Gets the instance of MVEconomist.
      Returns:
      The MVEconomist instance
    • getSafetyTeleporter

      @NotNull public @NotNull AsyncSafetyTeleporter getSafetyTeleporter()
      Gets the instance of SafetyTeleporter.
      Returns:
      The SafetyTeleporter instance
    • getWorldManager

      @NotNull public @NotNull WorldManager getWorldManager()
      Gets the instance of WorldManager.
      Returns:
      The WorldManager instance
    • getServiceLocator

      @NotNull public @NotNull PluginServiceLocator 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