plugins { id 'java-library' id 'eclipse' id 'idea' id 'maven-publish' id 'net.neoforged.gradle.userdev' version '7.0.80' // Adds the Kotlin Gradle plugin id 'org.jetbrains.kotlin.jvm' version '1.9.22' // OPTIONAL Kotlin Serialization plugin id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.22' }
repositories { mavenLocal() // Add KFF Maven repository maven { name = 'Kotlin for Forge' url = 'https://thedarkcolour.github.io/KotlinForForge/' } }
dependencies { // Specify the version of Minecraft to use. // Depending on the plugin applied there are several options. We will assume you applied the userdev plugin as shown above. // The group for userdev is net.neoforged, the module name is neoforge, and the version is the same as the neoforge version. // You can however also use the vanilla plugin (net.neoforged.gradle.vanilla) to use a version of Minecraft without the neoforge loader. // And its provides the option to then use net.minecraft as the group, and one of; client, server or joined as the module name, plus the game version as version. // For all intends and purposes: You can treat this dependency as if it is a normal library you would use. implementation "net.neoforged:neoforge:${neo_version}"
// Example mod dependency with JEI // The JEI API is declared for compile time use, while the full JEI artifact is used at runtime // compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}" // compileOnly "mezz.jei:jei-${mc_version}-forge-api:${jei_version}" // runtimeOnly "mezz.jei:jei-${mc_version}-forge:${jei_version}"
// Example mod dependency using a mod jar from ./libs with a flat dir repository // This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar // The group id is ignored when searching -- in this case, it is "blank" // implementation "blank:coolmod-${mc_version}:${coolmod_version}"
// Example mod dependency using a file as dependency // implementation files("libs/coolmod-${mc_version}-${coolmod_version}.jar")
// Example project dependency using a sister or child project: // implementation project(":myproject")
// For more info: // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html
// Adds KFF as dependency and Kotlin libs (use the variant matching your mod loader) // NEOFORGE implementation 'thedarkcolour:kotlinforforge-neoforge:4.10.0' }
# Sets default memory used for gradle commands. Can be overridden by user or command line properties. #org.gradle.jvmargs= org.gradle.daemon=false org.gradle.debug=false #read more on this at https://github.com/neoforged/NeoGradle/blob/NG_7.0/README.md#apply-parchment-mappings # you can also find the latest versions at: https://parchmentmc.org/docs/getting-started neogradle.subsystems.parchment.minecraftVersion=1.20.3 neogradle.subsystems.parchment.mappingsVersion=2023.12.31 # Environment Properties # You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge # The Minecraft version must agree with the Neo version to get a valid artifact minecraft_version=1.20.4 # The Minecraft version range can use any release version of Minecraft as bounds. # Snapshots, pre-releases, and release candidates are not guaranteed to sort properly # as they do not follow standard versioning conventions. minecraft_version_range=[1.20.4,1.21) # The Neo version must agree with the Minecraft version to get a valid artifact neo_version=20.4.215 # The Neo version range can use any version of Neo as bounds neo_version_range=[20.4,) # The loader version range can only use the major version of FML as bounds loader_version_range=[4.10,) ## Mod Properties # The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63} # Must match the String constant located in the main mod class annotated with @Mod. mod_id=kotlindemo # The human-readable display name for the mod. mod_name=Kotlin NeoForge Demo Mod # 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/ mod_version=1.0.0 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html mod_group_id=top.srcres.mods.kotlindemo # The authors of the mod. This is a simple text string that is used for display purposes in the mod list. mod_authors=src_resources # 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.