Skip to content

Commit

Permalink
Port to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Edivad99 committed Dec 26, 2023
1 parent bdbb21c commit 4e2fd93
Show file tree
Hide file tree
Showing 107 changed files with 511 additions and 640 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build
# other
eclipse
run
runs
logs
libs
.DS_Store
Expand Down
89 changes: 39 additions & 50 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
import static org.apache.commons.lang3.StringUtils.repeat

plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'net.neoforged.gradle' version '[6.0.18,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' version '1.79.0'
id 'me.modmuss50.mod-publish-plugin' version '0.3.3'
id 'net.neoforged.gradle.userdev' version '7.0.57'
id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' version '1.81.4'
id 'me.modmuss50.mod-publish-plugin' version '0.4.5'
}

version = "$minecraft_version-$mod_version"
Expand All @@ -23,37 +23,24 @@ println("JVM: ${System.getProperty('java.vm.version')} (${System.getProperty('ja
println("Arch: ${System.getProperty('os.arch')}")
println(repeat('*', 60))

minecraft {
mappings channel: mappings_channel, version: mappings_version
minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')

copyIdeResources = true
runs {
configureEach {
systemProperty 'forge.logging.console.level', 'debug'

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

runs {
configureEach {
property 'forge.logging.console.level', 'debug'

mods {
solargeneration {
source sourceSets.main
}
}
}

client {
workingDirectory project.file('run/client')
}
modSource project.sourceSets.main
}

server {
workingDirectory project.file('run/server')
}
client {
}

data {
workingDirectory project.file('run/data')
server {
programArgument '--nogui'
}

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

Expand All @@ -74,49 +61,54 @@ repositories {
}

dependencies {
minecraft group: 'net.neoforged', name: 'forge', version: "$minecraft_version-$neo_version"
implementation "net.neoforged:neoforge:$neo_version"

//implementation fg.deobf("edivad:EdivadLib-$minecraft_version:2.0.0")
implementation fg.deobf("curse.maven:edivadlib-638508:$edivadlib_id")
implementation "curse.maven:edivadlib-638508:$edivadlib_id"

runtimeOnly fg.deobf("mezz.jei:jei-$minecraft_version-forge:$jei_version")
//runtimeOnly fg.deobf("mezz.jei:jei-$minecraft_version-forge:$jei_version")
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
options.encoding = 'UTF-8'
options.compilerArgs.addAll(["-Xmaxerrs", "100000"])
}

tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
mod_version: mod_version
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_version : mod_version,
edivadlib_version_range : edivadlib_version_range,
]
inputs.properties replaceProperties

filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
filesMatching(['META-INF/mods.toml']) {
expand replaceProperties + [project: project]
}
}

tasks.named('jar', Jar).configure {
manifest {
attributes([
'Specification-Title' : 'solargeneration',
'Specification-Vendor' : 'Edivad99',
'Specification-Version' : '1',
'Implementation-Title' : 'solargeneration',
'Implementation-Version' : project.version,
'Implementation-Vendor' : 'Edivad99',
'Implementation-Commit' : 'git rev-parse HEAD'.execute().text.trim(),
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
'Specification-Title' : 'solargeneration',
'Specification-Vendor' : 'Edivad99',
'Specification-Version' : '1',
'Implementation-Title' : 'solargeneration',
'Implementation-Version' : project.version,
'Implementation-Vendor' : 'Edivad99',
'Implementation-Commit' : 'git rev-parse HEAD'.execute().text.trim(),
])
}
finalizedBy 'reobfJar'
}

tasks.register('makeChangelog', GitChangelogTask) {
fromRepo = projectDir.absolutePath.toString()
fromCommit = '69e1d1fe0b7538af87a722b6c2157da4dde14983'
toRef = 'HEAD'
fromRevision = '69e1d1fe0b7538af87a722b6c2157da4dde14983'
toRevision = 'HEAD'
file = file('CHANGELOG.md')
untaggedName = 'Next release'
templateContent = file('changelog.mustache').text
Expand All @@ -131,9 +123,6 @@ publishMods {
changelog = changelogFile.exists() ? changelogFile.text : 'CHANGELOG.md not found'

modLoaders.add('neoforge')
if (minecraft_version.equals('1.20.1')) {
modLoaders.add('forge')
}
file = jar.archiveFile

curseforge {
Expand Down
20 changes: 11 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
org.gradle.debug=false
org.gradle.caching=true # -30~ seconds trimmed from gradle --scan opt

minecraft_version=1.20.1
neo_version=47.1.70

# Possible values: official / parchment
mappings_channel=parchment
mappings_version=2023.08.20-1.20.1
## Environment Properties
minecraft_version=1.20.4
minecraft_version_range=[1.20.4,1.21)
neo_version=20.4.55-beta
neo_version_range=[20.4,)
loader_version_range=[2,)

## Mod Properties
mod_version=6.0.2
edivadlib_id=4717006
edivadlib_id=4984450
edivadlib_version_range=[2.1.0,)

#Optional mod dependencies
# Dependencies
jei_version=15.2.0.27
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 6 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -144,15 +141,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// 1.20.1 2023-08-22T17:04:18.574133 SolarGeneration Item Tag
780de5b6d45437389a22e63a1a718827bdb09839 data/solargeneration/tags/items/solar_helmet.json
b9c4e2f1fe5240f493b7d9cc24ac73c8d98fafa7 data/solargeneration/tags/items/solar_panel.json
// 1.20.4 2023-12-26T15:38:39.059439 SolarGeneration Item Tag
98b7679346d84e5014ac38053ce2517a6e7837da data/solargeneration/tags/items/solar_helmet.json
eaf011ef32c5af4c542ba34db122ddfbe311bb21 data/solargeneration/tags/items/solar_panel.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 1.20.1 2023-06-23T19:16:14.16401 Loot Tables
444f5ad8929a89e3debb51ced874e9afdbeda637 data/solargeneration/loot_tables/blocks/solar_panel_advanced.json
879fe99691f5390276f6b91d432372e7767f8242 data/solargeneration/loot_tables/blocks/solar_panel_hardened.json
4e772c0e37c20d5ed5da49a65a82792195c56ec8 data/solargeneration/loot_tables/blocks/solar_panel_leadstone.json
743b649fc5848aabe4b4a30e9ba03b69f7021359 data/solargeneration/loot_tables/blocks/solar_panel_redstone.json
bee3a68e32ff80067cd94b2fab6e29351d7813b2 data/solargeneration/loot_tables/blocks/solar_panel_resonant.json
9b9b64eebdfc5e1b445c6d9f141c2c3ee7301d66 data/solargeneration/loot_tables/blocks/solar_panel_signalum.json
766cf115c5deb22a8bc6560fdb1a4867946898ff data/solargeneration/loot_tables/blocks/solar_panel_ultimate.json
// 1.20.4 2023-12-26T15:38:39.058477 Loot Tables
b4ee4f3491d8c04bd0fc39f455b5be2f99215e54 data/solargeneration/loot_tables/blocks/solar_panel_advanced.json
eade175f5be71482183dff4b04e586750967df73 data/solargeneration/loot_tables/blocks/solar_panel_hardened.json
2099a874dea38c154b3eb58465857a58e3351452 data/solargeneration/loot_tables/blocks/solar_panel_leadstone.json
e44d698a19468ee9e58d24931ee7e9136309453f data/solargeneration/loot_tables/blocks/solar_panel_redstone.json
d772630253729caaf2dc04789ca1ac666a475adf data/solargeneration/loot_tables/blocks/solar_panel_resonant.json
c0af30ebfd224b1076faa70d736339e1b665cac6 data/solargeneration/loot_tables/blocks/solar_panel_signalum.json
67499769b82ec1921c99535125c45c5ec9a1308e data/solargeneration/loot_tables/blocks/solar_panel_ultimate.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2023-08-22T17:04:18.575454 Languages: en_us
// 1.20.4 2023-12-26T15:31:07.057031 Languages: en_us for mod: solargeneration
6d1541b7f5fe49fab013423de3c9c3b39f1de57a assets/solargeneration/lang/en_us.json
Loading

0 comments on commit 4e2fd93

Please sign in to comment.