Skip to content

Commit 3300e80

Browse files
committed
chore: update dependencies and Gradle configurations
- Change Fabric Loom plugin ID and update versions for Minecraft, Fabric Loader, and Fabric API. - Upgrade Java compatibility from 21 to 25. - Modify Gradle wrapper to use version 9.4.1. - Refactor rendering methods to use updated GuiGraphicsExtractor.
1 parent 16a7e66 commit 3300e80

7 files changed

Lines changed: 30 additions & 31 deletions

File tree

build.gradle

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version "${loom_version}"
2+
id 'net.fabricmc.fabric-loom' version "${loom_version}"
33
id 'org.jetbrains.kotlin.jvm' version "${kotlin_version}"
44
id 'maven-publish'
55
}
@@ -35,16 +35,15 @@ repositories {
3535
dependencies {
3636
// To change the versions see the gradle.properties file
3737
minecraft "com.mojang:minecraft:${project.minecraft_version}"
38-
mappings loom.officialMojangMappings()
39-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
38+
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
4039

4140
// Fabric API. This is technically optional, but you probably want it anyway.
42-
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
41+
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
4342

4443
// Cactus Mod (Change here the Version you want to use)
45-
modImplementation "maven.modrinth:cactus:0.12.3"
46-
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_language_kotlin_version}"
47-
modImplementation "org.endlesssource.mediainterface:all:${project.mediainterface_version}"
44+
implementation "maven.modrinth:cactus:0.13"
45+
implementation "net.fabricmc:fabric-language-kotlin:${project.fabric_language_kotlin_version}"
46+
implementation "org.endlesssource.mediainterface:all:${project.mediainterface_version}"
4847
}
4948

5049
processResources {
@@ -60,7 +59,7 @@ processResources {
6059
}
6160

6261
tasks.withType(JavaCompile).configureEach {
63-
it.options.release = 21
62+
it.options.release = 25
6463
}
6564

6665
java {
@@ -69,16 +68,16 @@ java {
6968
// If you remove this line, sources will not be generated.
7069
withSourcesJar()
7170

72-
sourceCompatibility = JavaVersion.VERSION_21
73-
targetCompatibility = JavaVersion.VERSION_21
71+
sourceCompatibility = JavaVersion.VERSION_25
72+
targetCompatibility = JavaVersion.VERSION_25
7473
}
7574

7675
kotlin {
77-
jvmToolchain(21)
76+
jvmToolchain(25)
7877
}
7978

8079
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
81-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21
80+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget("25")
8281
}
8382

8483
jar {

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ org.gradle.configuration-cache=false
77

88
# Fabric Properties
99
# check these on https://fabricmc.net/develop
10-
minecraft_version=1.21.11
11-
loader_version=0.18.4
12-
loom_version=1.15-SNAPSHOT
10+
minecraft_version=26.1
11+
loader_version=0.19.2
12+
loom_version=1.16-SNAPSHOT
1313

1414
# Mod Properties
1515
mod_version=1.0
1616
maven_group=xyz.datenflieger
1717
archives_base_name=trackview
1818

1919
# Dependencies
20-
fabric_api_version=0.141.3+1.21.11
20+
fabric_api_version=0.145.1+26.1
2121
kotlin_version=2.3.20
2222
fabric_language_kotlin_version=1.13.10+kotlin.2.3.20
2323
mediainterface_version=0.2.3

gradle/wrapper/gradle-wrapper.jar

3.25 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/kotlin/xyz/datenflieger/trackview/hud/TrackViewHudElement.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import com.dwarslooper.cactus.client.systems.config.settings.impl.IntegerSetting
66
import com.dwarslooper.cactus.client.systems.config.settings.impl.Setting
77
import com.dwarslooper.cactus.client.util.CactusConstants.mc
88
import com.dwarslooper.cactus.client.util.generic.TextUtils
9-
import net.minecraft.client.gui.GuiGraphics
9+
import net.minecraft.client.gui.GuiGraphicsExtractor
1010
import net.minecraft.client.renderer.RenderPipelines
1111
import org.endlesssource.mediainterface.api.PlaybackState
1212
import org.joml.Vector2i
@@ -64,7 +64,7 @@ class TrackViewHudElement : DynamicHudElement<TrackViewHudElement>("trackView",
6464
TrackViewMediaService.start()
6565
}
6666

67-
override fun render(context: GuiGraphics, x: Int, y: Int, screenWidth: Int, screenHeight: Int, delta: Float, inEditor: Boolean) {
67+
override fun render(context: GuiGraphicsExtractor, x: Int, y: Int, screenWidth: Int, screenHeight: Int, delta: Float, inEditor: Boolean) {
6868
val snapshot = if (inEditor) editorSnapshot else TrackViewMediaService.snapshot()
6969
if (!inEditor && hideWhenNoMedia.get() && !snapshot.hasMedia) {
7070
return
@@ -75,7 +75,7 @@ class TrackViewHudElement : DynamicHudElement<TrackViewHudElement>("trackView",
7575
}
7676

7777
override fun renderContent(
78-
context: GuiGraphics,
78+
context: GuiGraphicsExtractor,
7979
x: Int,
8080
y: Int,
8181
width: Int,
@@ -116,16 +116,16 @@ class TrackViewHudElement : DynamicHudElement<TrackViewHudElement>("trackView",
116116
val title = TextUtils.trimToWidth("$statePrefix $rawTitle", textSpace, "...")
117117
val artist = TextUtils.trimToWidth(rawArtist, textSpace, "...")
118118

119-
context.drawString(mc.font, title, drawX, drawY, textColorValue, textShadows())
119+
context.text(mc.font, title, drawX, drawY, textColorValue, textShadows())
120120

121121
val secondLineY = drawY + mc.font.lineHeight + lineSpacing
122-
context.drawString(mc.font, artist, drawX, secondLineY, accentTitleColor, textShadows())
122+
context.text(mc.font, artist, drawX, secondLineY, accentTitleColor, textShadows())
123123

124124
if (showSourceApp.get()) {
125125
val source = snapshot.sourceApp.ifBlank { "Unknown player" }
126126
val sourceY = secondLineY + mc.font.lineHeight + if (compact) compactExtraSourceOffset else defaultSourceOffset
127127
val sourceText = TextUtils.trimToWidth(source, textSpace, "...")
128-
context.drawString(mc.font, sourceText, drawX, sourceY, accentSourceColor, textShadows())
128+
context.text(mc.font, sourceText, drawX, sourceY, accentSourceColor, textShadows())
129129
}
130130

131131
if (showProgressBar.get() && snapshot.durationMillis != null && snapshot.durationMillis > 0L && snapshot.positionMillis != null) {
@@ -144,8 +144,8 @@ class TrackViewHudElement : DynamicHudElement<TrackViewHudElement>("trackView",
144144
return getSize()
145145
}
146146

147-
private fun drawNoMediaFallback(context: GuiGraphics, x: Int, y: Int, width: Int, height: Int, color: Int) {
148-
context.drawCenteredString(mc.font, "No active media", x + width / 2, y + (height - mc.font.lineHeight) / 2 + 1, color)
147+
private fun drawNoMediaFallback(context: GuiGraphicsExtractor, x: Int, y: Int, width: Int, height: Int, color: Int) {
148+
context.centeredText(mc.font, "No active media", x + width / 2, y + (height - mc.font.lineHeight) / 2 + 1, color)
149149
}
150150

151151
private fun resolveThumbnailSize(compact: Boolean, height: Int): Int {
@@ -158,15 +158,15 @@ class TrackViewHudElement : DynamicHudElement<TrackViewHudElement>("trackView",
158158
return base.coerceAtMost((height - padding * 2).coerceAtLeast(0))
159159
}
160160

161-
private fun renderThumbnail(context: GuiGraphics, snapshot: TrackViewSnapshot, x: Int, y: Int, size: Int) {
161+
private fun renderThumbnail(context: GuiGraphicsExtractor, snapshot: TrackViewSnapshot, x: Int, y: Int, size: Int) {
162162
val artworkId = snapshot.artworkToken?.let(TrackViewArtworkCache::request)
163163
if (artworkId != null) {
164164
context.blit(RenderPipelines.GUI_TEXTURED, artworkId, x, y, 0f, 0f, size, size, size, size)
165165
return
166166
}
167167

168168
context.fill(x, y, x + size, y + size, placeholderColor)
169-
context.drawCenteredString(mc.font, "", x + size / 2, y + (size - mc.font.lineHeight) / 2 + 1, placeholderNoteColor)
169+
context.centeredText(mc.font, "", x + size / 2, y + (size - mc.font.lineHeight) / 2 + 1, placeholderNoteColor)
170170
}
171171

172172
private fun statePrefix(state: PlaybackState): String {

src/main/resources/fabric.mod.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
]
2020
},
2121
"depends": {
22-
"fabricloader": ">=0.17.3",
23-
"minecraft": "~1.21.11",
24-
"java": ">=21",
22+
"fabricloader": ">=0.19.2",
23+
"minecraft": "~26.1",
24+
"java": ">=25",
2525
"fabric-api": "*",
2626
"fabric-language-kotlin": ">=${fabric_language_kotlin_version}"
2727
}

0 commit comments

Comments
 (0)