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
|
import kotlin.reflect.full.findAnnotation
|
||||||
|
|
||||||
sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
|
sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
|
||||||
internal companion object {
|
companion object {
|
||||||
private fun addButtons(vararg buttons: ButtonImpl) {
|
private fun addButtons(vararg buttons: ButtonImpl) {
|
||||||
buttons.groupBy { impl ->
|
buttons.groupBy { impl ->
|
||||||
ClickGui.clickBoxes.find { box ->
|
ClickGui.clickBoxes.find { box ->
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
"client": [
|
"client": [
|
||||||
"KeysAccessor",
|
"KeysAccessor",
|
||||||
"KeyMappings",
|
"KeyMappings",
|
||||||
"TitleScreenMixin",
|
|
||||||
"OptionValueAccessor"
|
"OptionValueAccessor"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"compatibilityLevel": "JAVA_18",
|
"compatibilityLevel": "JAVA_18",
|
||||||
"client": [
|
"client": [
|
||||||
"EndTickMixin",
|
"EndTickMixin",
|
||||||
|
"TitleScreenMixin",
|
||||||
"ZoomMixin",
|
"ZoomMixin",
|
||||||
"OkZoomerAlternativeMixin"
|
"OkZoomerAlternativeMixin"
|
||||||
],
|
],
|
||||||
|
|
|
@ -30,6 +30,7 @@ class ForgeInit(container: ModContainer): Snowy() {
|
||||||
container.eventBus!!.run {
|
container.eventBus!!.run {
|
||||||
addListener(this@ForgeInit::initSetup)
|
addListener(this@ForgeInit::initSetup)
|
||||||
register(EndTickHandler)
|
register(EndTickHandler)
|
||||||
|
register(MiscHandlers)
|
||||||
register(HudHandler)
|
register(HudHandler)
|
||||||
register(ZoomHandler)
|
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