Run#
The run{}
closure is inside of mindustry{}
closure hereinafter.
Related tasks: runClient
, runServer
Data Directory#
Mindustry will store saves and settings in the data directory.
Mindustry client will check an environment variable, MINDUSTRY_DATA_DIR
, first.
Default Data Directory#
If the data directory is invalid or not yet set, Mindustry will create the default data directory:
$HOME/.local/share/Mindustry/
%AppData%/Mindustry/
$HOME/Library/Application Support/Mindustry/
Customize Data Directory#
MGPP allows you to customize the location of data directory:
- A path: MGPP will treat it as a directory.
- useDefaultDataDir: MGPP will set it to the default.
- useTempDataDir: MGPP will set it to the temporary directory of task:
- in case of
runClient
, it'sbuildDir/tmp/runClient/data
- in case of
runServer
, it'sbuildDir/tmp/runServer/data
- in case of
- useEnvDataDir: MGPP will check the environment variable,
MINDUSTRY_DATA_DIR
.
run {
dataDir = 'E:/MindustryData'
useDefaultDataDir
useTempDataDir
useEnvDataDir
}
run {
dataDir = 'E:/MindustryData'
useDefaultDataDir
useTempDataDir
useEnvDataDir
}
MGPP will apply the useTempDataDir
as default.
Overwrite from local properties#
You can declare the mgpp.run.dataDir
in local.properties
file to
overwrite the customized and default data directory
mgpp.run.dataDir=default
Forcibly Clear#
Whether to delete all mods other than any from ModsSpec.worksWith in the data directory, ensure you have backed up your mods if it's on.
- clearOtherMods: To clear all things in the data directory.
- keepOtherMods: To keep anything in the data directory.
run {
clearOtherMods
// OR
keepOtherMods
}
run {
clearOtherMods
// OR
keepOtherMods
}
MGPP will apply the keepOtherMods
as default.
Overwrite from local properties#
You can declare the mgpp.run.forciblyClear
in local.properties
file to overwrite this behavior.
TYPE: Boolean { true, false }
mgpp.run.forciblyClear=true