Skip to content

Commit

Permalink
Initial port to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
BlakeBr0 committed Aug 10, 2024
1 parent d44dcdf commit 59f2852
Show file tree
Hide file tree
Showing 62 changed files with 1,305 additions and 1,543 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ build
eclipse
run
libs
logs
logs
runs
run-data
131 changes: 66 additions & 65 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.spongepowered.mixin' version '0.7.+'
id 'net.neoforged.moddev' version '1.0.14'
}

version = '1.20.1-7.0.6'
Expand All @@ -13,7 +13,7 @@ base {
archivesName = 'IronJetpacks'
}

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

println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"

Expand All @@ -31,98 +31,88 @@ repositories {
}
}

minecraft {
mappings channel: 'official', version: '1.20.1'
neoForge {
version = neo_version

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
copyIdeResources = true
parchment {
mappingsVersion = parchment_mappings_version
minecraftVersion = parchment_minecraft_version
}

runs {
client {
workingDirectory project.file('run')

arg '-mixin.config=cucumber.mixins.json'

property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'

ideaModule rootProject.name != project.name ? "${rootProject.name}.${project.name}.main" : "${project.name}.main"

mods {
ironjetpacks {
source sourceSets.main
}

if (isWorkspace) {
cucumber {
source project(':Cucumber').sourceSets.main
}
}
}
client()
}

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

arg '-mixin.config=cucumber.mixins.json'
gameTestServer {
type = "gameTestServer"
}

property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
data {
data()

ideaModule rootProject.name != project.name ? "${rootProject.name}.${project.name}.main" : "${project.name}.main"
// programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}

mods {
ironjetpacks {
source sourceSets.main
}
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
logLevel = org.slf4j.event.Level.DEBUG
}
}

if (isWorkspace) {
cucumber {
source project(':Cucumber').sourceSets.main
}
}
mods {
ironjetpacks {
sourceSet(sourceSets.main)
}

if (isWorkspace) {
cucumber {
sourceSet(project(':Cucumber').sourceSets.main)
}
}
}
}

dependencies {
minecraft "net.minecraftforge:forge:${forge_version}"
configurations {
runtimeClasspath.extendsFrom localRuntime
}

dependencies {
if (isWorkspace) {
implementation project(':Cucumber')
implementation(project(':Cucumber')) {
transitive = false
}
} else {
implementation fg.deobf("com.blakebr0.cucumber:Cucumber:${cucumber_version}")
implementation "com.blakebr0.cucumber:Cucumber:${cucumber_version}"
}

implementation fg.deobf("curse.maven:controllable-317269:${controllable_version}")
implementation fg.deobf("curse.maven:framework-549225:${framework_version}")
compileOnly "curse.maven:controllable-317269:${controllable_version}"
compileOnly "curse.maven:framework-549225:${framework_version}"

runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}")
runtimeOnly fg.deobf("curse.maven:jade-324717:${jade_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_mc_version}-forge:${jei_version}")
// runtimeOnly "top.theillusivec4.curios:curios-forge:${curios_version}"
runtimeOnly "curse.maven:jade-324717:${jade_version}"
runtimeOnly "mezz.jei:jei-${jei_mc_version}-neoforge:${jei_version}"

compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}:api")
compileOnly "top.theillusivec4.curios:curios-forge:${curios_version}:api"
compileOnly "mezz.jei:jei-${jei_mc_version}-common-api:${jei_version}"
compileOnly "mezz.jei:jei-${jei_mc_version}-forge-api:${jei_version}"
compileOnly "mezz.jei:jei-${jei_mc_version}-neoforge-api:${jei_version}"
}

jar {
manifest {
attributes([
'Specification-Title': 'Iron Jetpacks',
'Specification-Vendor': 'BlakeBr0',
'Specification-Version': '1',
'Implementation-Title': project.name,
'Implementation-Version': "${version.split('-').last()}",
'Implementation-Vendor' : 'BlakeBr0',
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
mod_version : version.split('-').last(),
]
inputs.properties replaceProperties

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

jar.finalizedBy('reobfJar')

publishing {
publications {
maven(MavenPublication) {
Expand All @@ -144,4 +134,15 @@ publishing {
}
}
}
}

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

idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
17 changes: 12 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +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.daemon=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true

minecraft_version=1.21
neo_version=21.0.143
parchment_minecraft_version=1.21
parchment_mappings_version=2024.07.28

forge_version=1.20.1-47.1.0
cucumber_version=1.20.1-7.0.1
jei_version=15.2.0.22
jei_mc_version=1.20.1
jade_version=4573193
jei_version=19.7.0.79
jei_mc_version=1.21
jade_version=5591256
curios_version=5.2.0-beta.3+1.20.1
controllable_version=4598985
framework_version=4718251
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.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
34 changes: 21 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -83,10 +85,9 @@ done
# This is normally unused
# shellcheck disable=SC2034
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"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +134,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 @@ -197,11 +201,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# 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.

# 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, 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
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,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 +59,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
8 changes: 3 additions & 5 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
maven {
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/'
}
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'
}
Loading

0 comments on commit 59f2852

Please sign in to comment.