@@ -2,194 +2,96 @@ buildscript {
22 repositories {
33 maven { url = ' https://maven.minecraftforge.net/' }
44 maven { url = ' https://repo.spongepowered.org/repository/maven-public/' }
5+ mavenCentral()
56 }
67 dependencies {
7- classpath ' org.spongepowered:mixingradle:0.7 -SNAPSHOT'
8+ classpath ' net.minecraftforge.gradle:ForgeGradle:2.3 -SNAPSHOT'
89 }
910}
1011
11- plugins {
12- id ' eclipse'
13- id ' idea'
14- id ' maven-publish'
15- id ' net.minecraftforge.gradle' version ' 5.1.+'
16- }
12+ apply plugin : ' net.minecraftforge.gradle.forge'
13+ apply plugin : ' eclipse'
14+ apply plugin : ' idea'
15+ apply plugin : ' maven-publish'
1716
1817version = mod_version
1918group = mod_group_id
19+ archivesBaseName = mod_id
2020
21- base {
22- archivesName = mod_id
23- }
24-
25- sourceCompatibility = targetCompatibility = ' 1.8'
21+ sourceCompatibility = targetCompatibility = compileJava. sourceCompatibility = compileJava. targetCompatibility = ' 1.8'
2622
2723println " Java: ${ System.getProperty 'java.version'} , JVM: ${ System.getProperty 'java.vm.version'} (${ System.getProperty 'java.vendor'} ), Arch: ${ System.getProperty 'os.arch'} "
28- minecraft {
29- // The mappings can be changed at any time and must be in the following format.
30- // Channel: Version:
31- // official MCVersion Official field/method names from Mojang mapping files
32- // parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
33- //
34- // You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
35- // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
36- //
37- // Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
38- // Additional setup is needed to use their mappings: https://parchmentmc.org/docs/getting-started
39- //
40- // Use non-default mappings at your own risk. They may not always work.
41- // Simply re-run your setup task after changing the mappings to update your workspace.
42- mappings channel : mapping_channel, version : mapping_version
43-
44- // When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game.
45- // In most cases, it is not necessary to enable.
46- // enableEclipsePrepareRuns = true
47- // enableIdeaPrepareRuns = true
48-
49- // When true, this property will add the folder name of all declared run configurations to generated IDE run configurations.
50- // The folder name can be set on a run configuration using the "folderName" property.
51- // By default, the folder name of a run configuration is the name of the Gradle project containing it.
52- // generateRunFolders = true
53-
54- // This property enables access transformers for use in development.
55- // They will be applied to the Minecraft artifact.
56- // The access transformer file can be anywhere in the project.
57- // However, it must be at "META-INF/accesstransformer.cfg" in the final mod jar to be loaded by Forge.
58- // This default location is a best practice to automatically put the file in the right place in the final jar.
59- // See https://docs.minecraftforge.net/en/latest/advanced/accesstransformers/ for more information.
60- // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
61-
62- // Default run configurations.
63- // These can be tweaked, removed, or duplicated as needed.
64- runs {
65- // applies to all the run configs below
66- configureEach {
67- workingDirectory project. file(' run' )
68-
69- // Recommended logging data for a userdev environment
70- // The markers can be added/remove as needed separated by commas.
71- // "SCAN": For mods scan.
72- // "REGISTRIES": For firing of registry events.
73- // "REGISTRYDUMP": For getting the contents of all registries.
74- property ' forge.logging.markers' , ' REGISTRIES'
7524
76- // Recommended logging level for the console
77- // You can set various levels here.
78- // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
79- property ' forge.logging.console.level' , ' debug'
80- mods {
81- " ${ mod_id} " {
82- source sourceSets. main
83- }
84- }
85- }
86-
87- client {
88- }
89-
90- server {
91- args ' --nogui'
92- }
93-
94- data {
95- // example of overriding the workingDirectory set in configureEach above
96- workingDirectory project. file(' run-data' )
97-
98- // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
99- args ' --mod' , mod_id, ' --all' , ' --output' , file(' src/generated/resources/' ), ' --existing' , file(' src/main/resources/' )
100- }
101- }
25+ minecraft {
26+ version = " ${ minecraft_version} -${ forge_version} "
27+ mappings = " ${ mapping_channel} _${ mapping_version.tokenize('-')[0]} "
28+ runDir = ' run'
29+ useDepAts = true
30+ clientJvmArgs + = [' -Dfml.coreMods.load=com.neofastftl.infinitypattern.mixins.IFPATMixinPlugin' ]
31+ serverJvmArgs + = [' -Dfml.coreMods.load=com.neofastftl.infinitypattern.mixins.IFPATMixinPlugin' ]
10232}
10333
104- // Include resources generated by data generators.
105- sourceSets. main. resources { srcDir ' src/generated/resources' }
106-
10734repositories {
108- maven {
109- url " https://cursemaven.com"
110- }
35+ maven { url = ' https://repo.spongepowered.org/repository/maven-public/' }
36+ maven { url = ' https://www.cursemaven.com' }
11137}
112- dependencies {
113- // Specify the version of Minecraft to use.
114- // Any artifact can be supplied so long as it has a "userdev" classifier artifact and is a compatible patcher artifact.
115- // The "userdev" classifier will be requested and setup by ForgeGradle.
116- // If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
117- // then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
118- minecraft " net.minecraftforge:forge:${ minecraft_version} -${ forge_version} "
119-
120- runtimeOnly fg. deobf(" curse.maven:jei-238222:5846870" )
121- implementation fg. deobf(" curse.maven:applied-energistics-2-223794:3571836" )
122- // Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings
123- // The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
124- // compileOnly fg.deobf("mezz.jei:jei-${mc_version}-common-api:${jei_version}")
125- // compileOnly fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}")
126- // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}")
12738
128- // Example mod dependency using a mod jar from ./libs with a flat dir repository
129- // This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
130- // The group id is ignored when searching -- in this case, it is "blank"
131- // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
132-
133- // For more info:
134- // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
135- // http://www.gradle.org/docs/current/userguide/dependency_management.html
39+ dependencies {
40+ deobfCompile ' curse.maven:applied-energistics-2-223794:2747063 '
41+ deobfCompile ' curse.maven:jei-238222:5846804 '
42+ compile( ' org.spongepowered:mixin:0.7.11-SNAPSHOT ' ) {
43+ exclude group : ' com.google.code.gson ' , module : ' gson '
44+ exclude group : ' com.google.guava ' , module : ' guava '
45+ }
46+ runtime ' com.google.code.gson:gson:2.8.9 '
13647}
13748
138- // This block of code expands all declared replace properties in the specified resource targets.
139- // A missing property will result in an error. Properties are expanded using ${} Groovy notation.
140- // When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
141- // See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
142- tasks. named(' processResources' , ProcessResources ). configure {
143- var replaceProperties = [
144- minecraft_version : minecraft_version, minecraft_version_range : minecraft_version_range,
145- forge_version : forge_version, forge_version_range : forge_version_range,
146- loader_version_range : loader_version_range,
147- mod_id : mod_id, mod_name : mod_name, mod_license : mod_license, mod_version : mod_version,
148- mod_authors : mod_authors, mod_description : mod_description,
149- ]
150- inputs. properties replaceProperties
49+ processResources {
50+ inputs. property ' mod_id' , mod_id
51+ inputs. property ' mod_name' , mod_name
52+ inputs. property ' mod_version' , mod_version
53+ inputs. property ' mod_authors' , mod_authors
54+ inputs. property ' mod_description' , mod_description
55+ inputs. property ' minecraft_version' , minecraft_version
56+
57+ from(sourceSets. main. resources. srcDirs) {
58+ include ' mcmod.info'
59+ expand(
60+ mod_id : mod_id,
61+ mod_name : mod_name,
62+ mod_version : mod_version,
63+ mod_authors : mod_authors,
64+ mod_description : mod_description,
65+ minecraft_version : minecraft_version
66+ )
67+ }
15168
152- filesMatching([ ' META-INF/mods.toml ' , ' pack.mcmeta ' ] ) {
153- expand replaceProperties + [ project : project]
69+ from(sourceSets . main . resources . srcDirs ) {
70+ exclude ' mcmod.info '
15471 }
15572}
15673
157- // Example for how to get properties into the manifest for reading at runtime.
158- tasks. named(' jar' , Jar ). configure {
74+ jar {
15975 manifest {
16076 attributes([
161- ' Specification-Title' : mod_id,
162- ' Specification-Vendor' : mod_authors,
163- ' Specification-Version' : ' 1' , // We are version 1 of ourselves
164- ' Implementation-Title' : project. name,
165- ' Implementation-Version' : project. jar. archiveVersion,
166- ' Implementation-Vendor' : mod_authors,
167- ' Implementation-Timestamp' : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" ),
168- ' MixinConfigs' : ' mixins.ifpat.json'
77+ ' Specification-Title' : mod_id,
78+ ' Specification-Vendor' : mod_authors,
79+ ' Specification-Version' : ' 1' ,
80+ ' Implementation-Title' : project. name,
81+ ' Implementation-Version' : version,
82+ ' Implementation-Vendor' : mod_authors,
83+ ' Implementation-Timestamp' : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" ),
84+ ' MixinConfigs' : ' mixins.ifpat.json' ,
85+ ' FMLCorePlugin' : ' com.neofastftl.infinitypattern.mixins.IFPATMixinPlugin' ,
86+ ' FMLCorePluginContainsFMLMod' : ' true' ,
87+ ' ForceLoadAsMod' : ' true'
16988 ])
17089 }
171-
172- // This is the preferred method to reobfuscate your jar file
173- finalizedBy ' reobfJar'
174- }
175-
176-
177- apply plugin : ' org.spongepowered.mixin'
178-
179- mixin {
180- add sourceSets. main, " mixins.infinitypattern.refmap.json"
181- config " mixins.ifpat.json"
18290}
18391
184- // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing:
185- // tasks.named('publish').configure {
186- // dependsOn 'reobfJar'
187- // }
188-
189- // Example configuration to allow publishing using the maven-publish plugin
19092publishing {
19193 publications {
192- register( ' mavenJava' , MavenPublication ) {
94+ mavenJava( MavenPublication ) {
19395 artifact jar
19496 }
19597 }
@@ -200,6 +102,6 @@ publishing {
200102 }
201103}
202104
203- tasks. withType(JavaCompile ). configureEach {
204- options. encoding = ' UTF-8' // Use the UTF-8 charset for Java compilation
105+ tasks. withType(JavaCompile ) {
106+ options. encoding = ' UTF-8'
205107}
0 commit comments