Skip to content

Commit c0fa092

Browse files
committed
26.2-pre4 fabric port
1 parent 8a962bc commit c0fa092

9 files changed

Lines changed: 119 additions & 11 deletions

File tree

build.gradle.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ val shadeModImplementation: Configuration by configurations.creating {
7979

8080
// Version definitions
8181
val mcVersion = VersionDefinition( // Used for pre releases and release candidates
82+
"26.2" to "26.2-pre-4",
8283
default = mcPlatform.versionString
8384
)
8485
val compatibleMcVersion = VersionDefinition(
@@ -91,11 +92,13 @@ val compatibleMcVersion = VersionDefinition(
9192
"1.21.8" to VersionRange("1.21.6", "1.21.8", name = "1.21.8"),
9293
"1.21.10" to VersionRange("1.21.9", "1.21.10", name = "1.21.10"),
9394
"1.21.11" to VersionRange("1.21.11", "1.21.11", name = "1.21.11"),
94-
"26.1.2" to VersionRange("26.1", "26.1", exclusiveUpperBound = "26.2", name = "26.1")
95+
"26.1.2" to VersionRange("26.1", "26.1.2", exclusiveUpperBound = "26.2", name = "26.1"),
96+
"26.2" to VersionRange("26.2", "26.2", exclusiveUpperBound = "26.3", name = "26.2", allowAll = true),
9597
)
9698
val javaVersion = VersionDefinition(
9799
"1.20.1" to "17",
98100
"26.1.2" to "25",
101+
"26.2" to "25",
99102
default = "21",
100103
)
101104
val parchmentVersion = VersionDefinition(
@@ -114,6 +117,7 @@ val fabricApiVersion = VersionDefinition(
114117
"1.21.10" to "0.136.0+1.21.10",
115118
"1.21.11" to "0.139.4+1.21.11",
116119
"26.1.2" to "0.150.0+26.1.2",
120+
"26.2" to "0.150.3+26.2",
117121
)
118122
val modMenuVersion = VersionDefinition(
119123
"1.20.1" to "7.2.2",
@@ -124,6 +128,7 @@ val modMenuVersion = VersionDefinition(
124128
"1.21.10" to "16.0.0-rc.1",
125129
"1.21.11" to "17.0.0-alpha.1",
126130
"26.1.2" to "18.0.0-alpha.6",
131+
"26.2" to "20.0.0-alpha.1",
127132
)
128133
val neoForgeVersion = VersionDefinition(
129134
"1.21.1" to "21.1.95",
@@ -160,6 +165,7 @@ val universalVersion = VersionDefinition(
160165
).let {
161166
VersionDefinition(
162167
"26.1.2-neoforge" to "26.1-fabric:499",
168+
"26.2" to "${it.get(mcPlatform)}-${mcPlatform.loaderString}:500+feature-mc-26.2-snapshot-7",
163169
default = "${it.get(mcPlatform)}-${mcPlatform.loaderString}:499"
164170
)
165171
}

settings.gradle.kts

Lines changed: 2 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) 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
@@ -50,6 +50,7 @@ val platforms = listOf(
5050
"1.21.11-fabric",
5151
"26.1.2-neoforge",
5252
"26.1.2-fabric",
53+
"26.2-fabric",
5354
)
5455

5556
stonecutter {

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

Lines changed: 4 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
@@ -19,6 +19,7 @@ package dev.dediamondpro.resourcify
1919

2020
import dev.dediamondpro.resourcify.platform.ThemeReloadListener
2121
import dev.dediamondpro.resourcify.config.SettingsPage
22+
import dev.dediamondpro.resourcify.handlers.VulkanHandler
2223

2324
//? if fabric {
2425
import net.fabricmc.api.ClientModInitializer
@@ -47,11 +48,11 @@ object Resourcify /*? if fabric {*/ : ClientModInitializer /*?}*/ {
4748
init {
4849
//? if neoforge {
4950
/*LOADING_CONTEXT.registerExtensionPoint(IConfigScreenFactory::class.java) {
50-
IConfigScreenFactory { _, _ -> SettingsPage() }
51+
IConfigScreenFactory { _, _ -> VulkanHandler.createOrBlock { SettingsPage() } }
5152
}
5253
*///?} else if forge {
5354
/*LOADING_CONTEXT.registerExtensionPoint(ConfigScreenFactory::class.java) {
54-
ConfigScreenFactory { _, _ -> SettingsPage() }
55+
ConfigScreenFactory { _, _ -> VulkanHandler.createOrBlock { SettingsPage() } }
5556
}
5657
*///?}
5758

src/main/kotlin/dev/dediamondpro/resourcify/config/ModMenuIntegration.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ package dev.dediamondpro.resourcify.config
2121

2222
import com.terraformersmc.modmenu.api.ConfigScreenFactory
2323
import com.terraformersmc.modmenu.api.ModMenuApi
24+
import dev.dediamondpro.resourcify.handlers.VulkanHandler
2425
import net.minecraft.client.gui.screens.Screen
2526

2627
class ModMenuIntegration : ModMenuApi {
2728
override fun getModConfigScreenFactory(): ConfigScreenFactory<*> {
2829
return SettingsFactory
2930
}
3031

31-
object SettingsFactory : ConfigScreenFactory<SettingsPage> {
32-
override fun create(parent: Screen?): SettingsPage = SettingsPage()
32+
object SettingsFactory : ConfigScreenFactory<Screen?> {
33+
override fun create(parent: Screen?): Screen? = VulkanHandler.createOrBlock { SettingsPage() }
3334
}
3435
}
3536

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

Lines changed: 4 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
@@ -22,6 +22,7 @@ import dev.dediamondpro.resourcify.gui.browsepage.BrowseScreen
2222
import dev.dediamondpro.resourcify.gui.update.UpdateGui
2323
import dev.dediamondpro.resourcify.services.ProjectType
2424
import dev.dediamondpro.resourcify.gui.data.Icons
25+
import dev.dediamondpro.resourcify.handlers.VulkanHandler
2526
import gg.essential.universal.UScreen
2627
import net.minecraft.client.gui.screens.Screen
2728

@@ -33,10 +34,10 @@ object PackScreensAddition {
3334
val folder = type.getDirectory(screen)
3435
val buttons = mutableListOf<ImageButton>()
3536
buttons.add(ImageButton(screen, type.plusX, type.plusY, Icons.PLUS) {
36-
UScreen.displayScreen(BrowseScreen(type, folder))
37+
VulkanHandler.runOrBlock { UScreen.displayScreen(BrowseScreen(type, folder)) }
3738
})
3839
if (type.hasUpdateButton(folder)) buttons.add(ImageButton(screen, type.updateX, type.updateY, Icons.UPDATE) {
39-
UScreen.displayScreen(UpdateGui(type, folder))
40+
VulkanHandler.runOrBlock { UScreen.displayScreen(UpdateGui(type, folder)) }
4041
})
4142
return buttons
4243
}

src/main/kotlin/dev/dediamondpro/resourcify/gui/world/DownloadWorldTab.kt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* This file is part of Resourcify
3+
* Copyright (C) 2026 DeDiamondPro
4+
*
5+
* This program is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License Version 3 as published by the Free Software Foundation.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
118
package dev.dediamondpro.resourcify.gui.world
219

320
import dev.dediamondpro.resourcify.gui.browsepage.BrowseScreen
@@ -10,6 +27,12 @@ import net.minecraft.client.gui.navigation.ScreenRectangle
1027
import net.minecraft.network.chat.Component
1128
import java.util.function.Consumer
1229

30+
//?if >=26.2 {
31+
import net.minecraft.client.gui.layouts.Layout
32+
import net.minecraft.client.gui.layouts.LinearLayout
33+
34+
//?}
35+
1336
class DownloadWorldTab : Tab {
1437
override fun getTabTitle(): Component {
1538
return Component.translatable("resourcify.world.download")
@@ -27,6 +50,14 @@ class DownloadWorldTab : Tab {
2750
override fun doLayout(rectangle: ScreenRectangle) {
2851
}
2952

53+
//?if >=26.2 {
54+
val layout: LinearLayout = LinearLayout.vertical()
55+
56+
override fun getLayout(): Layout {
57+
return layout
58+
}
59+
//?}
60+
3061
fun onClick() {
3162
UScreen.displayScreen(BrowseScreen(ProjectType.WORLD, Platform.getFileInGameDir("saves")))
3263
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* This file is part of Resourcify
3+
* Copyright (C) 2026 DeDiamondPro
4+
*
5+
* This program is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License Version 3 as published by the Free Software Foundation.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
package dev.dediamondpro.resourcify.handlers
19+
20+
import gg.essential.universal.UScreen
21+
import net.minecraft.client.gui.screens.Screen
22+
23+
//?if >=26.2 {
24+
import com.mojang.blaze3d.vulkan.VulkanBackend
25+
import net.minecraft.client.Minecraft
26+
import net.minecraft.client.gui.screens.AlertScreen
27+
import net.minecraft.network.chat.Component
28+
29+
//?}
30+
31+
object VulkanHandler {
32+
inline fun runOrBlock(callable: () -> Unit) {
33+
//?if >=26.2 {
34+
val mc = Minecraft.getInstance()
35+
if (mc.window.backend() is VulkanBackend) {
36+
val currentScreen = mc.gui.screen()
37+
mc.setScreenAndShow(
38+
AlertScreen(
39+
{ UScreen.displayScreen(currentScreen) },
40+
Component.translatable("resourcify.no-vulkan.title"),
41+
Component.translatable("resourcify.no-vulkan.description")
42+
)
43+
)
44+
return
45+
}
46+
//?}
47+
callable.invoke()
48+
}
49+
50+
inline fun createOrBlock(callable: () -> Screen): Screen {
51+
//?if >=26.2 {
52+
val mc = Minecraft.getInstance()
53+
if (mc.window.backend() is VulkanBackend) {
54+
val currentScreen = mc.gui.screen()
55+
return AlertScreen(
56+
{ UScreen.displayScreen(currentScreen) },
57+
Component.translatable("resourcify.no-vulkan.title"),
58+
Component.translatable("resourcify.no-vulkan.description")
59+
)
60+
}
61+
//?}
62+
return callable.invoke()
63+
}
64+
}

src/main/resources/assets/resourcify/lang/en_us.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
"resourcify.config.disable-gifs.title": "Disable GIF Rendering",
9393
"resourcify.config.disable-gifs.description": "Disable Resourcify's GIF rendering, this can help alleviate stuttering issues while loading images.",
9494

95+
"resourcify.no-vulkan.title": "Resourcify does not support Vulkan.",
96+
"resourcify.no-vulkan.description": "Resourcify does currently not support the Vulkan rendering backend.\nThis is due to the libraries Resourcify uses internally, updating everything will take some time.\n\nFor now, please switch back to the OpenGL backend in video settings.",
97+
9598
"resourcify.categories.adventure": "Adventure",
9699
"resourcify.categories.categories": "Categories",
97100
"resourcify.categories.cursed": "Cursed",

stonecutter.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ plugins {
1919
id("dev.kikugie.stonecutter")
2020
alias(libs.plugins.arch.loom) apply false
2121
}
22-
stonecutter active "26.1.2-fabric" /* [SC] DO NOT EDIT */
22+
stonecutter active "26.2-fabric" /* [SC] DO NOT EDIT */
2323

2424
stonecutter tasks {
2525
val ordering = versionComparator.thenComparingInt {

0 commit comments

Comments
 (0)