Skip to content

Commit

Permalink
Port to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Edivad99 committed Jun 29, 2024
1 parent aebf22c commit 6d25324
Show file tree
Hide file tree
Showing 114 changed files with 527 additions and 577 deletions.
31 changes: 21 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ plugins {
id 'eclipse'
id 'idea'
id 'net.neoforged.gradle.userdev' version "$neo_gradle_version"
id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' version '2.1.0'
id 'me.modmuss50.mod-publish-plugin' version '0.5.0'
id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' version '2.1.2'
id 'me.modmuss50.mod-publish-plugin' version '0.5.1'
id 'com.diffplug.spotless' version '6.25.0'
}

Expand All @@ -22,12 +22,13 @@ base.archivesName = 'SolarGeneration'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
if (System.getProperty('idea.active')) {
vendor = JvmVendorSpec.JETBRAINS
}
}
}

println(repeat('*', 60))
println("Project Version: $version")
println("Java: ${System.getProperty('java.version')}")
Expand Down Expand Up @@ -78,13 +79,17 @@ repositories {
}
}

configurations {
runtimeClasspath.extendsFrom localRuntime
}

dependencies {
implementation "net.neoforged:neoforge:$neo_version"

//implementation "edivad:EdivadLib-$minecraft_version:2.1.1-snapshot"
implementation "curse.maven:edivadlib-638508:$edivadlib_id"
implementation "edivad:EdivadLib-$minecraft_version:3.0.0-snapshot"
//implementation "curse.maven:edivadlib-638508:$edivadlib_id"

runtimeOnly "mezz.jei:jei-$minecraft_version-neoforge:$jei_version"
localRuntime "mezz.jei:jei-$minecraft_version-neoforge:$jei_version"
}

spotless {
Expand All @@ -100,10 +105,16 @@ spotless {
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs.addAll(['-Xmaxerrs', '100000'])
}

idea {
module {
downloadSources = true
downloadJavadoc = true
}
}

tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
minecraft_version : minecraft_version,
Expand All @@ -116,8 +127,8 @@ tasks.withType(ProcessResources).configureEach {
]
inputs.properties replaceProperties

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

Expand Down Expand Up @@ -180,4 +191,4 @@ publishMods {
minecraftVersions.add(minecraft_version)
requires('edivadlib')
}
}
}
22 changes: 11 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ org.gradle.debug=false
org.gradle.caching=true # -30~ seconds trimmed from gradle --scan opt

## Environment Properties
minecraft_version=1.20.4
minecraft_version_range=[1.20.4,1.21)
neo_version=20.4.160-beta
neo_version_range=[20.4.160-beta,)
loader_version_range=[2,)
neo_gradle_version=7.0.93
minecraft_version=1.21
minecraft_version_range=[1.21,1.22)
neo_version=21.0.40-beta
neo_version_range=[21.0-beta,)
loader_version_range=[4,)
neo_gradle_version=7.0.152

## Parchment
neogradle.subsystems.parchment.minecraftVersion=1.20.3
neogradle.subsystems.parchment.mappingsVersion=2023.12.31
neogradle.subsystems.parchment.minecraftVersion=1.21
neogradle.subsystems.parchment.mappingsVersion=2024.06.23

## Mod Properties
mod_version=6.1.2
mod_version=7.0.0
edivadlib_id=5114890
edivadlib_version_range=[2.1.1,)
edivadlib_version_range=[3.0.0-snapshot,)

# Dependencies
jei_version=17.3.0.49
jei_version=19.0.0.11
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 13 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
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=SC2039,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=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -198,11 +202,11 @@ 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
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ pluginManagement {
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// 1.20.4 2024-02-17T12:42:25.573512 Tags for minecraft:block mod id solargeneration
2dcef60eaa3e33869208df16d9dcc6f45402d239 data/minecraft/tags/blocks/mineable/pickaxe.json
2dcef60eaa3e33869208df16d9dcc6f45402d239 data/minecraft/tags/blocks/needs_iron_tool.json
// 1.21 2024-06-28T19:26:44.498271 Tags for minecraft:block mod id solargeneration
2dcef60eaa3e33869208df16d9dcc6f45402d239 data/minecraft/tags/block/mineable/pickaxe.json
2dcef60eaa3e33869208df16d9dcc6f45402d239 data/minecraft/tags/block/needs_iron_tool.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 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
// 1.21 2024-06-28T22:36:59.181293 Loot Tables
667ea9f6207fc01f8694b542564172bb7c6ea2c5 data/solargeneration/loot_table/blocks/solar_panel_advanced.json
1f4ef78be0ca4dc39e75fc842cc6bb21683e3c7c data/solargeneration/loot_table/blocks/solar_panel_hardened.json
c8ab38d73baf4500f32007dd9509975c00f335dd data/solargeneration/loot_table/blocks/solar_panel_leadstone.json
2f3afc3cb2d6cb0dd00890fca926d5820b7d455e data/solargeneration/loot_table/blocks/solar_panel_redstone.json
a723d8ceb099f0fbcf7038dcf2b0ccdbad6a95c4 data/solargeneration/loot_table/blocks/solar_panel_resonant.json
bb50d0076f4861d29de59fba70954a6f4c27ba6d data/solargeneration/loot_table/blocks/solar_panel_signalum.json
741115f424f573106f384dc9f82c50014815b06c data/solargeneration/loot_table/blocks/solar_panel_ultimate.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.4 2023-12-26T15:31:07.057031 Languages: en_us for mod: solargeneration
// 1.21 2024-06-28T19:26:44.502016 Languages: en_us for mod: solargeneration
6d1541b7f5fe49fab013423de3c9c3b39f1de57a assets/solargeneration/lang/en_us.json
Loading

0 comments on commit 6d25324

Please sign in to comment.