Package mindustry.maps
Class Maps
java.lang.Object
mindustry.maps.Maps
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic arc.func.Prov<GenerateFilter>[]All generation filter types. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDefaultOres(arc.struct.Seq<GenerateFilter> filters) arc.struct.Seq<Map>all()Returns a list of all maps, including custom ones.arc.struct.Seq<Map>Returns a list of only custom maps.arc.struct.Seq<Map>Returns a list of only default maps.getNextMap(Gamemode mode, Map previous) voidimportMap(arc.files.Fi file) Import a map, then save it.voidload()Load all maps.loadInternalMap(String name) Loads a map from the map folder and returns it.voidvoidqueueNewPreview(Map map) arc.struct.Seq<GenerateFilter>readFilters(String str) Reads JSON of filters, returning a new default array if not found.arc.struct.Seq<SpawnGroup>voidreload()voidRemoves a map completely.Save a custom map to the directory.voidsetMapProvider(Maps.MapProvider provider) Set the provider for the map(s) to be played on.voidsetNextMapOverride(Map nextMapOverride) Set the map that will override the next selected map.voidvoidtryCatchMapError(arc.util.UnsafeRunnable run) Attempts to run the following code; catches any errors and attempts to display them in a readable way.writeWaves(arc.struct.Seq<SpawnGroup> groups)
-
Field Details
-
allFilterTypes
All generation filter types.
-
-
Constructor Details
-
Maps
public Maps()
-
-
Method Details
-
getShuffleMode
-
setShuffleMode
-
setMapProvider
Set the provider for the map(s) to be played on. Will override the default shuffle mode setting. -
setNextMapOverride
Set the map that will override the next selected map. -
getNextMap
- Returns:
- the next map to shuffle to. May be null, in which case the server should be stopped.
-
all
Returns a list of all maps, including custom ones. -
customMaps
Returns a list of only custom maps. -
defaultMaps
Returns a list of only default maps. -
byName
-
loadInternalMap
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
Save a custom map to the directory. This updates all values and stored data necessary. The tags are copied to prevent mutation later. -
importMap
Import a map, then save it. This updates all values and stored data necessary.- Throws:
IOException
-
tryCatchMapError
public void tryCatchMapError(arc.util.UnsafeRunnable run) Attempts to run the following code; catches any errors and attempts to display them in a readable way. -
removeMap
Removes a map completely. -
readFilters
Reads JSON of filters, returning a new default array if not found. -
addDefaultOres
-
writeWaves
-
readWaves
-
loadPreviews
public void loadPreviews() -
queueNewPreview
-