Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import net.minecraftforge.gradle.userdev.UserDevExtension
- import net.minecraftforge.gradle.userdev.UserDevPlugin
- import java.time.ZonedDateTime
- import java.time.ZoneOffset
- import java.time.format.DateTimeFormatter
- buildscript {
- repositories {
- maven { setUrl("https://files.minecraftforge.net/maven") }
- jcenter()
- mavenCentral()
- }
- dependencies {
- classpath("net.minecraftforge.gradle:ForgeGradle:3.+")
- }
- }
- apply {
- plugin<UserDevPlugin>()
- plugin("eclipse")
- }
- version = "1.0"
- group = "com.yourname.modid"
- configure<BasePluginConvention> {
- archivesBaseName = "modid"
- }
- repositories {
- mavenCentral()
- }
- configure<JavaPluginConvention> {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
- }
- fun minecraft(configure: UserDevExtension.() -> Unit) = project.configure(configure)
- minecraft {
- mappings("snapshot", "20180921-1.13")
- runs {
- "client" {
- workingDirectory(project.file("run"))
- // Recommended logging data for a userdev environment
- property("forge.logging.markers", "SCAN,REGISTRIES,REGISTRYDUMP")
- // Recommended logging level for the console
- property("forge.logging.console.level", "debug")
- mods {
- "examplemod" {
- source(project.the<JavaPluginConvention>().sourceSets["main"])
- }
- }
- }
- "server" {
- workingDirectory(project.file("run"))
- // Recommended logging data for a userdev environment
- property("forge.logging.markers", "SCAN,REGISTRIES,REGISTRYDUMP")
- // Recommended logging level for the console
- property("forge.logging.console.level", "debug")
- mods {
- "examplemod" {
- source(project.the<JavaPluginConvention>().sourceSets["main"])
- }
- }
- }
- }
- }
- dependencies {
- "minecraft"("net.minecraftforge:forge:1.13.2-25.0.74")
- }
- configure<JavaPluginConvention> {
- manifest {
- attributes(mapOf(
- "Specification-Title" to "examplemod",
- "Specification-Vendor" to "examplemodsareus",
- "Specification-Version" to "1",
- "Implementation-Title" to project.name,
- "Implementation-Version" to "$version",
- "Implementation-Vendor" to "examplemodsareus",
- "Implementation-Timestamp" to ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT)
- ))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement