diff --git a/build.gradle b/build.gradle index 462b825..afd9994 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ repositories { } base { - archivesName = mod_id + archivesName = "${file_name}-${minecraft_version}" } // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. @@ -123,10 +123,16 @@ tasks.withType(ProcessResources).configureEach { } } +// Build and publish a -sources.jar as well (useful for addons) +java { + withSourcesJar() +} + // Example configuration to allow publishing using the maven-publish plugin publishing { publications { register('mavenJava', MavenPublication) { + artifactId = project.base.archivesName.get() from components.java } } diff --git a/gradle.properties b/gradle.properties index 346805d..be6c38c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -29,6 +29,8 @@ loader_version_range=[2,) mod_id=examplemod # The human-readable display name for the mod. mod_name=Example Mod +# The mod filename, usually the mod_id or the mod_name WithoutSpaces +file_name=ExampleMod # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=All Rights Reserved # The mod version. See https://semver.org/ @@ -40,4 +42,4 @@ mod_group_id=com.example.examplemod # The authors of the mod. This is a simple text string that is used for display purposes in the mod list. mod_authors=YourNameHere, OtherNameHere # The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list. -mod_description=Example mod description.\nNewline characters can be used and will be replaced properly. \ No newline at end of file +mod_description=Example mod description.\nNewline characters can be used and will be replaced properly.