Skip to content

Commit

Permalink
feat: upgrade to 1.20 (#929)
Browse files Browse the repository at this point in the history
* chore: update mdk to 1.20

* chore: move namespace

* chore: add recently updated deps back

* fix: new base class

* fix: first compiler errors related to level access now behind a getter

* fix: property mapping

* chore: temporarily enable 1.19.4 curios

to get an accurate compiler error overview

* chore: disable AU integration until available

* feat: update code to 1.20

* chore: finally get rid of the region comments

* feat: update code to 1.20

* chore: intellij reformat code

* feat: update code to 1.20

* feat: tags

* feat: enable curios now that it is updated

* chore: run datagen
  • Loading branch information
klikli-dev authored Jun 12, 2023
1 parent 62b100a commit fda4bbe
Show file tree
Hide file tree
Showing 564 changed files with 3,649 additions and 4,302 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ jobs:
with:
arguments: build
env:
VERSION: ${{ steps.get_mc_version.outputs.result }}-${{ steps.get_version.outputs.result }}
MOD_VERSION: ${{ steps.get_version.outputs.result }}
MINECRAFT_VERSION: ${{ steps.get_mc_version.outputs.result }}
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
- name: Update CHANGELOG
id: changelog
Expand All @@ -73,7 +74,7 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v4
if: ${{ steps.get_release_type.outputs.result != 'test' }}
with:
branch: version/1.19.4
branch: version/1.20.0
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
file_pattern: CHANGELOG.md
- name: Upload to Curseforge
Expand All @@ -90,7 +91,7 @@ jobs:
${{ steps.changelog.outputs.changes }}
Find changes for all versions at https://github.com/klikli-dev/occultism/releases
game_versions: Forge,Minecraft 1.19:${{ steps.get_mc_version.outputs.result }}
game_versions: Forge,Minecraft 1.20:${{ steps.get_mc_version.outputs.result }}
display_name: occultism-${{ steps.get_mc_version.outputs.result }}-${{ steps.get_version.outputs.result }}.jar
release_type: ${{ steps.get_release_type.outputs.result }}
relations: modonomicon:requiredDependency,curios:requiredDependency,geckolib:requiredDependency,smartbrainlib:requiredDependency,theurgy:optionalDependency,jei:optionalDependency,almost-unified:optionalDependency,perviaminvenire:optionalDependency
114 changes: 79 additions & 35 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
plugins {
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '5.+'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
}

if (System.getenv('VERSION') != null) {
version = System.getenv('VERSION')
} else {
version = "${mc_version}-${mod_version}"
if (System.getenv('MOD_VERSION') != null) {
mod_version = System.getenv('MOD_VERSION')
}
if (System.getenv('MINECRAFT_VERSION') != null) {
minecraft_version = System.getenv('MINECRAFT_VERSION')
}
version = "${minecraft_version}-${mod_version}"

group = mod_group_id

group = "com.github.klikli_dev"
archivesBaseName = "occultism"
base {
archivesName = mod_id
}

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

Expand Down Expand Up @@ -44,7 +49,7 @@ minecraft {
jvmArgs '-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions'

mods {
occultism {
"${mod_id}" {
source sourceSets.main
}
}
Expand Down Expand Up @@ -73,7 +78,7 @@ minecraft {
jvmArgs '-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions'

mods {
occultism {
"${mod_id}" {
source sourceSets.main
}
}
Expand All @@ -95,7 +100,7 @@ minecraft {
args '--mod', 'occultism', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

mods {
occultism {
"${mod_id}" {
source sourceSets.main
}
}
Expand Down Expand Up @@ -168,36 +173,40 @@ dependencies {
minecraft "net.minecraftforge:forge:${forge_version}"

//Jei
compileOnly fg.deobf("mezz.jei:jei-${jei_mc_version}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${jei_mc_version}-forge-api:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_mc_version}-forge:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")

//curios
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_mc_version}-${curios_version}:api")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_mc_version}-${curios_version}")
//TODO: reenable once updated
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${minecraft_version}:api")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${minecraft_version}")


//geckolib
implementation fg.deobf("software.bernie.geckolib:geckolib-forge-${geckolib_mc_version}:${geckolib_version}")
implementation fg.deobf("software.bernie.geckolib:geckolib-forge-${minecraft_version}:${geckolib_version}")

//smartbrainlib
implementation fg.deobf("net.tslat.smartbrainlib:SmartBrainLib-forge-${smartbrainlib_mc_version}:${smartbrainlib_version}")
implementation fg.deobf("net.tslat.smartbrainlib:SmartBrainLib-forge-${minecraft_version}:${smartbrainlib_version}")

//almostunified
compileOnly fg.deobf("com.almostreliable.mods:almostunified-forge:${almostunified_version}")
runtimeOnly fg.deobf("com.almostreliable.mods:almostunified-forge:${almostunified_version}")
//TODO: reenable once updated
// compileOnly fg.deobf("com.almostreliable.mods:almostunified-forge:${almostunified_version}")
// runtimeOnly fg.deobf("com.almostreliable.mods:almostunified-forge:${almostunified_version}")

//modonomicon
implementation fg.deobf("com.klikli_dev:modonomicon:${modonomicon_mc_version}-${modonomicon_version}") //we build against full jar because we NEED IT ALL
implementation fg.deobf("com.klikli_dev:modonomicon:${minecraft_version}-${modonomicon_version}")
//we build against full jar because we NEED IT ALL

//theurgy
compileOnly fg.deobf("com.klikli_dev:theurgy:${theurgy_mc_version}-${theurgy_version}")
runtimeOnly fg.deobf("com.klikli_dev:theurgy:${theurgy_mc_version}-${theurgy_version}")
compileOnly fg.deobf("com.klikli_dev:theurgy:${minecraft_version}-${theurgy_version}")
runtimeOnly fg.deobf("com.klikli_dev:theurgy:${minecraft_version}-${theurgy_version}")

//runtime only helper mods for dev env, placed in ./runtime-mods, example: Hwyla-forge-1.10.11-B78_1.16.2.jar
//runtimeOnly fg.deobf("ignoredvalue:Hwyla:forge-1.10.11-B78_1.16.2")

//alltheores - for recipe testing
//enable once available for 1.19.3
//enable once available for 1.20
//runtimeOnly fg.deobf("curse.maven:alltheores-405593:xyz") //

//Ma for crafting issue testing
Expand All @@ -206,28 +215,64 @@ dependencies {

//PerViamInvenire - for AI integration testing
//runtimeOnly fg.deobf("curse.maven:perviaminvenire-449945:xyz") //
//enable once available for 1.19.3
//enable once available for 1.20
//runtimeOnly fg.deobf("com.ldtteam:per_viam_invenire:1.19.3-XYZ-RELEASE:universal")
}


// This block of code expands all declared replace properties in the specified resource targets.
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
def resourceTargets = ['META-INF/mods.toml', 'pack.mcmeta']
def replaceProperties = [
minecraft_version : minecraft_version,
minecraft_version_range : minecraft_version_range,
forge_version : forge_version,
forge_version_range : forge_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_authors : mod_authors,
mod_description : mod_description,
jei_version_range : jei_version_range,
curios_version_range : curios_version_range,
geckolib_version_range : geckolib_version_range,
smartbrainlib_version_range : smartbrainlib_version_range,
almostunified_version_range : almostunified_version_range,
modonomicon_version_range : modonomicon_version_range,
theurgy_version_range : theurgy_version_range,
per_viam_invenire_version_range: per_viam_invenire_version_range,
]
processResources {
inputs.properties replaceProperties
replaceProperties.put 'project', project

filesMatching(resourceTargets) {
expand replaceProperties
}
}

// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title": "occultism",
"Specification-Vendor": "Kli Kli",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"Kli Kli",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
"Specification-Title" : mod_id,
"Specification-Vendor" : mod_authors,
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : mod_version,
"Implementation-Vendor" : mod_authors,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}

// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')

Expand All @@ -251,9 +296,8 @@ afterEvaluate {
}
}

compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

processResources.setDuplicatesStrategy(DuplicatesStrategy.WARN)
58 changes: 39 additions & 19 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,48 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

mod_version=0.0.1
mc_version=1.19.4
forge_version=1.19.4-45.0.43
## Environment Properties

# The Minecraft version must agree with the Forge version to get a valid artifact
minecraft_version=1.20
# The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.20,1.21)
# The Forge version must agree with the Minecraft version to get a valid artifact
forge_version=1.20-46.0.1
# The Forge version range can use any version of Forge as bounds or match the loader version range
forge_version_range=[46,)
# The loader version range can only use the major version of Forge/FML as bounds
loader_version_range=[46,)

mapping_channel=parchment
#postfix is target mc version, optional prefix is source parchment mc version
mapping_version=1.19.3-2023.03.12-1.19.4

jei_mc_version=1.19.4
jei_version=13.1.0.7
curios_mc_version=1.19.4
curios_version=5.1.4.2
geckolib_mc_version=1.19.4
geckolib_version=4.1.2
smartbrainlib_mc_version=1.19.4
smartbrainlib_version=1.9
mapping_version=1.19.3-2023.03.12-1.20

# Almost Unified vTODO
almostunified_version=1.19.4-0.3.8
## Mod Properties

modonomicon_mc_version=1.19.4
modonomicon_version=1.30.1
mod_id=occultism
mod_name=Occultism
mod_license=MIT
mod_version=1.80.1
mod_group_id=com.klikli_dev
mod_authors=Kli Kli
mod_description=A magic mod inspired by the world of Jonathan Stroud's Bartimaeus. With the help of occult rituals players can summon entities from the "Other Side" to perform magic.

theurgy_mc_version=1.19.4
theurgy_version=1.3.0
## Dependency Properties
jei_version=14.0.0.4
jei_version_range=[14.0.0.4,)
curios_version=5.2.0-beta.2
curios_version_range=[5.2.0-beta.1,)
geckolib_version=4.2
geckolib_version_range=[4.2,)
smartbrainlib_version=1.11
smartbrainlib_version_range=[1.11,)
almostunified_version=XYZ
almostunified_version_range=[0,)
modonomicon_version=1.32.2
modonomicon_version_range=[1.32.2,)
theurgy_version=1.3.5
theurgy_version_range=[1.3.5,)
per_viam_invenire_version_range=[0.1.57,)
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
9 changes: 3 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# SPDX-FileCopyrightText: 2022 klikli-dev
#
# SPDX-License-Identifier: MIT

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
4 changes: 4 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ pluginManagement {
url = 'https://maven.parchmentmc.org'
}
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
],
"rolls": 1.0
}
]
],
"random_sequence": "minecraft:empty"
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
[
"craft_dimensional_matrix"
]
]
],
"sends_telemetry_event": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
[
"craft_dimensional_mineshaft"
]
]
],
"sends_telemetry_event": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
[
"craft_familiar_ring"
]
]
],
"sends_telemetry_event": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
[
"craft_infused_lenses"
]
]
],
"sends_telemetry_event": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
[
"craft_infused_pickaxe"
]
]
],
"sends_telemetry_event": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
[
"craft_miner_afrit_deeps"
]
]
],
"sends_telemetry_event": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
[
"craft_miner_djinni_ores"
]
]
],
"sends_telemetry_event": true
}
Loading

0 comments on commit fda4bbe

Please sign in to comment.