Guest User

Untitled

a guest
May 3rd, 2015
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. package net.nukacraft.src;
  2.  
  3. import cpw.mods.fml.common.eventhandler.SubscribeEvent;
  4. import cpw.mods.fml.common.gameevent.TickEvent;
  5. import cpw.mods.fml.relauncher.Side;
  6.  
  7. public class EventActionPrimaryKey2 {
  8.  
  9. boolean k_Button_left, k_Button_left_last = false;
  10.  
  11. @SubscribeEvent
  12. public void actionButton_left(TickEvent.PlayerTickEvent event) {
  13. if (event.phase == TickEvent.Phase.START && event.side == Side.CLIENT) {
  14. if (RegKey2.button_left.getIsKeyPressed()) {
  15. k_Button_left = true;
  16. if (!k_Button_left_last && k_Button_left) ActionPrimaryKey2.actionButton_leftClient(event.player, true);//press down
  17. k_Button_left_last = k_Button_left;
  18. } else {
  19. k_Button_left = false;
  20. if (k_Button_left_last && !k_Button_left) ActionPrimaryKey2.actionButton_leftClient(event.player, false);//unpress down
  21. k_Button_left_last = k_Button_left;
  22. }
  23. }
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment