]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blobdiff - src/main/java/com/irtimaled/bbor/client/keyboard/Key.java
Downgrade to 1.12.2
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / client / keyboard / Key.java
index 06179e1f012ce3641201a828e07098d197d55e8f..d7d64540dc0dffd4b13df95a4565f1c168da9729 100644 (file)
@@ -1,10 +1,8 @@
 package com.irtimaled.bbor.client.keyboard;
 
 import net.minecraft.client.settings.KeyBinding;
-import net.minecraft.client.util.InputMappings;
 
 public class Key extends KeyBinding {
-    private InputMappings.Input input;
     private KeyHandler onKeyPress;
     private KeyHandler onLongKeyPress;
     private int longPressDuration;
@@ -24,23 +22,11 @@ public class Key extends KeyBinding {
         return this;
     }
 
-    InputMappings.Input getInput() {
-        if (input == null)
-            return getDefault();
-        return input;
-    }
-
-    @Override
-    public void bind(InputMappings.Input input) {
-        this.input = input;
-        super.bind(input);
-    }
-
     private int pressDuration = 0;
 
     @Override
     public boolean isPressed() {
-        return pressDuration == 1;
+        return pressDuration >= 1;
     }
 
     void release() {
@@ -60,6 +46,7 @@ public class Key extends KeyBinding {
 
         if (pressDuration == longPressDuration) {
             onLongKeyPress.handle();
+            pressDuration = 0;
         }
     }