From 66b495906bf7c64b98fade447d23258a07f5b31d Mon Sep 17 00:00:00 2001 From: OutCraft Date: Tue, 20 Dec 2022 20:27:57 +0100 Subject: [PATCH] Update StationScreen to use InputConstants Updates the StationScreen class to use the Mojang InputConstants instead of numbers for the ENTER keypress detection --- .../trains/management/edgePoint/station/StationScreen.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationScreen.java b/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationScreen.java index d646c1d24..0a8ff8a66 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationScreen.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.function.Consumer; import com.jozufozu.flywheel.core.PartialModel; +import com.mojang.blaze3d.platform.InputConstants; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; import com.simibubi.create.AllBlockPartials; @@ -310,7 +311,8 @@ public class StationScreen extends AbstractStationScreen { @Override public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) { - boolean hitEnter = getFocused() instanceof EditBox && (pKeyCode == 257 || pKeyCode == 335); + boolean hitEnter = getFocused() instanceof EditBox + && (pKeyCode == InputConstants.KEY_RETURN || pKeyCode == InputConstants.KEY_NUMPADENTER); if (hitEnter && nameBox.isFocused()) { nameBox.setFocus(false);