Class VanillaWorldManager

java.lang.Object
ua.mcchickenstudio.opencreative.managers.worlds.VanillaWorldManager
All Implemented Interfaces:
Manager, WorldManager

public final class VanillaWorldManager extends Object implements WorldManager

VanillaWorldManager

This class represents a manager, that loads and unloads worlds using Paper methods.
  • Constructor Details

    • VanillaWorldManager

      public VanillaWorldManager()
  • Method Details

    • getName

      @NotNull public @NotNull String getName()
      Description copied from interface: Manager
      Returns name of manager, that will be displayed by request in the logs.
      Specified by:
      getName in interface Manager
      Returns:
      name of manager.
    • createWorld

      @NotNull public @NotNull CompletableFuture<org.bukkit.World> createWorld(@NotNull @NotNull org.bukkit.WorldCreator creator, @NotNull @NotNull Planet planet)
      Description copied from interface: WorldManager
      Creates a new world.

      If specified world is already loaded, it will return that world.

      Specified by:
      createWorld in interface WorldManager
      Parameters:
      creator - world creator with world info.
      planet - planet of world.
      Returns:
      future with world, or error - if failed to load.
    • loadWorld

      @NotNull public @NotNull CompletableFuture<org.bukkit.World> loadWorld(@NotNull @NotNull org.bukkit.WorldCreator creator, @NotNull @NotNull Planet planet)
      Description copied from interface: WorldManager
      Loads world.

      If specified world is already loaded, it will return that world.

      Specified by:
      loadWorld in interface WorldManager
      Parameters:
      creator - world creator with world info.
      planet - planet of world.
      Returns:
      future with world, or error - if failed to load.
    • unloadWorld

      @NotNull public @NotNull CompletableFuture<Void> unloadWorld(@Nullable @Nullable org.bukkit.World world, boolean save, @NotNull @NotNull Planet planet)
      Description copied from interface: WorldManager
      Unloads world.

      NOTE: When using async methods, please check OpenCreative.getPlugin().isEnabled() to make sure if plugin can schedule async tasks or not (when server is shutting down).

      Specified by:
      unloadWorld in interface WorldManager
      Parameters:
      world - world to unload.
      save - save or don't save.
      planet - planet of world.
      Returns:
      future.