Skip to content

Commit

Permalink
feat: ✨ 1.21 port
Browse files Browse the repository at this point in the history
  • Loading branch information
P3pp3rF1y committed Oct 30, 2024
1 parent 1e3fefe commit c3c4ccd
Show file tree
Hide file tree
Showing 911 changed files with 15,197 additions and 15,224 deletions.
169 changes: 83 additions & 86 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id 'java-library'
id 'idea'
id "org.sonarqube" version "4.3.1.3277"
id "maven-publish"
id 'net.neoforged.gradle' version '[6.0.18,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
id 'maven-publish'
id 'net.neoforged.moddev' version '1.0.14'
id "org.sonarqube" version "5.0.0.4638"
id "net.darkhax.curseforgegradle" version "1.1.15"
id "com.modrinth.minotaur" version "2.+"
}
Expand All @@ -15,6 +15,10 @@ idea {
}
}

version = "${project.minecraft_version}-${project.mod_version}.${getBuildNumber()}${getStable()}"
group = mod_group_id


repositories {
mavenCentral()
maven { url "https://dvs1.progwml6.com/files/maven" }
Expand All @@ -30,41 +34,48 @@ repositories {
}
}

group = 'reliquary'
version = "${project.minecraft_version}-${project.mod_version}.${getBuildNumber()}${getStable()}"
archivesBaseName = 'reliquary'
base {
archivesName = mod_id
}

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '17'
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

neoForge {
version = project.neo_version

accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')

minecraft {
mappings channel: 'parchment', version: "$parchment_version"
copyIdeResources = true
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
configureEach {
workingDirectory project.file("run/${it.name}")
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
property "mixin.env.disableRefMap", "true"
jvmArg '-XX:+AllowEnhancedClassRedefinition'
jvmArg '-XX:HotswapAgent=fatjar'

mods {
"${mod_id}" {
source sourceSets.main
}
}
systemProperty 'forge.logging.markers', 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
systemProperty 'mixin.env.disableRefMap', 'true'
}

client {
client()
}

client2 {
client()

programArguments.addAll '--username', 'Dev2'
}

server {
server()
programArgument '--nogui'
}

data {
property 'fml.earlyprogresswindow', 'false'
//property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
workingDirectory project.file('run')
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/')
data()
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}

mods {
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
}
Expand All @@ -73,66 +84,56 @@ sourceSets.main.resources {
srcDir 'src/generated/resources'
}

dependencies {
minecraft "net.neoforged:forge:${minecraft_version}-${neo_version}"

compileOnly fg.deobf("mezz.jei:jei-${jei_mc_version}:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_mc_version}:${jei_version}")
//compileOnly fg.deobf("vazkii.botania:Botania:${botania_version}:api")
//runtimeOnly fg.deobf("vazkii.botania:Botania:${botania_version}")
//compileOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}:api")
//runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}") //deobfCompile "slimeknights.mantle:Mantle:${mantle_version}"
//deobfCompile "slimeknights:TConstruct:${tconstruct_version}"
//deobfCompile "jeresources:JustEnoughResources-${minecraft_version}:${jer_version}"
//deobfCompile "slimeknights.mantle:Mantle:${mantle_version}"
//deobfCompile "slimeknights:TConstruct:${tconstruct_version}"
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}:api")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}")
compileOnly fg.deobf("curse.maven:jade-324717:${jade_cf_file_id}")
runtimeOnly fg.deobf("curse.maven:jade-324717:${jade_cf_file_id}")

// compileOnly fg.deobf("curse.maven:tinkers-74072:3576393")
// runtimeOnly fg.deobf("curse.maven:tinkers-74072:3576393")
// compileOnly fg.deobf("curse.maven:mantle-74924:3576386")
// runtimeOnly fg.deobf("curse.maven:mantle-74924:3576386")
}

task generateSources(type: Copy) {
from 'src/replaceme/java'
into "$buildDir/generated-src"
filter { line -> line.replaceAll('@MOD_VERSION@', '${project.version}') }
configurations {
runtimeClasspath.extendsFrom localRuntime
}

tasks.named('jar', Jar).configure {
from('/') {
include 'LICENSE'
}

manifest {
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : "p3pp3rf1y",
'Specification-Version' : '1', // We are version 1 of ourselves
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : "p3pp3rf1y",
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
dependencies {
compileOnly "mezz.jei:jei-${jei_mc_version}:${jei_version}"
localRuntime "mezz.jei:jei-${jei_mc_version}:${jei_version}"
compileOnly "curse.maven:curios-1037991:${curios_cf_file_id}"
localRuntime "curse.maven:curios-1037991:${curios_cf_file_id}"
compileOnly "curse.maven:jade-324717:${jade_cf_file_id}"
localRuntime "curse.maven:jade-324717:${jade_cf_file_id}"
}

tasks.withType(ProcessResources).configureEach {
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
var replaceProperties = [
minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
neo_version : neo_version, neo_version_range: neo_version_range,
loader_version_range: loader_version_range,
mod_id : mod_id, mod_version: mod_version,
mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_issue_tracker_url: mod_issue_tracker_url, mod_logo_file: mod_logo_file, mod_credits: mod_credits,
mod_authors : mod_authors, mod_description: mod_description, mod_display_url: mod_display_url,
mod_full_version : "${project.mod_version}.${getBuildNumber()}${getStable()}"

]
inputs.properties replaceProperties

filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
expand replaceProperties
from "src/main/templates"
into "build/generated/sources/modMetadata"
}

// Include the output of "generateModMetadata" as an input directory for the build
// this works with both building through Gradle and the IDE.
sourceSets.main.resources.srcDir generateModMetadata
// To avoid having to run "generateModMetadata" manually, make it run on every project reload
neoForge.ideSyncTask generateModMetadata

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}

jar {
manifest {
attributes(["Specification-Title" : project.mod_id,
"Specification-Vendor" : project.mod_id,
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}",
"Implementation-Vendor" : project.mod_id,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
}
}

Expand All @@ -150,15 +151,11 @@ static def getStable() {
return ""
}

tasks.named('publish').configure {
dependsOn 'reobfJar'
}

publishing {
repositories {
maven {
name = "ReliquaryMaven"
url = uri("https://maven.pkg.github.com/P3pp3rF1y/Reliquary")
name = "GitHubPackages"
url = uri("${github_package_url}")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
Expand All @@ -167,7 +164,7 @@ publishing {
}
publications {
gpr(MavenPublication) {
artifactId = 'reliquary'
artifactId = mod_id
from(components.java)
}
}
Expand Down Expand Up @@ -232,7 +229,7 @@ task generateChangelog {
// Single commit log
commitMessages = "git log -1 --pretty=%B".execute().text.split('\n\n')
// Split by two newlines for each commit
logger.info("Single commit, ran git log command: git log -1 --pretty=%B and got ${commitMessages}");
logger.info("Single commit, ran git log command: git log -1 --pretty=%B and got ${commitMessages}")
}

def features = []
Expand Down Expand Up @@ -272,7 +269,6 @@ task curseforge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) {
mainFile.changelogType = 'markdown'
mainFile.changelog = { project.ext.changelog }
mainFile.addModLoader('NeoForge')
mainFile.addModLoader('Forge')
mainFile.releaseType = "${release_type}"
"${release_versions}".split(',').each {
mainFile.addGameVersion("${it}")
Expand All @@ -289,7 +285,7 @@ modrinth {
versionType = "${release_type}"
uploadFile = jar
gameVersions = "${release_versions}".split(',').collect {e -> e}
loaders = ["forge", "neoforge"]
loaders = ["neoforge"]
dependencies {
optional.project "jei"
optional.project "jade"
Expand All @@ -299,6 +295,7 @@ modrinth {
project.ext.changelog
}
}

tasks.modrinth {
dependsOn(tasks.generateChangelog)
onlyIf { !project.ext.changelog.isEmpty() }
Expand Down
43 changes: 24 additions & 19 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
org.gradle.debug=false

parchment_minecraft_version=1.21
parchment_mappings_version=2024.07.28
minecraft_version=1.21.1
minecraft_version_range=[1.21.1, 1.22)
neo_version=21.1.73
neo_version_range=[21.1.0,)
loader_version_range=[4,)

mod_id=reliquary
mod_group_id=reliquary
mod_name=Reliquary Reincarnations
mod_license=GNU General Public License v3.0
mod_version=2.0.44
mod_group_id=reliquary
mod_authors=P3pp3rF1y
mod_description=Two words: magical swag. Oh, and a gun.
mod_credits=Originally made by Xeno and TheMike, now maintained by P3pp3rF1y.
mod_logo_file=logo.png
mod_display_url=https://www.curseforge.com/minecraft/mc-mods/reliquary-reincarnations
mod_issue_tracker_url=https://github.com/P3pp3rF1y/Reliquary/issues
sonar_project_key=xreliquary:Reliquary
github_package_url=https://maven.pkg.github.com/P3pp3rF1y/Reliquary

#neoforge
minecraft_version=1.20.1
minecraft_version_range=[1.20,1.21)
neo_version=47.1.5
neo_version_range=[47.1,)
loader_version_range=[47,)
jei_mc_version=1.21.1-neoforge
jei_version=19.12.0.131
curios_cf_file_id=5546342
jade_cf_file_id=5842011

#publish
curseforge_id=241319
release_type=release
release_versions=1.20.1
modrinth_project_id=fQO83PId

#deps
jei_mc_version=1.20.1-forge
jei_version=15.1.0.19
curios_version=5.2.0-beta.3+1.20.1
# botania_version=1.16.5-415-SNAPSHOT
jade_cf_file_id=4654448
# hwyla_version = 1.8.20-B35_1.12
# jer_version = 0.8.7.41
parchment_version=2023.07.16-1.20.1
release_versions=1.21.1
modrinth_project_id=fQO83PId
7 changes: 4 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Sat Sep 05 10:21:38 EDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStorePath=wrapper/dists
9 changes: 3 additions & 6 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
maven { url = 'https://maven.parchmentmc.org' }
maven {
name = 'NeoForged'
url = 'https://maven.neoforged.net/releases'
}
maven { url = 'https://maven.neoforged.net/releases' }
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}
5 changes: 5 additions & 0 deletions src/generated/resources/data/c/tags/fluid/experience.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"reliquary:xp_still"
]
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"reliquary:interdiction_torch"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"reliquary:shears_of_winter"
]
}
6 changes: 6 additions & 0 deletions src/generated/resources/data/minecraft/tags/item/swords.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"reliquary:magicbane",
"reliquary:mercy_cross"
]
}
Loading

0 comments on commit c3c4ccd

Please sign in to comment.