Skip to content

Commit

Permalink
Update fabric-1.19.3 and add forge-1.19.3 implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Dec 8, 2022
1 parent 11306ec commit 6e78587
Show file tree
Hide file tree
Showing 18 changed files with 1,335 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {

private static final Pattern VERSION_REGEX = Pattern.compile("(?:(?<major>\\d+)\\.(?<minor>\\d+))(?:\\.(?<patch>\\d+))?(?:\\-(?:pre|rc)\\d+)?");

public static final MinecraftVersion LATEST_SUPPORTED = new MinecraftVersion(1, 19, 1);
public static final MinecraftVersion LATEST_SUPPORTED = new MinecraftVersion(1, 19, 3);
public static final MinecraftVersion EARLIEST_SUPPORTED = new MinecraftVersion(1, 13);

private final int major, minor, patch;
Expand Down
12 changes: 6 additions & 6 deletions implementations/fabric-1.19.3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ dependencies {
exclude (group = "com.mojang", module = "brigadier")
}

minecraft ("com.mojang:minecraft:1.19.3-pre2")
mappings ("net.fabricmc:yarn:1.19.3-pre2+build.6:v2")
modImplementation ("net.fabricmc:fabric-loader:0.14.10")
modImplementation ("net.fabricmc.fabric-api:fabric-api:0.67.2+1.19.3")
minecraft ("com.mojang:minecraft:1.19.3")
mappings ("net.fabricmc:yarn:1.19.3+build.2")
modImplementation ("net.fabricmc:fabric-loader:0.14.11")
modImplementation ("net.fabricmc.fabric-api:fabric-api:0.68.1+1.19.3")
modImplementation("me.lucko:fabric-permissions-api:0.1-SNAPSHOT")

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

spotless {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
],

"depends": {
"fabricloader": ">=0.11.3",
"fabricloader": ">=0.14.11",
"fabric": "*",
"fabric-api-base": "*",
"minecraft": ">=1.18-alpha.21.37.a"
"minecraft": "*"
},
"suggests": {}
}
207 changes: 207 additions & 0 deletions implementations/forge-1.19.3/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
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: '5.1.+', 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 "7.1.2"
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'

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

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

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.19.3-44.0.0'

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 ("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(build)
}

modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "swbUV1cr"
versionNumber = "${project.version}-${project.name}"
changelog = "Releasenotes and Changelog:\nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}"
uploadFile = shadowJar
gameVersions = ["1.19.3"]
}

curseforge {
apiKey = System.getenv("CURSEFORGE_TOKEN") ?: ""
project {
id = "406463"
changelogType = "markdown"
changelog = "**Releasenotes and Changelog:**\n\nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}"
releaseType = "release"

addGameVersion "Forge"

addGameVersion "Java 18"
addGameVersion "Java 17"

addGameVersion "1.19.3"

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

task publish {
dependsOn(tasks.findByName("modrinth"))
dependsOn(tasks.findByName("curseforge"))
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 6e78587

Please sign in to comment.