Skip to content

Commit

Permalink
feat: ✨ 1.20.4 port
Browse files Browse the repository at this point in the history
  • Loading branch information
P3pp3rF1y committed Apr 1, 2024
1 parent 32deb62 commit d0153ea
Show file tree
Hide file tree
Showing 544 changed files with 8,379 additions and 8,260 deletions.
194 changes: 94 additions & 100 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
buildscript {
repositories {
maven {
name = "forge"
url = "https://maven.minecraftforge.net"
}
maven { url = 'https://maven.parchmentmc.org' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath group: 'org.parchmentmc', name: 'librarian', version: '1.+', changing: true
}
}

plugins {
id 'java-library'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.101'
id "org.sonarqube" version "3.3"
id "maven-publish"
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'idea'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}

apply from: 'https://gist.githubusercontent.com/Technici4n/facbcdf18ce1a556b76e6027180c32ce/raw/059ab3d504a590461746fc6e3065159f4932a960/classremapper.gradle'

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

repositories {
mavenCentral()
mavenLocal()
maven { url "https://dvs1.progwml6.com/files/maven" }
maven { url "https://maven.latmod.com/" }
maven { url "https://maven.thiakil.com" }
Expand All @@ -37,67 +33,49 @@ 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(17)

minecraft {
mappings channel: 'parchment', version: "$parchment_version"
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
properties 'forge.logging.console.level': 'debug'
property 'mixin.env.disableRefMap', 'true'
jvmArg '-XX:+AllowEnhancedClassRedefinition'
jvmArg '-XX:HotswapAgent=fatjar'
workingDirectory project.file('run')
mods {
reliquary {
source sourceSets.main
}
}
}
server {
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
properties 'forge.logging.console.level': 'debug'
property 'mixin.env.disableRefMap', 'true'
jvmArg '-XX:+AllowEnhancedClassRedefinition'
jvmArg '-XX:HotswapAgent=fatjar'
workingDirectory project.file('run')
mods {
reliquary {
source sourceSets.main
}
}
}
data {
properties 'forge.logging.markers': 'REGISTRIES,REGISTRYDUMP'
properties 'forge.logging.console.level': 'debug'
property 'mixin.env.disableRefMap', 'true'
properties 'fml.earlyprogresswindow': 'false'
workingDirectory project.file('run')
mods {
reliquary {
source sourceSets.main
}
}
args '--mod', 'reliquary', '--all', '--output', file('src/generated/resources/')
}
accessTransformers {
file('src/main/resources/META-INF/accesstransformer.cfg')
//entry('public net.minecraft.world.item.crafting.ShapelessRecipe result #result')
}
}

sourceSets.main.resources {
srcDir 'src/generated/resources'
runs {
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
systemProperty 'mixin.env.disableRefMap', 'true'
modSource project.sourceSets.main
}

client {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}

server {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
programArgument '--nogui'
}

data {
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}

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


dependencies {
minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"
implementation "net.neoforged:neoforge:${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 "mezz.jei:jei-${jei_mc_version}:${jei_version}"
runtimeOnly "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")
Expand All @@ -106,47 +84,60 @@ dependencies {
//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}")
runtimeOnly fg.deobf("curse.maven:twilightforest-227639:4337394")

// 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")
compileOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}:api"
runtimeOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}"
compileOnly "curse.maven:jade-324717:${jade_cf_file_id}"
runtimeOnly "curse.maven:jade-324717:${jade_cf_file_id}"
runtimeOnly "curse.maven:twilightforest-227639:5182539"
}

task generateSources(type: Copy) {
from 'src/replaceme/java'
into "$buildDir/generated-src"
filter { line -> line.replaceAll('@MOD_VERSION@', '${project.version}') }
tasks.withType(ProcessResources).configureEach {
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_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']) {
expand replaceProperties + [project: project]
}
}

publishing {
publications {
register('mavenJava', MavenPublication) {
from components.java
}
}
repositories {
maven {
url "file://${project.projectDir}/repo"
}
}
}

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

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

processResources {
// Exclude datagenerator .cache directory
exclude '.cache'

filesMatching('META-INF/mods.toml') {
filter {
it.replaceAll("project_version", project.version.toString())
}
}
}

static def getBuildNumber() {
if (System.getenv("GITHUB_RUN_NUMBER") != null) {
return Integer.valueOf(Integer.parseInt(System.getenv("GITHUB_RUN_NUMBER")) + 950).toString()
Expand All @@ -156,7 +147,7 @@ static def getBuildNumber() {

static def getStable() {
if ((System.getenv("GITHUB_REF") == null || System.getenv("GITHUB_REF").endsWith("-dev"))) {
return "unstable"
return "-SNAPSHOT"
}
return ""
}
Expand Down Expand Up @@ -187,3 +178,6 @@ sonarqube {
}
}

task printVersionName {
println "version:" + project.version
}
32 changes: 26 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
org.gradle.jvmargs=-Xmx2048m
minecraft_version=1.20.1
forge_version=47.1.42
org.gradle.daemon=false
org.gradle.debug=false

neogradle.subsystems.parchment.minecraftVersion=1.20.3
neogradle.subsystems.parchment.mappingsVersion=2023.12.31
minecraft_version=1.20.4
minecraft_version_range=[1.20.4,1.21)
neo_version=20.4.204
neo_version_range=[20.4,)
loader_version_range=[2,)

mod_id=reliquary
mod_name=Reliquary
mod_license=GNU General Public License v3.0
mod_version=2.0.36
jei_mc_version=1.20.1-forge
jei_version=15.1.0.19
curios_version=5.2.0-beta.3+1.20.1
mod_group_id=reliquary
mod_authors=x3n0ph0b3, TheMike, P3pp3rF1y
mod_description=Two words: magical swag. Oh, and a gun.
mod_credits=Originally made by x3n0ph0b3 and TheMike, now maintained by P3pp3rF1y.
mod_logo_file=xrlogo.png
mod_display_url=https://www.curseforge.com/minecraft/mc-mods/reliquary-reincarnations
mod_issue_tracker_url=https://github.com/p3pp3rF1y/reliquary/issues

jei_mc_version=1.20.4-neoforge
jei_version=17.3.0.49
curios_version=7.3.4+1.20.4
# botania_version=1.16.5-415-SNAPSHOT
parchment_version=2023.07.16-1.20.1
jade_cf_file_id=4654448
jade_cf_file_id=5109393
# hwyla_version = 1.8.20-B35_1.12
# jer_version = 0.8.7.41
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 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.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
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
Expand Up @@ -22,14 +22,13 @@
},
"requirements": [
[
"has_nebulous_heart",
"has_the_recipe"
"has_the_recipe",
"has_nebulous_heart"
]
],
"rewards": {
"recipes": [
"reliquary:alkahestry_altar"
]
},
"sends_telemetry_event": false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"neoforge:conditions": [
{
"type": "reliquary:alkahestry_enabled"
}
],
"parent": "minecraft:recipes/root",
"criteria": {
"has_the_recipe": {
"conditions": {
"recipe": "reliquary:alkahestry_tome"
},
"trigger": "minecraft:recipe_unlocked"
},
"has_witch_hat": {
"conditions": {
"items": [
{
"items": [
"reliquary:witch_hat"
]
}
]
},
"trigger": "minecraft:inventory_changed"
}
},
"requirements": [
[
"has_the_recipe",
"has_witch_hat"
]
],
"rewards": {
"recipes": [
"reliquary:alkahestry_tome"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
},
"requirements": [
[
"has_fertile_essence",
"has_the_recipe"
"has_the_recipe",
"has_fertile_essence"
]
],
"rewards": {
"recipes": [
"reliquary:angelheart_vial"
]
},
"sends_telemetry_event": false
}
}
Loading

0 comments on commit d0153ea

Please sign in to comment.