Skip to content

Commit

Permalink
Merge pull request #1 from LostLuma/feature/minecraft-1.21.0
Browse files Browse the repository at this point in the history
Add Minecraft 1.21.0 support
  • Loading branch information
Pixaurora authored Jul 6, 2024
2 parents 45c6c09 + 7bdcf0c commit adfe5d5
Show file tree
Hide file tree
Showing 35 changed files with 752 additions and 78 deletions.
20 changes: 0 additions & 20 deletions build-logic/src/main/groovy/kit_tunes.base_mod_conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,3 @@ processResources {
expand 'version': project.mod_version
}
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
// Minecraft 1.18 until Minecraft 1.20.5 requires Java 17.
it.options.release = 17
}

java {
// Still required by IDEs such as Eclipse and Visual Studio Code
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()

// If this mod is going to be a library, then it should also generate Javadocs in order to aid with development.
// Uncomment this line to generate them.
// withJavadocJar()
}
19 changes: 19 additions & 0 deletions build-logic/src/main/groovy/kit_tunes.java.17.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
plugins {
id 'java'
}

java {
withSourcesJar()

toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"

javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17)
}
}
19 changes: 19 additions & 0 deletions build-logic/src/main/groovy/kit_tunes.java.21.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
plugins {
id 'java'
}

java {
withSourcesJar()

toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"

javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(21)
}
}
19 changes: 19 additions & 0 deletions build-logic/src/main/groovy/kit_tunes.java.8.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
plugins {
id 'java'
}

java {
withSourcesJar()

toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"

javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(8)
}
}
23 changes: 4 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'maven-publish'
id 'kit_tunes.java.17'
id 'kit_tunes.base_mod_conventions'
}

Expand All @@ -21,9 +21,11 @@ dependencies {
include project(':subprojects:api')
include project(':subprojects:core')

include project(':subprojects:sound_events:r1.20.4')

include project(':subprojects:ui:r1.20.4')
include project(':subprojects:ui:r1.21.0')

include project(':subprojects:sound_events:r1.20.4')
}

// If you plan to use a different file for the license, don't forget to change the file name here!
Expand All @@ -32,20 +34,3 @@ jar {
rename { "${it}_${base.archivesName.get()}" }
}
}

// Configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Gradle Properties
org.gradle.jvmargs = -Xmx2G
org.gradle.jvmargs = -Xmx4G
org.gradle.parallel = true

# Mod Properties
Expand Down
5 changes: 2 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
minecraft = "1.20.4"
quilt_mappings = "1.20.4+build.3"

quilt_loom = "1.4.1"
quilt_loader = "0.23.1"
quilt_loom = "1.7.3"
quilt_loader = "0.26.0"

qsl = "8.0.0-alpha.11+1.20.4"

Expand All @@ -15,7 +15,6 @@ quilt_loom = { module = "org.quiltmc:loom", version.ref = "quilt_loom" }
quilt_loader = { module = "org.quiltmc:quilt-loader", version.ref = "quilt_loader" }

qsl_resource_loader = { module = "org.quiltmc.qsl.core:resource_loader", version.ref = "qsl"}
qsl_client_command = { module = "org.quiltmc.qsl.management:client_command", version.ref = "qsl"}

# If you have multiple similar dependencies, you can declare a dependency bundle and reference it on the build script with "libs.bundles.example".
[bundles]
Expand Down
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.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
16 changes: 8 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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 @@ -145,15 +145,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=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 @@ -202,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
9 changes: 7 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ pluginManagement {
}
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

includeBuild 'build-logic'

include('subprojects:api')
include('subprojects:core')

include('subprojects:ui:r1.20.4')

include('subprojects:sound_events:r1.20.4')

include('subprojects:ui:r1.20.4')
include('subprojects:ui:r1.21.0')
87 changes: 87 additions & 0 deletions src/main/resources/albums/tricky_trials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"name": "Minecraft: Tricky Trials (Original Game Soundtrack)",
"tracks": [
{
"matches": [
"featherfall"
],
"name": "Featherfall",
"artist": "kit_tunes.artists.aaron_cherof"
},
{
"matches": [
"watcher"
],
"name": "Watcher",
"artist": "kit_tunes.artists.aaron_cherof"
},
{
"matches": [
"puzzlebox"
],
"name": "Puzzlebox",
"artist": "kit_tunes.artists.aaron_cherof"
},
{
"matches": [
"komorebi"
],
"name": "komorebi",
"artist": "kit_tunes.artists.kumi_tanioka"
},
{
"matches": [
"pokopoko"
],
"name": "pokopoko",
"artist": "kit_tunes.artists.kumi_tanioka"
},
{
"matches": [
"yakusoku"
],
"name": "yakusoku",
"artist": "kit_tunes.artists.kumi_tanioka"
},
{
"matches": [
"deeper"
],
"name": "Deeper",
"artist": "kit_tunes.artists.lena_raine"
},
{
"matches": [
"eld_unknown"
],
"name": "Eld Unknown",
"artist": "kit_tunes.artists.lena_raine"
},
{
"matches": [
"endless"
],
"name": "Endless",
"artist": "kit_tunes.artists.lena_raine"
},
{
"matches": [],
"name": "Creator",
"artist": "kit_tunes.artists.lena_raine"
},
{
"matches": [
"creator"
],
"name": "Creator (Music Box Version)",
"artist": "kit_tunes.artists.lena_raine"
},
{
"matches": [
"precipice"
],
"name": "Precipice",
"artist": "kit_tunes.artists.aaron_cherof"
}
]
}
1 change: 1 addition & 0 deletions subprojects/api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
plugins {
id 'kit_tunes.java.17'
id 'kit_tunes.library_mod_conventions'
}
1 change: 1 addition & 0 deletions subprojects/core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id 'kit_tunes.java.17'
id 'kit_tunes.library_mod_conventions'
}

Expand Down
1 change: 1 addition & 0 deletions subprojects/sound_events/r1.20.4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id 'kit_tunes.java.17'
id 'kit_tunes.game_mod_conventions'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@
"depends": [
{
"id": "quilt_loader",
"versions": ">=0.19.1"
"versions": ">=0.26.0"
},
{
"id": "minecraft",
"versions": "=1.20.4"
"versions": {
"all": [">=1.20.4", "<=1.21.0"]
}
},
{
"id": "quilt_client_command",
"versions": { "all": [">=8.0.0-", "<9.0.0"] }
},
{
"id": "quilt_resource_loader",
"id": "quilted_fabric_resource_loader_v0",
"versions": "*"
}
]
Expand Down
2 changes: 1 addition & 1 deletion subprojects/ui/r1.20.4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id 'kit_tunes.java.17'
id 'kit_tunes.game_mod_conventions'
}

Expand All @@ -13,7 +14,6 @@ dependencies {
implementation project(':subprojects:api')
implementation project(':subprojects:core')

modImplementation libs.qsl.client.command
modImplementation libs.qsl.resource.loader

modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
Expand Down
Loading

0 comments on commit adfe5d5

Please sign in to comment.