Class ContainerManager

java.lang.Object
com.marcusslover.plus.lib.container.ContainerManager

public class ContainerManager extends Object
Manages all containers of the server.
  • Constructor Details

    • ContainerManager

      public ContainerManager()
  • Method Details

    • register

      public void register(@NotNull @NotNull String parent, @NotNull @NotNull AbstractContainer<?> container)
      Registers a new container.
      Parameters:
      parent - Parent folder name.
      container - Instance of the container.
    • init

      public void init(@NotNull @NotNull org.bukkit.plugin.Plugin plugin)
      Initializes all containers.
      Parameters:
      plugin - Plugin instance.
    • shutdown

      public void shutdown()
      You may want to save all containers before the plugin is disabled. It's not a mandatory method, but it's recommended. Additionally, it clears the container map after saving.
    • getByType

      @NotNull public <T extends AbstractContainer<?>> @NotNull Optional<T> getByType(@NotNull @NotNull Class<T> type)
      Finds a container by its type.
      Parameters:
      type - Type of the container.
      Returns:
      Optional of the container.