Skip to content

Commit

Permalink
Add forge and neoforge 1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed May 12, 2024
1 parent 499cafd commit 5a05f06
Show file tree
Hide file tree
Showing 43 changed files with 1,418 additions and 100 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion implementations/cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
`java-library`
id("com.diffplug.spotless") version "6.1.2"
id ("com.github.node-gradle.node") version "3.0.1"
id ("com.github.johnrengelman.shadow") version "7.1.2"
id ("com.github.johnrengelman.shadow") version "8.1.1"
}

group = "de.bluecolored.bluemap.cli"
Expand Down
2 changes: 1 addition & 1 deletion implementations/fabric-1.15.2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
`java-library`
id("com.diffplug.spotless") version "6.1.2"
id ("com.github.node-gradle.node") version "3.0.1"
id ("com.github.johnrengelman.shadow") version "7.1.2"
id ("com.github.johnrengelman.shadow") version "8.1.1"
id ("fabric-loom") version "1.3-SNAPSHOT"
id ("com.modrinth.minotaur") version "2.+"
id ("com.matthewprenger.cursegradle") version "1.4.0"
Expand Down
2 changes: 1 addition & 1 deletion implementations/fabric-1.16.2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
`java-library`
id("com.diffplug.spotless") version "6.1.2"
id ("com.github.node-gradle.node") version "3.0.1"
id ("com.github.johnrengelman.shadow") version "7.1.2"
id ("com.github.johnrengelman.shadow") version "8.1.1"
id ("fabric-loom") version "1.3-SNAPSHOT"
id ("com.modrinth.minotaur") version "2.+"
id ("com.matthewprenger.cursegradle") version "1.4.0"
Expand Down
2 changes: 1 addition & 1 deletion implementations/fabric-1.17/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
`java-library`
id("com.diffplug.spotless") version "6.1.2"
id ("com.github.node-gradle.node") version "3.0.1"
id ("com.github.johnrengelman.shadow") version "7.1.2"
id ("com.github.johnrengelman.shadow") version "8.1.1"
id ("fabric-loom") version "1.3-SNAPSHOT"
id ("com.modrinth.minotaur") version "2.+"
id ("com.matthewprenger.cursegradle") version "1.4.0"
Expand Down
2 changes: 1 addition & 1 deletion implementations/fabric-1.18/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
`java-library`
id("com.diffplug.spotless") version "6.1.2"
id ("com.github.node-gradle.node") version "3.0.1"
id ("com.github.johnrengelman.shadow") version "7.1.2"
id ("com.github.johnrengelman.shadow") version "8.1.1"
id ("fabric-loom") version "1.3-SNAPSHOT"
id ("com.modrinth.minotaur") version "2.+"
id ("com.matthewprenger.cursegradle") version "1.4.0"
Expand Down
2 changes: 1 addition & 1 deletion implementations/fabric-1.19.4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
`java-library`
id("com.diffplug.spotless") version "6.1.2"
id ("com.github.node-gradle.node") version "3.0.1"
id ("com.github.johnrengelman.shadow") version "7.1.2"
id ("com.github.johnrengelman.shadow") version "8.1.1"
id ("fabric-loom") version "1.3-SNAPSHOT"
id ("com.modrinth.minotaur") version "2.+"
id ("com.matthewprenger.cursegradle") version "1.4.0"
Expand Down
12 changes: 4 additions & 8 deletions implementations/fabric-1.20.5/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ modrinth {
.readText()
.replace("{version}", project.version.toString()))
uploadFile.set(tasks.findByName("remappedShadowJar"))
gameVersions.addAll("1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4")
gameVersions.addAll("1.20.5", "1.20.6")
dependencies {
required.project("P7dR8mSH") // Fabric API
}
Expand All @@ -162,14 +162,10 @@ curseforge {

addGameVersion("Fabric")

addGameVersion("Java 18")
addGameVersion("Java 17")
addGameVersion("Java 21")

addGameVersion("1.20")
addGameVersion("1.20.1")
addGameVersion("1.20.2")
addGameVersion("1.20.3")
addGameVersion("1.20.4")
addGameVersion("1.20.5")
addGameVersion("1.20.6")

mainArtifact(tasks.findByName("remappedShadowJar"), closureOf<CurseArtifact> {
relations(closureOf<CurseRelation> {
Expand Down
2 changes: 1 addition & 1 deletion implementations/fabric-1.20/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
`java-library`
id("com.diffplug.spotless") version "6.1.2"
id ("com.github.node-gradle.node") version "3.0.1"
id ("com.github.johnrengelman.shadow") version "7.1.2"
id ("com.github.johnrengelman.shadow") version "8.1.1"
id ("fabric-loom") version "1.3-SNAPSHOT"
id ("com.modrinth.minotaur") version "2.+"
id ("com.matthewprenger.cursegradle") version "1.4.0"
Expand Down
14 changes: 3 additions & 11 deletions implementations/forge-1.17.1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '6.0.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '[6.0.24,6.2)', changing: true
}
}

Expand All @@ -14,7 +14,7 @@ plugins {
id "java-library"
id "com.diffplug.spotless" version "6.1.2"
id "com.github.node-gradle.node" version "3.0.1"
id "com.github.johnrengelman.shadow" version "7.1.2"
id "com.github.johnrengelman.shadow" version "8.1.1"
id "com.modrinth.minotaur" version "2.+"
id "com.matthewprenger.cursegradle" version "1.4.0"
}
Expand All @@ -25,15 +25,7 @@ group = "de.bluecolored.bluemap.forge"
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore
archivesBaseName = 'bluemap'

def javaTarget = 16
java {
sourceCompatibility = JavaVersion.toVersion(javaTarget)
targetCompatibility = JavaVersion.toVersion(javaTarget)

toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
java.toolchain.languageVersion = JavaLanguageVersion.of(16)

minecraft {
mappings channel: 'official', version: '1.17.1'
Expand Down
11 changes: 4 additions & 7 deletions implementations/forge-1.18.1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '6.0.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '[6.0.24,6.2)', changing: true
}
}

Expand All @@ -14,7 +14,7 @@ plugins {
id "java-library"
id "com.diffplug.spotless" version "6.1.2"
id "com.github.node-gradle.node" version "3.0.1"
id "com.github.johnrengelman.shadow" version "7.1.2"
id "com.github.johnrengelman.shadow" version "8.1.1"
id "com.modrinth.minotaur" version "2.+"
id "com.matthewprenger.cursegradle" version "1.4.0"
}
Expand All @@ -25,11 +25,8 @@ group = "de.bluecolored.bluemap.forge"
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore
archivesBaseName = 'bluemap'

def javaTarget = 17
java {
sourceCompatibility = JavaVersion.toVersion(javaTarget)
targetCompatibility = JavaVersion.toVersion(javaTarget)
}

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

minecraft {
mappings channel: 'official', version: '1.18.1'
Expand Down
9 changes: 3 additions & 6 deletions implementations/forge-1.19.4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '6.0.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '[6.0.24,6.2)', changing: true
}
}

Expand All @@ -14,7 +14,7 @@ plugins {
id "java-library"
id "com.diffplug.spotless" version "6.1.2"
id "com.github.node-gradle.node" version "3.0.1"
id "com.github.johnrengelman.shadow" version "7.1.2"
id "com.github.johnrengelman.shadow" version "8.1.1"
id "com.modrinth.minotaur" version "2.+"
id "com.matthewprenger.cursegradle" version "1.4.0"
}
Expand All @@ -25,10 +25,7 @@ group = "de.bluecolored.bluemap.forge"
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore
archivesBaseName = 'bluemap'

def javaTarget = 17
java {
toolchain.languageVersion = JavaLanguageVersion.of(javaTarget)
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

minecraft {
mappings channel: 'official', version: '1.19.4'
Expand Down
212 changes: 212 additions & 0 deletions implementations/forge-1.20.6/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
buildscript {
repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '[6.0.24,6.2)', changing: true
}
}

plugins {
id "java"
id "java-library"
id "com.diffplug.spotless" version "6.1.2"
id "com.github.node-gradle.node" version "3.0.1"
id "com.github.johnrengelman.shadow" version "8.1.1"
id "com.modrinth.minotaur" version "2.+"
id "com.matthewprenger.cursegradle" version "1.4.0"
}

apply plugin: "net.minecraftforge.gradle"

group = "de.bluecolored.bluemap.forge"
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore
archivesBaseName = 'bluemap'

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

minecraft {
mappings channel: 'official', version: '1.20.6'

reobf = false

runs {
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'

mods {
bluemap {
source sourceSets.main
}
}
}
}
}

sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
mavenCentral()
maven {
setUrl("https://libraries.minecraft.net")
}
maven {
setUrl("https://jitpack.io")
}
}

configurations {
implementation.extendsFrom(shadowInclude)
}

dependencies {
minecraft 'net.minecraftforge:forge:1.20.6-50.0.13'

shadowInclude ("de.bluecolored.bluemap.common:BlueMapCommon") {
//exclude dependencies provided by forge
exclude (group: "com.google.guava", module: "guava")
exclude (group: "com.google.code.gson", module: "gson")
exclude (group: "org.apache.commons", module: "commons-lang3")
exclude (group: "commons-io", module: "commons-io")
exclude (group: "com.mojang", module: "brigadier")
}

testImplementation ("org.junit.jupiter:junit-jupiter:5.8.2")
testRuntimeOnly ("org.junit.jupiter:junit-jupiter-engine:5.8.2")
}

spotless {
java {
target ("src/*/java/**/*.java")

licenseHeaderFile("../../HEADER")
indentWithSpaces()
trimTrailingWhitespace()
}
}

jar {
manifest {
attributes([
"Specification-Title" : "bluemap",
"Specification-Vendor" : "bluemap",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "bluemap",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}

//jar.finalizedBy('reobfJar')

tasks.withType(JavaCompile).configureEach {
options.encoding = "utf-8"
}

tasks.withType(AbstractArchiveTask).configureEach {
setReproducibleFileOrder(true)
setPreserveFileTimestamps(false)
}

test {
useJUnitPlatform()
}

shadowJar {
def version = System.getProperty("bluemap.version") ?: "" // set by BlueMapCore
destinationDirectory.set(file("../../build/release"))
archiveFileName.set("BlueMap-${project.version}-${project.name}.jar")

configurations = [project.configurations.shadowInclude]

//relocate ("com.flowpowered.math", "de.bluecolored.shadow.flowpowered.math") //DON"T relocate this, because the API depends on it
relocate ("com.typesafe.config", "de.bluecolored.shadow.typesafe.config")
relocate ("net.querz.nbt", "de.bluecolored.shadow.querz.nbt")
relocate ("org.spongepowered.configurate", "de.bluecolored.shadow.configurate")
relocate ("com.github.benmanes.caffeine", "de.bluecolored.shadow.benmanes.caffeine")
relocate ("org.aopalliance", "de.bluecolored.shadow.aopalliance")
relocate ("javax.inject", "de.bluecolored.shadow.javax.inject")
relocate ("org.checkerframework", "de.bluecolored.shadow.checkerframework")
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift")

relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")

relocate ("org.apache.commons.dbcp2", "de.bluecolored.shadow.apache.commons.dbcp2")
relocate ("org.apache.commons.logging", "de.bluecolored.shadow.apache.commons.logging")
relocate ("org.apache.commons.pool2", "de.bluecolored.shadow.apache.commons.pool2")
}

processResources {
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info','META-INF/mods.toml'
duplicatesStrategy = DuplicatesStrategy.WARN

expand (
version: project.version
)
}
}

/*
afterEvaluate {
reobf {
shadowJar {
mappings = createMcpToSrg.output
}
}
}
*/

task release {
dependsOn(shadowJar)
}

modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "swbUV1cr"
versionNumber = "${project.version}-${project.name}"
changelog = file("../../release.md")
.getText()
.replace("{version}", project.version.toString())
uploadFile = shadowJar
gameVersions = ["1.20.6"]
}

curseforge {
apiKey = System.getenv("CURSEFORGE_TOKEN") ?: ""
project {
id = "406463"
changelogType = "markdown"
changelog = file("../../release.md")
.getText()
.replace("{version}", project.version.toString())
releaseType = "release"

addGameVersion "Forge"

addGameVersion "Java 21"

addGameVersion "1.20.6"

mainArtifact shadowJar
}
options {
javaVersionAutoDetect = false
javaIntegration = false
forgeGradleIntegration = false
}
}

task publish {
dependsOn(tasks.findByName("modrinth"))
dependsOn(tasks.findByName("curseforge"))
}
Binary file not shown.
Loading

0 comments on commit 5a05f06

Please sign in to comment.