plugins {
	id 'fabric-loom' version '1.15-SNAPSHOT'
	id 'maven-publish'
}

repositories {
	mavenCentral()
}

dependencies {
    include(modImplementation('io.netty:netty-handler-proxy:4.1.82.Final'))
    include(modImplementation('io.netty:netty-codec-socks:4.1.82.Final'))

    minecraft "com.mojang:minecraft:${project.minecraft_version}"
    mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
    modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
    // Fabric API. This is technically optional, but you probably want it anyw
    modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}
processResources {
	inputs.property "version", project.version

	filesMatching("fabric.mod.json") {
		expand "version": project.version
	}
}

tasks.withType(JavaCompile).configureEach {
	it.options.release = 21
}

java {
	sourceCompatibility = JavaVersion.VERSION_21
	targetCompatibility = JavaVersion.VERSION_21
	// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
	// if it is present.
	// If you remove this line, sources will not be generated.
	withSourcesJar()
}

jar {
    from("LICENSE") {
	rename { "${it}_${project.archivesBaseName}"}
	}
}

publishing {
	publications {
		mavenJava(MavenPublication) {
			artifact(remapJar) {
				builtBy remapJar
			}
			artifact(sourcesJar) {
				builtBy remapSourcesJar
			}
		}
	}

	repositories {

	}
}
