Class Maps

java.lang.Object
mindustry.maps.Maps

public class Maps extends Object
  • Field Details

    • allFilterTypes

      public static Prov<GenerateFilter>[] allFilterTypes
      All generation filter types.
  • Constructor Details

    • Maps

      public Maps()
  • Method Details

    • getShuffleMode

      public Maps.ShuffleMode getShuffleMode()
    • setShuffleMode

      public void setShuffleMode(Maps.ShuffleMode mode)
    • setMapProvider

      public void setMapProvider(Maps.MapProvider provider)
      Set the provider for the map(s) to be played on. Will override the default shuffle mode setting.
    • setNextMapOverride

      public void setNextMapOverride(Map nextMapOverride)
      Set the map that will override the next selected map.
    • getNextMap

      @Nullable public Map getNextMap(Gamemode mode, @Nullable Map previous)
      Returns:
      the next map to shuffle to. May be null, in which case the server should be stopped.
    • all

      public Seq<Map> all()
      Returns a list of all maps, including custom ones.
    • customMaps

      public Seq<Map> customMaps()
      Returns a list of only custom maps.
    • defaultMaps

      public Seq<Map> defaultMaps()
      Returns a list of only default maps.
    • byName

      public Map byName(String name)
    • loadInternalMap

      public Map loadInternalMap(String name)
      Loads a map from the map folder and returns it. Should only be used for zone maps. Does not add this map to the map list.
    • load

      public void load()
      Load all maps. Should be called at application start.
    • reload

      public void reload()
    • saveMap

      public Map saveMap(ObjectMap<String,String> baseTags)
      Save a custom map to the directory. This updates all values and stored data necessary. The tags are copied to prevent mutation later.
    • importMap

      public void importMap(Fi file) throws IOException
      Import a map, then save it. This updates all values and stored data necessary.
      Throws:
      IOException
    • tryCatchMapError

      public void tryCatchMapError(UnsafeRunnable run)
      Attempts to run the following code; catches any errors and attempts to display them in a readable way.
    • removeMap

      public void removeMap(Map map)
      Removes a map completely.
    • readFilters

      public Seq<GenerateFilter> readFilters(String str)
      Reads JSON of filters, returning a new default array if not found.
    • addDefaultOres

      public void addDefaultOres(Seq<GenerateFilter> filters)
    • writeWaves

      public String writeWaves(Seq<SpawnGroup> groups)
    • readWaves

      public Seq<SpawnGroup> readWaves(String str)
    • loadPreviews

      public void loadPreviews()
    • queueNewPreview

      public void queueNewPreview(Map map)