For project that forked from Anuke's mod template use this guide
-
Add this property block in
/build.gradle
wherever you like (as long as it's done in project evaluation, that is):mindustryModCore{ //... }
Recommended to set project info
More information about extension -
Add the line
EntityRegistry.register();
(from thegenPackage
) in your mod class'loadContent()
method. -
Refer to usage for more detailed entity annotation usages.
-
Compile and use the mod as the guide in the mod template says.
Configuration in gradle.properties
-
changes name for task jarMindustry
-
changes name for function
modCoreModule(String module)
(see addMindustryModCore) -
make build faster by disabling kotlin compile tasks
WARNING: do not set totrue
in mods that uses kotlin
depends on jar.
Copies a file to mindustry folders specified in outputDirectories.txt
(each line is separated folder) file.
If file not exists copies in default mindustry path.
classic
- default mindustry path
Comments starts with #
or //
C:\Users\Zelaux\Desktop\Mindustry\server\config\mods
#C:\Users\Zelaux\Desktop\Mindustry\client\mods
classic
-
rootDirectory
- directory from which other paths are calculated. -
assertsPath
- path to yourassets
folder fromrootDirectory
. -
assertsRawPath
- path to yourassets-raw
folder fromrootDirectory
. -
modInfoPath
- path to yourmod.(h)json
orplugin.(h)json
fromrootDirectory
. -
rootPackage
- your main package. -
revisionsPath
- path to store revision for entity generation. -
classPrefix
- sets class prefix for some generated class likeCall
,EntityMapping
, etc.Example from xstabux/Omaloon:
mindustryModCore{ projectInfo{ rootDirectory = rootDir assetsPath = "assets" assetsRawPath = "assets" rootPackage = "omaloon" modInfoPath = "mod.json" revisionsPath = "revisions" classPrefix = "OL" } }
-
- adds repository for MindustryModCore
- adds method
modCoreModule(String module)
mindustryModCore{ addMindustryModCore() } dependencies{ implementation modCoreModule("core") implementation modCoreModule("utils") implementation modCoreModule("graphics") }
-
- adds repository for ArcLibrary
- adds method
arcLibraryModule(String module)
mindustryModCore{ addArcLibrary() } dependencies{ implementation arcLibraryModule("utils-io") implementation arcLibraryModule("graphics-dashDraw") }
-
Prepare project to write AnnotationProcessors
- Adds task
writeAnnotationProcessors
invokes when you try to compile this project(createsMETA-INF/services/javax.annotation.processing.Processor
)
- Adds task
-
Prepare project to use kapt annotation processors
mindustryModCore{ addMindustryModCore() addKaptAnnotations() } dependencies{ kapt modCoreModule("annotations") kapt project(":annotations") }
-
Added custom repository for maven repositories on github
repositories{ githubRepo("Anuken","MindustryMaven") githubRepo("Zelaux","Repo") }