Jump to content

SwiftNinjaPro

Members
  • Posts

    2
  • Joined

  • Last visited

SwiftNinjaPro's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. If I go to files.minecraftforge.net the http request does not redirect to https. This can effect security. The non ssl request does not redirect to ssl. Just letting you know that http:// does not redirect to https:// on files.minecraftforge.net Just figured you should know. Thanks.
  2. I think I figured It Out. (note: in my mod, I added my own methods to detect inputs, so the code may need to be modified) This method only runs the key detection function once, than waits for the key to be released before allowing it to run again. This means it should not return a double press if the user holds the key down. It also will not trigger, if the key is double tapped too slow (so the user pressing the key once, than pressing it again 10 minutes later, will Not trigger a double tap). long startTime = System.currentTimeMillis(); boolean moveKeyPressed = false; boolean keyEnabled = false; @SubscribeEvent public void onMove(InputUpdateEvent event){ boolean keyPressed = event.getMovementInput().backKeyDown; if(!keyEnabled){ if(!moveKeyPressed && keyPressed){ long now = System.currentTimeMillis(); if(now > startTime + 300){ startTime = now; }else{ keyEnabled = true; // do stuff on double tap... } moveKeyPressed = true; }else{ // optional if(!moveKeyPressed && keyPressed && System.currentTimeMillis() > startTime + 300){ keyEnabled = false; // do stuff to cancel double tap action if key is pressed again... // useful if you need to allow the player to override the keypress and cancel the double tap action } } // detect key release if(!keyPressed){ moveKeyPressed = false; } } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.