Skip to content

Commit d3089ad

Browse files
committed
26.1-rc2 port
1 parent 84e7bf3 commit d3089ad

12 files changed

Lines changed: 95 additions & 36 deletions

File tree

build.gradle.kts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of Resourcify
3-
* Copyright (C) 2023-2025 DeDiamondPro
3+
* Copyright (C) 2023-2026 DeDiamondPro
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,9 @@ import dev.dediamondpro.buildsource.Platform
2020
import dev.dediamondpro.buildsource.VersionDefinition
2121
import dev.dediamondpro.buildsource.VersionRange
2222
import net.fabricmc.loom.task.RemapJarTask
23+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
24+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
25+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2326

2427
plugins {
2528
alias(libs.plugins.kotlin)
@@ -76,7 +79,7 @@ val shadeModImplementation: Configuration by configurations.creating {
7679

7780
// Version definitions
7881
val mcVersion = VersionDefinition( // Used for pre releases and release candidates
79-
"26.1" to "26.1-pre-2",
82+
"26.1" to "26.1-rc-2",
8083
default = mcPlatform.versionString
8184
)
8285
val compatibleMcVersion = VersionDefinition(
@@ -89,7 +92,7 @@ val compatibleMcVersion = VersionDefinition(
8992
"1.21.8" to VersionRange("1.21.6", "1.21.8", name = "1.21.8"),
9093
"1.21.10" to VersionRange("1.21.9", "1.21.10", name = "1.21.10"),
9194
"1.21.11" to VersionRange("1.21.11", "1.21.11", name = "1.21.11"),
92-
"26.1" to VersionRange("26.1", "26.2", inclusive = false, name = "26.1")
95+
"26.1" to VersionRange("26.1", "26.2", inclusive = false, name = "26.1", allowAll = true) // TODO: remove allow all for final release
9396
)
9497
val javaVersion = VersionDefinition(
9598
"1.20.1" to "17",
@@ -169,7 +172,7 @@ dependencies {
169172

170173
if (mcPlatform.isFabric) {
171174
val modImpl = if (mcPlatform.isObfuscated) "modImplementation" else "implementation"
172-
add(modImpl, "net.fabricmc:fabric-loader:0.17.3")
175+
add(modImpl, "net.fabricmc:fabric-loader:0.18.4")
173176
add(modImpl, "net.fabricmc:fabric-language-kotlin:${libs.versions.fabric.language.kotlin.get()}")
174177
add(modImpl, "net.fabricmc.fabric-api:fabric-api:${fabricApiVersion.get(mcPlatform)}")
175178
add(modImpl, "com.terraformersmc:modmenu:${modMenuVersion.get(mcPlatform)}")
@@ -303,6 +306,7 @@ tasks {
303306
}
304307
} else {
305308
named("shadowJar") { finalizedBy("copyJar") }
309+
named<Jar>("jar") { enabled = false }
306310
}
307311
register<Copy>("copyJar") {
308312
File("${project.rootDir}/jars").mkdir()
@@ -330,7 +334,13 @@ tasks {
330334
if (!mcPlatform.isForgeLike) exclude("pack.mcmeta")
331335
if (!mcPlatform.isForge && (!mcPlatform.isNeoForge || mcPlatform.version >= 12005)) exclude("META-INF/mods.toml")
332336
if (!mcPlatform.isNeoForge || mcPlatform.version < 12005) exclude("META-INF/neoforge.mods.toml")
333-
if (mcPlatform.minor == 20) exclude("1.21.resourcify.accesswidener") else exclude("1.20.resourcify.accesswidener")
337+
// Exclude all access wideners and mixin configs except the active ones
338+
listOf("1.20.resourcify", "1.21.resourcify", "1.21.9.resourcify", "26.1.resourcify")
339+
.filter { it != accessWidener }
340+
.forEach { exclude("$it.accesswidener") }
341+
listOf("mixins.resourcify.json", "mixins.resourcify-1.21.11.json")
342+
.filter { it != mixinPath }
343+
.forEach { exclude(it) }
334344
}
335345
withType<Jar> {
336346
from(rootProject.file("LICENSE"))
@@ -341,3 +351,10 @@ tasks {
341351
configure<JavaPluginExtension> {
342352
toolchain.languageVersion.set(JavaLanguageVersion.of(javaVersion.get(mcPlatform)))
343353
}
354+
355+
tasks.withType<KotlinCompile>().configureEach {
356+
compilerOptions {
357+
jvmTarget.set(JvmTarget.fromTarget(javaVersion.get(mcPlatform)))
358+
apiVersion.set(KotlinVersion.KOTLIN_2_0)
359+
}
360+
}

buildSrc/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of Resourcify
3-
* Copyright (C) 2025 DeDiamondPro
3+
* Copyright (C) 2025-2026 DeDiamondPro
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU Lesser General Public
@@ -21,4 +21,8 @@ plugins {
2121

2222
repositories {
2323
mavenCentral()
24+
}
25+
26+
kotlin {
27+
jvmToolchain(21)
2428
}

buildSrc/src/main/java/dev/dediamondpro/buildsource/VersionRange.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of Resourcify
3-
* Copyright (C) 2025 DeDiamondPro
3+
* Copyright (C) 2025-2026 DeDiamondPro
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU Lesser General Public
@@ -36,7 +36,7 @@ class VersionRange(
3636
fun getFabricRange(): String {
3737
if (allowAll) return "*"
3838
return buildString {
39-
append(">= $startVersion")
39+
append(">=$startVersion")
4040
if (!openEnd && inclusive) append(" <=$endVersion")
4141
else if (!openEnd) append(" <$endVersion")
4242
}

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fabric_language_kotlin = "1.11.0+kotlin.2.0.0" # Use 2.0.0 here since it is the
55

66
# Build system
77
arch_loom = "1.15.45"
8-
shadow = "8.1.1"
8+
shadow = "9.3.2"
99
publishing = "0.8.3"
1010

1111
# Markdown
@@ -32,7 +32,7 @@ kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
3232

3333
# Build system
3434
arch_loom = { id = "gg.essential.loom", version.ref = "arch_loom" }
35-
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
35+
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
3636
publishing = { id = "me.modmuss50.mod-publish-plugin", version.ref = "publishing" }
3737

3838
[bundles]

src/main/java/dev/dediamondpro/resourcify/mixins/MixinUIImage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package dev.dediamondpro.resourcify.mixins;
1919

20-
//?if >=1.21.11{
20+
//? if >=1.21.11 {
2121

2222
import com.mojang.blaze3d.systems.RenderSystem;
2323
import com.mojang.blaze3d.textures.AddressMode;

src/main/java/dev/dediamondpro/resourcify/mixins/MixinURenderPass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package dev.dediamondpro.resourcify.mixins;
1919

20-
//?if >=1.21.11{
20+
//? if >=1.21.11 {
2121

2222
import com.mojang.blaze3d.textures.GpuSampler;
2323
import dev.dediamondpro.resourcify.util.UFilterHandler;

src/main/java/dev/dediamondpro/resourcify/util/UFilterHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package dev.dediamondpro.resourcify.util;
1919

20-
//?if >=1.21.11{
20+
//? if >=1.21.11 {
2121

2222
import com.mojang.blaze3d.textures.GpuSampler;
2323

src/main/kotlin/dev/dediamondpro/resourcify/Constants.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of Resourcify
3-
* Copyright (C) 2023-2025 DeDiamondPro
3+
* Copyright (C) 2023-2026 DeDiamondPro
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU Lesser General Public
@@ -23,6 +23,6 @@ import org.slf4j.LoggerFactory
2323
object Constants {
2424
const val NAME = /*$ mod_name*/ "Resourcify"
2525
const val ID = /*$ mod_id*/ "resourcify"
26-
const val VERSION = /*$ mod_version*/ "1.8.0"
26+
const val VERSION = /*$ mod_version*/ "1.8.1"
2727
val LOGGER: Logger = LoggerFactory.getLogger(NAME)
2828
}

src/main/kotlin/dev/dediamondpro/resourcify/gui/injections/ImageButton.kt

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of Resourcify
3-
* Copyright (C) 2024-2025 DeDiamondPro
3+
* Copyright (C) 2024-2026 DeDiamondPro
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU Lesser General Public
@@ -18,11 +18,16 @@
1818
package dev.dediamondpro.resourcify.gui.injections
1919

2020
import com.mojang.blaze3d.systems.RenderSystem
21-
import net.minecraft.client.gui.GuiGraphics
2221
import net.minecraft.client.gui.components.Button
2322
import net.minecraft.client.gui.screens.Screen
2423
import net.minecraft.network.chat.Component
2524

25+
//? if >= 26.1 {
26+
import net.minecraft.client.gui.GuiGraphicsExtractor
27+
//?} else {
28+
/*import net.minecraft.client.gui.GuiGraphics
29+
*///?}
30+
2631
//? if >= 1.21.6
2732
import net.minecraft.client.renderer.RenderPipelines
2833

@@ -47,24 +52,38 @@ class ImageButton(
4752
this.y = yFunc.invoke(screen.height)
4853
}
4954

50-
override fun /*? if <1.21.11 {*/ /*renderWidget *//*?} else {*/ renderContents /*?}*/ (
55+
//? if <26.1 {
56+
/*override fun /^? if <1.21.11 {^/ /^renderWidget ^//^?} else {^/ renderContents /^?}^/ (
5157
context: GuiGraphics,
5258
mouseX: Int,
5359
mouseY: Int,
5460
delta: Float
5561
) {
5662
//? if <1.21.11
57-
/*super.renderWidget(context, mouseX, mouseY, delta)*/
63+
/^super.renderWidget(context, mouseX, mouseY, delta)^/
5864
5965
//? if <= 1.21.5
60-
/*RenderSystem.setShaderColor(1f, 1f, 1f, 1f)*/
66+
/^RenderSystem.setShaderColor(1f, 1f, 1f, 1f)^/
6167
//? if >= 1.21.6 {
6268
//? if >=1.21.11
6369
renderDefaultSprite(context)
6470
context.blit(RenderPipelines.GUI_TEXTURED, image, x + 2, y + 2, 0f, 0f, width - 4, height - 4, 16, 16)
6571
//?} else if >= 1.21.2 {
66-
/*context.blit(RenderType::guiTextured, image, x + 2, y + 2, 0f, 0f, width - 4, height - 4, 16, 16)
67-
*///?} else
68-
/*context.blit(image, x + 2, y + 2, 0f, 0f, width - 4, height - 4, 16, 16)*/
72+
/^context.blit(RenderType::guiTextured, image, x + 2, y + 2, 0f, 0f, width - 4, height - 4, 16, 16)
73+
^///?} else
74+
/^context.blit(image, x + 2, y + 2, 0f, 0f, width - 4, height - 4, 16, 16)^/
75+
}
76+
*///?}
77+
78+
//? if >=26.1 {
79+
override fun extractContents(
80+
graphics: GuiGraphicsExtractor,
81+
mouseX: Int,
82+
mouseY: Int,
83+
a: Float
84+
) {
85+
this.extractDefaultSprite(graphics)
86+
graphics.blit(RenderPipelines.GUI_TEXTURED, image, x + 2, y + 2, 0f, 0f, width - 4, height - 4, 16, 16)
6987
}
88+
//?}
7089
}

src/main/kotlin/dev/dediamondpro/resourcify/gui/update/components/UpdateCard.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of Resourcify
3-
* Copyright (C) 2023-2025 DeDiamondPro
3+
* Copyright (C) 2023-2026 DeDiamondPro
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU Lesser General Public
@@ -49,6 +49,7 @@ import net.minecraft.client.gui.screens.packs.PackSelectionScreen
4949
import java.awt.Color
5050
import java.io.File
5151
import java.util.concurrent.locks.ReentrantLock
52+
import java.util.function.Consumer
5253

5354

5455
class UpdateCard(
@@ -288,8 +289,10 @@ class UpdateCard(
288289
// Call the list change method
289290
//? if <1.21.9 {
290291
/*model.onListChanged.run()
291-
*///?} else
292-
model.onListChanged.accept(null)
292+
*///?} else {
293+
@Suppress("UNCHECKED_CAST")
294+
(model.onListChanged as Consumer<PackSelectionModel.EntryBase?>).accept(null)
295+
//?}
293296
break
294297
}
295298
}

0 commit comments

Comments
 (0)