diff --git a/build.gradle b/build.gradle index 8bae0c7..1f1756e 100644 --- a/build.gradle +++ b/build.gradle @@ -11,46 +11,20 @@ buildscript { apply plugin: 'net.minecraftforge.gradle' -group = 'dev.micle' -version = 'Forge-1.16.5-1.1.1' +def archiveVersion = "Forge-${project.mcVersion}-${project.buildVersion}" as Object -java { - archivesBaseName = 'TotemOfReviving' - toolchain.languageVersion = JavaLanguageVersion.of(8) -} +java.toolchain.languageVersion = JavaLanguageVersion.of(8) minecraft { - // The mappings can be changed at any time and must be in the following format. - // Channel: Version: - // snapshot YYYYMMDD Snapshot are built nightly. - // stable # Stables are built at the discretion of the MCP team. - // official MCVersion Official field/method names from Mojang mapping files - // - // You must be aware of the Mojang license when using the 'official' mappings. - // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md - // - // Use non-default mappings at your own risk. They may not always work. - // Simply re-run your setup task after changing the mappings to update your workspace. - mappings channel: 'snapshot', version: '20210309-1.16.5' + mappings channel: 'official', version: mcVersion - // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') - // Default run configurations. - // These can be tweaked, removed, or duplicated as needed. runs { client { workingDirectory project.file('run') - // Recommended logging data for a userdev environment - // The markers can be added/removed as needed separated by commas. - // "SCAN": For mods scan. - // "REGISTRIES": For firing of registry events. - // "REGISTRYDUMP": For getting the contents of all registries. property 'forge.logging.markers', 'REGISTRIES' - - // Recommended logging level for the console - // You can set various levels here. - // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels property 'forge.logging.console.level', 'debug' mods { @@ -63,16 +37,7 @@ minecraft { server { workingDirectory project.file('run') - // Recommended logging data for a userdev environment - // The markers can be added/removed as needed separated by commas. - // "SCAN": For mods scan. - // "REGISTRIES": For firing of registry events. - // "REGISTRYDUMP": For getting the contents of all registries. property 'forge.logging.markers', 'REGISTRIES' - - // Recommended logging level for the console - // You can set various levels here. - // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels property 'forge.logging.console.level', 'debug' mods { @@ -85,19 +50,9 @@ minecraft { data { workingDirectory project.file('run') - // Recommended logging data for a userdev environment - // The markers can be added/removed as needed separated by commas. - // "SCAN": For mods scan. - // "REGISTRIES": For firing of registry events. - // "REGISTRYDUMP": For getting the contents of all registries. property 'forge.logging.markers', 'REGISTRIES' - - // Recommended logging level for the console - // You can set various levels here. - // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels property 'forge.logging.console.level', 'debug' - // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. args '--mod', 'totemofreviving', '--all', '--existing', file('src/main/resources').toString(), '--existing', file('src/generated/resources').toString(), @@ -112,48 +67,43 @@ minecraft { } } -// Include resources generated by data generators. -sourceSets.main.resources { srcDir 'src/generated/resources' } +sourceSets.main.resources { + srcDir 'src/generated/resources' +} repositories { - // Put repositories for dependencies here - // ForgeGradle automatically adds the Forge maven and Maven Central for you - - // If you have mod jar dependencies in ./libs, you can declare them as a repository like so: - // flatDir { - // dir 'libs' - // } + maven { + name = "Progwml6 maven" + url = "https://dvs1.progwml6.com/files/maven/" + } + maven { + name = "ModMaven" + url = "https://modmaven.k-4u.nl" + } } dependencies { - // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft' it is assumed - // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied. - // The userdev artifact is a special name and will get all sorts of transformations applied to it. - minecraft 'net.minecraftforge:forge:1.16.5-36.2.16' + minecraft "net.minecraftforge:forge:${project.mcVersion}-${project.forgeVersion}" - // Real mod deobf dependency examples - these get remapped to your current mappings - // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency - // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency - // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency - - // Examples using mod jars from ./libs - // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}") - - // For more info... - // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html - // http://www.gradle.org/docs/current/userguide/dependency_management.html + // JEI + if (project.hasProperty('jeiVersion')) { + // compile against JEI API but do not include it at runtime + compileOnly fg.deobf("mezz.jei:jei-${project.mcVersion}:${project.jeiVersion}:api") + // at runtime, use full JEI jar + runtimeOnly fg.deobf("mezz.jei:jei-${project.mcVersion}:${project.jeiVersion}") + } } -// Example for how to get properties into the manifest for reading at runtime. jar { + archiveFileName = "${project.archivesBaseName}-${archiveVersion}.jar" manifest { attributes([ - "Specification-Title" : "totemofreviving", - //"Specification-Vendor": "totemofreviving authors", - "Specification-Version" : "1", // We are version 1 of ourselves + "Specification-Title" : project.name, + "Specification-Vendor" : project.author, + "Specification-Version" : "1", "Implementation-Title" : project.name, - "Implementation-Version" : project.jar.archiveVersion, - //"Implementation-Vendor": "totemofreviving authors", + "Implementation-Vendor" : project.author, + "Implementation-Version" : archiveVersion, "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } diff --git a/gradle.properties b/gradle.properties index 29b2ac4..7c8d821 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,14 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false + +group = dev.micle +archivesBaseName = TotemOfReviving +modID = totemofreviving +name = Micle's Totem of Reviving +author = Micle + +buildVersion = 1.1.1 +mcVersion = 1.16.5 +forgeVersion = 36.2.16 + +jeiVersion = 7.+ diff --git a/settings.gradle b/settings.gradle index a98d3a2..23b382b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = 'TotemOfReviving-1.16' +rootProject.name = "${archivesBaseName}-1.16"