Interface WorldManager

All Superinterfaces:
Manager
All Known Implementing Classes:
SlimeWorldManager, VanillaWorldManager

public interface WorldManager extends Manager

WorldManager

This interface represents a manager, that loads and unloads worlds.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull CompletableFuture<org.bukkit.World>
    createWorld(@NotNull org.bukkit.WorldCreator creator, @NotNull Planet planet)
    Creates a new world.
    @NotNull CompletableFuture<org.bukkit.World>
    loadWorld(@NotNull org.bukkit.WorldCreator creator, @NotNull Planet planet)
    Loads world.
    unloadWorld(@Nullable org.bukkit.World world, boolean save, @NotNull Planet planet)
    Unloads world.

    Methods inherited from interface ua.mcchickenstudio.opencreative.managers.Manager

    getName
  • Method Details

    • createWorld

      @NotNull @NotNull CompletableFuture<org.bukkit.World> createWorld(@NotNull @NotNull org.bukkit.WorldCreator creator, @NotNull @NotNull Planet planet)
      Creates a new world.

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

      Parameters:
      creator - world creator with world info.
      planet - planet of world.
      Returns:
      future with world, or error - if failed to load.
    • loadWorld

      @NotNull @NotNull CompletableFuture<org.bukkit.World> loadWorld(@NotNull @NotNull org.bukkit.WorldCreator creator, @NotNull @NotNull Planet planet)
      Loads world.

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

      Parameters:
      creator - world creator with world info.
      planet - planet of world.
      Returns:
      future with world, or error - if failed to load.
    • unloadWorld

      @NotNull @NotNull CompletableFuture<Void> unloadWorld(@Nullable @Nullable org.bukkit.World world, boolean save, @NotNull @NotNull Planet planet)
      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).

      Parameters:
      world - world to unload.
      save - save or don't save.
      planet - planet of world.
      Returns:
      future.