buildscript {
    repositories {
        maven { url = 'https://maven.minecraftforge.net' }
        maven { url = 'https://repo.spongepowered.org/maven' }
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
        classpath 'org.spongepowered:mixingradle:0.7.+'
    }
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'eclipse'

version = '1.0'
group = 'studio.halbear.hem'
archivesBaseName = 'hem'

java.toolchain.languageVersion = JavaLanguageVersion.of(8)

minecraft {
    mappings channel: 'snapshot', version: '20201028-1.16.3'

    runs {
        client {
            workingDirectory project.file('run')
            arg "-mixin.config=hem.mixin.json"

            property 'forge.logging.markers', 'REGISTRIES'
            property 'forge.logging.console.level', 'debug'

            jvmArgs = [
                    "--add-exports=java.base/sun.security.util=ALL-UNNAMED",
                    "--add-opens=java.base/java.util.jar=ALL-UNNAMED"
            ]

            mods {
                hem {
                    source sourceSets.main
                }
            }
        }

        server {
            workingDirectory project.file('run')

            property 'forge.logging.markers', 'REGISTRIES'
            property 'forge.logging.console.level', 'debug'

            jvmArgs = [
                    "--add-exports=java.base/sun.security.util=ALL-UNNAMED",
                    "--add-opens=java.base/java.util.jar=ALL-UNNAMED"
            ]

            mods {
                hem {
                    source sourceSets.main
                }
            }
        }
    }
}
tasks.named('jar', Jar).configure {
    manifest {
        attributes([
                'TweakClass'              : 'org.spongepowered.asm.launch.MixinTweaker',
                'TweakOrder'              : 0,
                'MixinConfigs'            : 'hem.mixin.json'
        ])
    }
    rename 'mixin.refmap.json', 'hem.mixin-refmap.json'
}
dependencies {
    minecraft 'net.minecraftforge:forge:1.16.5-36.2.26'
}

apply from: 'mcreator.gradle'

