generated from jaredlll08/MultiLoader-Template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
151 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
plugins { | ||
id 'idea' | ||
id 'net.neoforged.gradle' | ||
id 'org.spongepowered.mixin' | ||
} | ||
|
||
mixin { | ||
add(sourceSets.main, "${mod_id}.refmap.json") | ||
|
||
config("${mod_id}.mixins.json") | ||
config("${mod_id}.neo.mixins.json") | ||
} | ||
|
||
minecraft { | ||
mappings channel: 'official', version: minecraft_version | ||
// Automatically enable forge AccessTransformers if the file exists | ||
// This location is hardcoded in Forge and can not be changed. | ||
// https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123 | ||
if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) { | ||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') | ||
} | ||
} | ||
|
||
dependencies { | ||
minecraft "net.neoforged:forge:${minecraft_version}-${neo_version}" | ||
compileOnly project(":common") | ||
annotationProcessor("org.spongepowered:mixin:0.8.5:processor") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
plugins { | ||
id 'idea' | ||
id 'net.neoforged.gradle' | ||
id 'org.spongepowered.mixin' | ||
} | ||
|
||
mixin { | ||
add(sourceSets.main, "${mod_id}.refmap.json") | ||
|
||
config("${mod_id}.mixins.json") | ||
config("${mod_id}.neo.mixins.json") | ||
} | ||
|
||
minecraft { | ||
mappings channel: 'official', version: minecraft_version | ||
|
||
// Automatically enable forge AccessTransformers if the file exists | ||
// This location is hardcoded in Forge and can not be changed. | ||
// https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123 | ||
if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) { | ||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') | ||
} | ||
|
||
runs { | ||
client { | ||
workingDirectory project.file('run') | ||
ideaModule "${rootProject.name}.${project.name}.main" | ||
taskName 'Client' | ||
property 'mixin.env.remapRefMap', 'true' | ||
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" | ||
mods { | ||
modClientRun { | ||
source sourceSets.main | ||
source project(":common").sourceSets.main | ||
} | ||
} | ||
} | ||
|
||
server { | ||
workingDirectory project.file('run') | ||
ideaModule "${rootProject.name}.${project.name}.main" | ||
taskName 'Server' | ||
property 'mixin.env.remapRefMap', 'true' | ||
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" | ||
mods { | ||
modServerRun { | ||
source sourceSets.main | ||
source project(":common").sourceSets.main | ||
} | ||
} | ||
} | ||
|
||
data { | ||
workingDirectory project.file('run') | ||
ideaModule "${rootProject.name}.${project.name}.main" | ||
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') | ||
taskName 'Data' | ||
property 'mixin.env.remapRefMap', 'true' | ||
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" | ||
mods { | ||
modDataRun { | ||
source sourceSets.main | ||
source project(":common").sourceSets.main | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
sourceSets.main.resources { | ||
srcDirs += project(":forge").file("src/main/resources") | ||
srcDirs += project(":forge").file("src/main/generated/resources") | ||
} | ||
|
||
dependencies { | ||
minecraft "net.neoforged:forge:${minecraft_version}-${neo_version}" | ||
compileOnly project(":common") | ||
implementation project(":forge") transitive(false) | ||
annotationProcessor("org.spongepowered:mixin:0.8.5:processor") | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
source(project(":common").sourceSets.main.allSource) | ||
} | ||
tasks.withType(Javadoc).configureEach { | ||
source(project(":common").sourceSets.main.allJava) | ||
} | ||
tasks.named("sourcesJar", Jar) { | ||
from(project(":common").sourceSets.main.allSource) | ||
} | ||
|
||
processResources { | ||
from project(":common").sourceSets.main.resources | ||
} | ||
|
||
jar.finalizedBy('reobfJar') | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId base.archivesName.get() | ||
from components.java | ||
fg.component(it) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters