Guest User

Untitled

a guest
Sep 29th, 2015
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. public class AimingEvent
  2. {
  3. private boolean zoomed;
  4. private boolean haszoomed;
  5.  
  6. public AimingEvent()
  7. {
  8. this.zoomed = false;
  9. this.haszoomed = false;
  10. }
  11.  
  12. @SideOnly(Side.CLIENT)
  13. @SubscribeEvent
  14. public void rightClickTicks(TickEvent.ClientTickEvent event)
  15. {
  16. if (Minecraft.getMinecraft().currentScreen == null) {
  17. if ((GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindUseItem)) && (!this.zoomed))
  18. {
  19. this.zoomed = true;
  20. MainRegistry.INSTANCE.sendToServer(new HoldingGun());
  21. }
  22. else if ((this.zoomed == true) && (!GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindUseItem)))
  23. {
  24. this.zoomed = false;
  25. MainRegistry.INSTANCE.sendToServer(new NotHoldingGun());
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment