Class MTWorldManager

java.lang.Object
nl.minetopiasdb.api.mtplaces.MTWorldManager

public class MTWorldManager extends Object
Class used to retrieve and manage MTWorlds.
  • Constructor Details

    • MTWorldManager

      public MTWorldManager()
  • Method Details

    • getInstance

      public static MTWorldManager getInstance()
      Get an instance of the MTWorldManager
      Returns:
      instance of MTWorldManager
    • addWorld

      public CompletableFuture<Boolean> addWorld(String worldName)
      Enable a world as a MTWorld
      Parameters:
      worldName - name of the world
      Returns:
      true if world creation was a success
    • removeWorld

      public CompletableFuture<Boolean> removeWorld(String world)
      Disable MinetopiaSDB in the provided world
      Parameters:
      world - the world where MinetopiaSDB should be disabled
      Returns:
      true if MinetopiaSDB has been disabled successfully
    • getMTWorlds

      public Collection<MTWorld> getMTWorlds()
      Get a collection of MTWorlds
      Returns:
      collection containing all MTWorld objects
    • getWorldNames

      public Collection<String> getWorldNames()
      Get a collection containing the lowercase names of all worlds where MinetopiaSDB is active in
      Returns:
      collection containing the lowercase name of all MTWorlds
    • isSDBEnabled

      public boolean isSDBEnabled(org.bukkit.World world)
      Check if Minetopia is active in the current world
      Parameters:
      world - world object
      Returns:
      true if SDB is enabled in this world
    • isSDBEnabled

      public boolean isSDBEnabled(String worldName)
      Check if Minetopia is active in the current world
      Parameters:
      worldName - name of the world
      Returns:
      true if SDB is enabled in this world
    • getMTWorld

      public MTWorld getMTWorld(String worldName)
      Get the MTWorld object for the provided world
      Parameters:
      worldName - name of the world
      Returns:
      MTWorld object
    • initWorlds

      public void initWorlds(boolean force)
      Fill the MTWorld cache if it hasn't been filled already (never necessary to do manually)
      Parameters:
      force - if force is true, the MTWorld cache gets reinitialised