Class VanillaWorldManager
java.lang.Object
ua.mcchickenstudio.opencreative.managers.worlds.VanillaWorldManager
- All Implemented Interfaces:
Manager,WorldManager
VanillaWorldManager
This class represents a manager, that loads and unloads worlds using Paper methods.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull CompletableFuture<org.bukkit.World> createWorld(@NotNull org.bukkit.WorldCreator creator, @NotNull Planet planet) Creates a new world.@NotNull StringgetName()Returns name of manager, that will be displayed by request in the logs.@NotNull CompletableFuture<org.bukkit.World> Loads world.@NotNull CompletableFuture<Void> unloadWorld(@Nullable org.bukkit.World world, boolean save, @NotNull Planet planet) Unloads world.
-
Constructor Details
-
VanillaWorldManager
public VanillaWorldManager()
-
-
Method Details
-
getName
Description copied from interface:ManagerReturns name of manager, that will be displayed by request in the logs. -
createWorld
@NotNull public @NotNull CompletableFuture<org.bukkit.World> createWorld(@NotNull @NotNull org.bukkit.WorldCreator creator, @NotNull @NotNull Planet planet) Description copied from interface:WorldManagerCreates a new world.If specified world is already loaded, it will return that world.
- Specified by:
createWorldin interfaceWorldManager- 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:WorldManagerLoads world.If specified world is already loaded, it will return that world.
- Specified by:
loadWorldin interfaceWorldManager- 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:WorldManagerUnloads 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:
unloadWorldin interfaceWorldManager- Parameters:
world- world to unload.save- save or don't save.planet- planet of world.- Returns:
- future.
-