diff options
author | isXander <xandersmith2008@gmail.com> | 2023-01-19 21:15:26 +0000 |
---|---|---|
committer | isXander <xandersmith2008@gmail.com> | 2023-01-19 21:15:26 +0000 |
commit | ee53b51a1e8d88085c75f227f4710b68c03b19c8 (patch) | |
tree | 77a942242a982757da040a6120950bad30e49f77 /src/client/java/dev/isxander/yacl/gui/controllers/ActionController.java | |
parent | ffdd6e5ceacd71c76c55a8716702d4d6da17c7ab (diff) | |
download | YetAnotherConfigLib-ee53b51a1e8d88085c75f227f4710b68c03b19c8.tar.gz YetAnotherConfigLib-ee53b51a1e8d88085c75f227f4710b68c03b19c8.tar.bz2 YetAnotherConfigLib-ee53b51a1e8d88085c75f227f4710b68c03b19c8.zip |
mojmap
Diffstat (limited to 'src/client/java/dev/isxander/yacl/gui/controllers/ActionController.java')
-rw-r--r-- | src/client/java/dev/isxander/yacl/gui/controllers/ActionController.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/ActionController.java b/src/client/java/dev/isxander/yacl/gui/controllers/ActionController.java index 7666dff..e57cdd2 100644 --- a/src/client/java/dev/isxander/yacl/gui/controllers/ActionController.java +++ b/src/client/java/dev/isxander/yacl/gui/controllers/ActionController.java @@ -1,12 +1,12 @@ package dev.isxander.yacl.gui.controllers; +import com.mojang.blaze3d.platform.InputConstants; import dev.isxander.yacl.api.ButtonOption; import dev.isxander.yacl.api.Controller; import dev.isxander.yacl.api.utils.Dimension; import dev.isxander.yacl.gui.AbstractWidget; import dev.isxander.yacl.gui.YACLScreen; -import net.minecraft.client.util.InputUtil; -import net.minecraft.text.Text; +import net.minecraft.network.chat.Component; import java.util.function.BiConsumer; @@ -15,10 +15,10 @@ import java.util.function.BiConsumer; * and renders a {@link} Text on the right. */ public class ActionController implements Controller<BiConsumer<YACLScreen, ButtonOption>> { - public static final Text DEFAULT_TEXT = Text.translatable("yacl.control.action.execute"); + public static final Component DEFAULT_TEXT = Component.translatable("yacl.control.action.execute"); private final ButtonOption option; - private final Text text; + private final Component text; /** * Constructs an action controller @@ -36,7 +36,7 @@ public class ActionController implements Controller<BiConsumer<YACLScreen, Butto * @param option bound option * @param text text to display */ - public ActionController(ButtonOption option, Text text) { + public ActionController(ButtonOption option, Component text) { this.option = option; this.text = text; @@ -54,7 +54,7 @@ public class ActionController implements Controller<BiConsumer<YACLScreen, Butto * {@inheritDoc} */ @Override - public Text formatValue() { + public Component formatValue() { return text; } @@ -94,7 +94,7 @@ public class ActionController implements Controller<BiConsumer<YACLScreen, Butto return false; } - if (keyCode == InputUtil.GLFW_KEY_ENTER || keyCode == InputUtil.GLFW_KEY_SPACE || keyCode == InputUtil.GLFW_KEY_KP_ENTER) { + if (keyCode == InputConstants.KEY_RETURN || keyCode == InputConstants.KEY_SPACE || keyCode == InputConstants.KEY_NUMPADENTER) { executeAction(); return true; } |