Package mindustry.maps
Class Maps
java.lang.Object
mindustry.maps.Maps
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDefaultOres
(Seq<GenerateFilter> filters) all()
Returns a list of all maps, including custom ones.Returns a list of only custom maps.Returns a list of only default maps.getNextMap
(Gamemode mode, Map previous) void
Import a map, then save it.void
load()
Load all maps.loadInternalMap
(String name) Loads a map from the map folder and returns it.void
void
queueNewPreview
(Map map) readFilters
(String str) Reads JSON of filters, returning a new default array if not found.void
reload()
void
Removes a map completely.Save a custom map to the directory.void
setMapProvider
(Maps.MapProvider provider) Set the provider for the map(s) to be played on.void
setNextMapOverride
(Map nextMapOverride) Set the map that will override the next selected map.void
void
Attempts to run the following code; catches any errors and attempts to display them in a readable way.writeWaves
(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
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
-