loom {
    accessWidenerPath = project(":common").loom.accessWidenerPath
}

architectury {
    forgeLike(["forge", "neoforge"]) {
        it.platformPackage "neoforge", "forge"
        it.remapForgeLike "net/minecraftforge/common/extensions/IForgeItem", "net/neoforged/neoforge/common/extensions/IItemExtension"
        it.remapForgeLike "net/minecraftforge/client/event/TextureStitchEvent\$Post", "net/neoforged/neoforge/client/event/TextureAtlasStitchedEvent"
        it.remapForgeLike "net/minecraftforge/fluids/ForgeFlowingFluid", "net/neoforged/neoforge/fluids/BaseFlowingFluid"
        it.remapForgeLike "net/minecraftforge/fluids/ForgeFlowingFluid\$Properties", "net/neoforged/neoforge/fluids/BaseFlowingFluid\$Properties"
        it.remapForgeLike "net/minecraftforge/common/ForgeHooks", "net/neoforged/neoforge/common/CommonHooks"
    }
}

dependencies {
    forge "net.minecraftforge:forge:${rootProject.architectury.minecraft}-${rootProject.forge_version}"

    compileOnly(project(path: ":common", configuration: "namedElements")) { transitive false }
}

publishing {
    publications {
        mavenForge(MavenPublication) {
            artifactId = rootProject.archivesBaseName + "-forge-like"
            from components.java
        }
    }

    repositories {
        if (System.getenv("MAVEN_PASS") != null) {
            maven {
                url = "https://deploy.shedaniel.me/"
                credentials {
                    username = "shedaniel"
                    password = System.getenv("MAVEN_PASS")
                }
            }
        }
    }
}
