Class MTCityManager

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

public class MTCityManager extends Object
Class used to retrieve and manage MTCities.
  • Constructor Details

    • MTCityManager

      public MTCityManager()
  • Method Details

    • getInstance

      public static MTCityManager getInstance()
      Get an instance of the MTCityManager
      Returns:
      instance of MTCityManager
    • addCity

      public CompletableFuture<Boolean> addCity(String cityName)
      Enable a WorldGuard region as a MTCity
      Parameters:
      cityName - name of the WorldGuard region
      Returns:
      true if city creation was a success
    • removeCity

      public CompletableFuture<Boolean> removeCity(String cityName)
      Disable MTCity functionality in specified WorldGuard region
      Parameters:
      cityName - name of the WorldGuard region
      Returns:
      true if city removal was a success
    • getMTCities

      public Collection<MTCity> getMTCities()
      Get a collection of MTCities
      Returns:
      collection containing all MTCity objects
    • isSDBEnabled

      public boolean isSDBEnabled(String cityName)
      Check if the provided WorldGuard region is a MTCity
      Parameters:
      cityName - name of WorldGuard region
      Returns:
      true if provided region is a MTCity
    • getMTCity

      public MTCity getMTCity(String cityName)
      Get the MTCity object for the provided WorldGuard region
      Parameters:
      cityName - name of the WorldGuard region
      Returns:
      MTCity object
    • get

      public MTPlace get(org.bukkit.entity.Player player)
      Get the first MTCities at the players' current location
      Parameters:
      player - player
      Returns:
      first MTCity at the players location, or null if none found.
    • getCities

      public List<MTPlace> getCities(org.bukkit.Location location)
      Get all MTCities at the current location
      Parameters:
      location - location
      Returns:
      a list containing all MTCities at the current location, or an empty list if none are found