Merge pull request #4188 from OutCraft-Mods/patch-1

Update StationScreen to use InputConstants
This commit is contained in:
simibubi 2023-01-14 13:37:40 +01:00 committed by GitHub
commit a54c81861b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);