Skip to content

Commit

Permalink
Added support for neoforge #126
Browse files Browse the repository at this point in the history
Also Added DRAGON_DESTROYER hammer and Thors Hammers.
  • Loading branch information
RealYusufIsmail committed Oct 28, 2023
1 parent 88ed8cc commit b0aa94f
Show file tree
Hide file tree
Showing 2,160 changed files with 238,523 additions and 610 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![](http://cf.way2muchnoise.eu/480779.svg)](https://www.curseforge.com/minecraft/mc-mods/armour-and-items-mod)
[![](http://cf.way2muchnoise.eu/versions/480779.svg)](https://www.curseforge.com/minecraft/mc-mods/armour-and-items-mod)
[![License: Apache License](https://img.shields.io/badge/License-Apache_License-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Java CI](https://github.com/RealYusufIsmail-Mc-Mods/Armour-and-Tools-Mod/actions/workflows/gradle.yml/badge.svg)](https://github.com/RealYusufIsmail-Mc-Mods/Armour-and-Tools-Mod/actions/workflows/gradle.yml)

# This Mod is currently being reworked so please be patient while things are being implemented.

Expand Down
227 changes: 34 additions & 193 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import io.gitlab.arturbosch.detekt.Detekt
import java.net.URL
import net.minecraftforge.gradle.userdev.UserDevExtension
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import org.jetbrains.dokka.gradle.DokkaTask
Expand All @@ -19,164 +17,55 @@ plugins {
kotlin("jvm") version "1.9.10"
kotlin("plugin.allopen") version "1.9.10"
id("com.diffplug.spotless") version "6.20.0"
id("net.minecraftforge.gradle") version "[6.0,6.2)"
id("org.parchmentmc.librarian.forgegradle") version "1.+"
id("io.gitlab.arturbosch.detekt") version "1.23.0"
id("net.darkhax.curseforgegradle") version "1.1.16"
id("org.jetbrains.dokka") version "1.9.0"
id("net.darkhax.curseforgegradle") version "1.1.16"
jacoco // code coverage reports
}

project.group = "io.github.realyusufismail"

project.version = "1.20.1-1.0.6.1"

base.archivesName.set("armourandtoolsmod")

val mcVersion = "1.20.1"

// A project ID is required to tell CurseForge which project the uploaded
// file belongs to. This is public on your project page and is not private
// information.
var projectId = "480779"

println(
"""
Java: ${System.getProperty("java.version")}
JVM: ${System.getProperty("java.vm.version")} (${System.getProperty("java.vendor")})
Arch: ${System.getProperty("os.arch")}
"""
.trimIndent())

configure<UserDevExtension> {
mappings("parchment", "2023.09.03-$mcVersion")

accessTransformer("src/main/resources/META-INF/accesstransformer.cfg")

runs {
create("client") {
workingDirectory(file("run"))

// add mixin
property("mixin.env.remapRefMap", "true")
property(
"mixin.env.refMapRemappingFile", "${projectDir}/build/createSrgToMcp/output.srg")

// 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 { create(base.archivesName.get()) { source(sourceSets["main"]) } }
}

create("server") {
workingDirectory(file("run"))

// add mixin
property("mixin.env.remapRefMap", "true")
property(
"mixin.env.refMapRemappingFile", "${projectDir}/build/createSrgToMcp/output.srg")

// 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 { create(base.archivesName.get()) { source(sourceSets["main"]) } }
}

create("gameTestServer") {
workingDirectory(file("run"))

// add mixin
property("mixin.env.remapRefMap", "true")
property(
"mixin.env.refMapRemappingFile", "${projectDir}/build/createSrgToMcp/output.srg")

// 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 { create(base.archivesName.get()) { source(sourceSets["main"]) } }
}
allprojects {
repositories {
maven { url = uri("https://thedarkcolour.github.io/KotlinForForge/") }
maven { url = uri("https://maven.blamejared.com") }
maven { url = uri("https://dvs1.progwml6.com/files/maven/") }
maven { url = uri("https://modmaven.dev") }
maven { url = uri("https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/") }
mavenCentral()
}

create("data") {
workingDirectory(file("run-data"))
// add mixin
property("mixin.env.remapRefMap", "true")
property(
"mixin.env.refMapRemappingFile", "${projectDir}/build/createSrgToMcp/output.srg")
configurations { all { exclude(group = "org.slf4j", module = "slf4j-log4j12") } }
}

// Recommended logging data for a userdev environment
property("forge.logging.markers", "SCAN,REGISTRIES,REGISTRYDUMP")
subprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "jacoco")

// Recommended logging level for the console
property("forge.logging.console.level", "debug")
dependencies {
// Json
implementation(
"com.fasterxml.jackson.module:jackson-module-kotlin:" + properties["jacksonVersion"])

// Specify the mod id for data generation, where to output the resulting resource, and
// where to look for existing resources.
args(
"--mod",
base.archivesName.get(),
"--all",
"--output",
file("src/generated/resources/"),
"--existing",
file("src/main/resources/"))
// test
testImplementation("org.junit.jupiter:junit-jupiter:" + properties["junitVersion"])
}

mods { create(base.archivesName.get()) { source(sourceSets["main"]) } }
tasks.test {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}

// 'runData' is renamed to 'runDataGenerator' to make it more clear what it does.
taskName = "runDataGenerator"
tasks.jacocoTestReport {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.required.set(true)
html.required.set(true)
}
finalizedBy("jacocoTestCoverageVerification")
}
}

configurations { compileOnly { extendsFrom(configurations.annotationProcessor.get()) } }

sourceSets.main { resources.srcDir("src/generated/resources") }

repositories {
maven { url = uri("https://thedarkcolour.github.io/KotlinForForge/") }
maven { url = uri("https://maven.blamejared.com") }
maven { url = uri("https://dvs1.progwml6.com/files/maven/") }
maven { url = uri("https://modmaven.dev") }
mavenCentral()
}

dependencies {
minecraft("net.minecraftforge:forge:" + properties["forgeVersion"])
// kotlin forge
implementation("thedarkcolour:kotlinforforge:" + properties["kotlinForForgeVersion"])
// Logger
implementation("ch.qos.logback:logback-classic:" + properties["logbackVersion"])
implementation("ch.qos.logback:logback-core:" + properties["logbackVersion"])
// test
testImplementation("org.junit.jupiter:junit-jupiter:" + properties["junitVersion"])
// core
implementation("io.github.realyusufismail:realyusufismailcore:" + properties["coreVersion"])

// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
compileOnly(fg.deobf("mezz.jei:jei-${mcVersion}-common-api:" + properties["jeiVersion"]))
compileOnly(fg.deobf("mezz.jei:jei-${mcVersion}-forge-api:" + properties["jeiVersion"]))
runtimeOnly(fg.deobf("mezz.jei:jei-${mcVersion}-forge:" + properties["jeiVersion"]))

// lombok
compileOnly("org.projectlombok:lombok:" + properties["lombokVersion"])
annotationProcessor("org.projectlombok:lombok:" + properties["lombokVersion"])
}

tasks.test {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}

configurations { all { exclude(group = "org.slf4j", module = "slf4j-log4j12") } }

spotless {
kotlin {
Expand Down Expand Up @@ -263,54 +152,6 @@ java {

tasks.withType<KotlinCompile> { kotlinOptions.jvmTarget = "17" }

tasks.jacocoTestReport {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.required.set(true)
html.required.set(true)
}
finalizedBy("jacocoTestCoverageVerification")
}

detekt {
config.setFrom(files("gradle/config/detekt.yml"))
baseline = file("gradle/config/detekt-baseline.xml")
allRules = false
}

tasks.withType<Detekt>().configureEach {
reports {
xml.required.set(true)
html.required.set(true)
}
}

tasks.create("cfPublish", net.darkhax.curseforgegradle.TaskPublishCurseForge::class) {
group = "CurseForge"
dependsOn("build")
disableVersionDetection()

val token =
if (project.findProperty("curseforge.token") != null)
project.property("curseforge.token") as String
else ""
apiToken = token

val jar = file("build/libs/${base.archivesName.get()}-${project.version}.jar")

// The main file to upload
val mainFile = upload(projectId, jar)
mainFile.changelog = file("CHANGELOG.md").readText()
mainFile.changelogType = "markdown"
mainFile.releaseType = "release"
mainFile.addEmbedded("kotlin-for-forge")
mainFile.addEmbedded("realyusufismail-core")
mainFile.addJavaVersion("Java 17")
mainFile.addModLoader("forge")
mainFile.addGameVersion(mcVersion)
}

tasks.getByName("dokkaHtml", DokkaTask::class) {
dokkaSourceSets.configureEach {
includes.from("package.md")
Expand All @@ -335,4 +176,4 @@ tasks.getByName("dokkaHtml", DokkaTask::class) {
footerMessage = "Copyright © 2023 RealYusufIsmail MC Mods"
}
}
}
}
Loading

0 comments on commit b0aa94f

Please sign in to comment.