Use Mojang's code to check if a key is pressed. Fixes #1

This commit is contained in:
Sollace 2019-02-08 11:50:18 +02:00
parent c8846b735f
commit a4444814eb

View file

@ -2,13 +2,12 @@ package com.minelittlepony.unicopia.input;
import java.util.ArrayList;
import org.lwjgl.input.Keyboard;
import com.minelittlepony.unicopia.player.IPlayer;
import com.minelittlepony.unicopia.player.PlayerSpeciesList;
import com.minelittlepony.unicopia.power.PowersRegistry;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.fml.client.registry.ClientRegistry;
@ -36,7 +35,7 @@ class UKeyHandler implements IKeyHandler {
IPlayer iplayer = PlayerSpeciesList.instance().getPlayer(Minecraft.getMinecraft().player);
for (KeyBinding i : bindings) {
if (Keyboard.isKeyDown(i.getKeyCode())) {
if (GameSettings.isKeyDown(i)) {
if (!pressed.contains(i)) {
pressed.add(i);