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:
parent
febeddb093
commit
2fa0575f68
|
@ -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 ->
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
"client": [
|
||||
"KeysAccessor",
|
||||
"KeyMappings",
|
||||
"TitleScreenMixin",
|
||||
"OptionValueAccessor"
|
||||
],
|
||||
"injectors": {
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
"compatibilityLevel": "JAVA_18",
|
||||
"client": [
|
||||
"EndTickMixin",
|
||||
"TitleScreenMixin",
|
||||
"ZoomMixin",
|
||||
"OkZoomerAlternativeMixin"
|
||||
],
|
||||
|
|
|
@ -30,6 +30,7 @@ class ForgeInit(container: ModContainer): Snowy() {
|
|||
container.eventBus!!.run {
|
||||
addListener(this@ForgeInit::initSetup)
|
||||
register(EndTickHandler)
|
||||
register(MiscHandlers)
|
||||
register(HudHandler)
|
||||
register(ZoomHandler)
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue