https://github.com/neoforged/ModDevGradle ModDevGradle is a alternative to NeoGradle that in my experience is faster and provides a better development experience. MDG also offers an easy 'vanilla' mode, so it has replaced VanillaGradle as well.
46 lines
1.5 KiB
Groovy
46 lines
1.5 KiB
Groovy
plugins {
|
|
id 'multiloader-common'
|
|
id 'net.neoforged.moddev'
|
|
}
|
|
|
|
neoForge {
|
|
neoFormVersion = neo_form_version
|
|
// Automatically enable AccessTransformers if the file exists
|
|
// While this location can be changed, it is recommended for
|
|
// common and neoforge to share an accesstransformer file
|
|
// and this location is hardcoded in FML
|
|
// https://github.com/neoforged/FancyModLoader/blob/a952595eaaddd571fbc53f43847680b00894e0c1/loader/src/main/java/net/neoforged/fml/loading/moddiscovery/ModFile.java#L118
|
|
def at = file('src/main/resources/META-INF/accesstransformer.cfg')
|
|
if (at.exists()) {
|
|
accessTransformers.add(at.absolutePath)
|
|
}
|
|
parchment {
|
|
minecraftVersion = parchment_minecraft
|
|
mappingsVersion = parchment_version
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
|
|
// fabric and neoforge both bundle mixinextras, so it is safe to use it in common
|
|
compileOnly group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5'
|
|
annotationProcessor group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5'
|
|
}
|
|
|
|
configurations {
|
|
commonJava {
|
|
canBeResolved = false
|
|
canBeConsumed = true
|
|
}
|
|
commonResources {
|
|
canBeResolved = false
|
|
canBeConsumed = true
|
|
}
|
|
}
|
|
|
|
artifacts {
|
|
commonJava sourceSets.main.java.sourceDirectories.singleFile
|
|
commonResources sourceSets.main.resources.sourceDirectories.singleFile
|
|
}
|
|
|