Move TitleScreenMixin to fabric, to replace it using a RegisterMenuScreensEvent in neoforge

Signed-off-by: Username404-59 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404-59 2025-02-02 19:48:02 +01:00
parent febeddb093
commit 2fa0575f68
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
6 changed files with 17 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import net.minecraft.client.gui.GuiGraphics
import kotlin.reflect.full.findAnnotation
sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
internal companion object {
companion object {
private fun addButtons(vararg buttons: ButtonImpl) {
buttons.groupBy { impl ->
ClickGui.clickBoxes.find { box ->

View File

@ -5,7 +5,6 @@
"client": [
"KeysAccessor",
"KeyMappings",
"TitleScreenMixin",
"OptionValueAccessor"
],
"injectors": {

View File

@ -4,6 +4,7 @@
"compatibilityLevel": "JAVA_18",
"client": [
"EndTickMixin",
"TitleScreenMixin",
"ZoomMixin",
"OkZoomerAlternativeMixin"
],

View File

@ -30,6 +30,7 @@ class ForgeInit(container: ModContainer): Snowy() {
container.eventBus!!.run {
addListener(this@ForgeInit::initSetup)
register(EndTickHandler)
register(MiscHandlers)
register(HudHandler)
register(ZoomHandler)
}

View File

@ -0,0 +1,14 @@
package fr.username404.snowygui.forge
import fr.username404.snowygui.ClickGui
import fr.username404.snowygui.gui.feature.ButtonImpl
import net.neoforged.bus.api.SubscribeEvent
import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent
object MiscHandlers {
@SubscribeEvent
fun handleClickGuiInit(event: RegisterMenuScreensEvent) {
ClickGui.tick()
ButtonImpl.initButtons()
}
}