aboutsummaryrefslogtreecommitdiff
path: root/src/compat/yacl
diff options
context:
space:
mode:
Diffstat (limited to 'src/compat/yacl')
-rw-r--r--src/compat/yacl/java/KeybindingController.kt16
-rw-r--r--src/compat/yacl/java/YaclIntegration.kt18
2 files changed, 17 insertions, 17 deletions
diff --git a/src/compat/yacl/java/KeybindingController.kt b/src/compat/yacl/java/KeybindingController.kt
index 6ceef5d..3714455 100644
--- a/src/compat/yacl/java/KeybindingController.kt
+++ b/src/compat/yacl/java/KeybindingController.kt
@@ -6,9 +6,9 @@ import dev.isxander.yacl3.api.utils.Dimension
import dev.isxander.yacl3.gui.AbstractWidget
import dev.isxander.yacl3.gui.YACLScreen
import dev.isxander.yacl3.gui.controllers.ControllerWidget
-import net.minecraft.client.gui.Click
-import net.minecraft.client.input.KeyInput
-import net.minecraft.text.Text
+import net.minecraft.client.input.MouseButtonEvent
+import net.minecraft.client.input.KeyEvent
+import net.minecraft.network.chat.Component
import moe.nea.firmament.gui.config.KeyBindingHandler
import moe.nea.firmament.gui.config.KeyBindingStateManager
import moe.nea.firmament.gui.config.ManagedOption
@@ -24,7 +24,7 @@ class KeybindingController(
return option
}
- override fun formatValue(): Text {
+ override fun formatValue(): Component {
return option.pendingValue().format()
}
@@ -55,15 +55,15 @@ class KeybindingWidget(
return 130
}
- override fun getValueText(): Text {
+ override fun getValueText(): Component {
return sm.label
}
- override fun keyPressed(keyEvent: KeyInput): Boolean {
+ override fun keyPressed(keyEvent: KeyEvent): Boolean {
return sm.keyboardEvent(GenericInputButton.of(keyEvent), true)
}
- override fun keyReleased(keyEvent: KeyInput): Boolean {
+ override fun keyReleased(keyEvent: KeyEvent): Boolean {
return sm.keyboardEvent(GenericInputButton.of(keyEvent), false)
}
@@ -76,7 +76,7 @@ class KeybindingWidget(
if (!focused) sm.onLostFocus()
}
- override fun mouseClicked(mouseButtonEvent: Click, doubleClick: Boolean): Boolean {
+ override fun mouseClicked(mouseButtonEvent: MouseButtonEvent, doubleClick: Boolean): Boolean {
if (isHovered) {
sm.onClick(mouseButtonEvent.button())
return true
diff --git a/src/compat/yacl/java/YaclIntegration.kt b/src/compat/yacl/java/YaclIntegration.kt
index d94e96f..e10b8c4 100644
--- a/src/compat/yacl/java/YaclIntegration.kt
+++ b/src/compat/yacl/java/YaclIntegration.kt
@@ -23,10 +23,10 @@ import java.awt.Color
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds
import kotlin.time.DurationUnit
-import net.minecraft.client.gui.Element
-import net.minecraft.client.gui.screen.Screen
-import net.minecraft.client.gui.widget.ContainerWidget
-import net.minecraft.text.Text
+import net.minecraft.client.gui.components.events.GuiEventListener
+import net.minecraft.client.gui.screens.Screen
+import net.minecraft.client.gui.components.AbstractContainerWidget
+import net.minecraft.network.chat.Component
import moe.nea.firmament.gui.config.BooleanHandler
import moe.nea.firmament.gui.config.ChoiceHandler
import moe.nea.firmament.gui.config.ClickHandler
@@ -158,7 +158,7 @@ class YaclIntegration : FirmamentConfigScreenProvider {
.binding((binding as Binding<Duration>).xmap({ it.toDouble(DurationUnit.SECONDS) }, { it.seconds }))
.controller {
DoubleSliderControllerBuilder.create(it)
- .formatValue { Text.literal(FirmFormatters.formatTimespan(it.seconds)) }
+ .formatValue { Component.literal(FirmFormatters.formatTimespan(it.seconds)) }
.step(0.1)
.range(handler.min.toDouble(DurationUnit.SECONDS), handler.max.toDouble(DurationUnit.SECONDS))
}
@@ -168,7 +168,7 @@ class YaclIntegration : FirmamentConfigScreenProvider {
KeybindingBuilder(it, managedOption as ManagedOption<SavedKeyBinding>)
}.single()
- else -> return listOf(LabelOption.create(Text.literal("This option is currently unhandled for this config menu. Please report this as a bug.")))
+ else -> return listOf(LabelOption.create(Component.literal("This option is currently unhandled for this config menu. Please report this as a bug.")))
}
}
@@ -196,7 +196,7 @@ class YaclIntegration : FirmamentConfigScreenProvider {
fun buildConfig(): YetAnotherConfigLib {
return YetAnotherConfigLib.createBuilder()
- .title(Text.literal("Firmament"))
+ .title(Component.literal("Firmament"))
.categories(buildCategories())
.build()
}
@@ -206,9 +206,9 @@ class YaclIntegration : FirmamentConfigScreenProvider {
override fun open(search: String?, parent: Screen?): Screen {
return object : YACLScreen(buildConfig(), parent) {
- override fun setFocused(focused: Element?) {
+ override fun setFocused(focused: GuiEventListener?) {
if (this.focused is KeybindingWidget &&
- focused is ContainerWidget
+ focused is AbstractContainerWidget
) {
return
}