Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. private float rotationTicks = 0;
  2.  
  3. @SubscribeEvent
  4. public void onKeyInput(InputEvent.KeyInputEvent event) {
  5. EntityPlayer player = mc.thePlayer;
  6.  
  7. if(KeyHandler.RIVEN_Z.isPressed()) {
  8. if(zPressed) return;
  9. else {
  10. zPressed = true; player.moveEntity(-Z_MOVE_DISTANCE*Math.sin(Math.toRadians(player.rotationYawHead))*Math.cos(Math.toRadians(player.rotationPitch)),-Z_MOVE_DISTANCE*Math.sin(Math.toRadians(player.rotationPitch)), Z_MOVE_DISTANCE*Math.cos(Math.toRadians(player.rotationYawHead))*Math.cos(Math.toRadians(player.rotationPitch)));
  11. float x = player.rotationYaw;
  12. }
  13. }
  14. }
  15.  
  16. @SubscribeEvent(priority = EventPriority.HIGHEST)
  17. public void clientTickEvent(ClientTickEvent event) {
  18. if(zPressed) {
  19. System.out.println(zPressed);
  20. float yaw = mc.thePlayer.rotationYaw;
  21. rotationTicks += 1F;
  22.  
  23. mc.thePlayer.rotationYaw += rotationTicks;
  24. if(mc.thePlayer.rotationYaw < yaw) {
  25. rotationTicks += 1F;
  26. mc.thePlayer.rotationYaw += rotationTicks;
  27. } else if(mc.thePlayer.rotationYaw == yaw) {
  28. zPressed = false;
  29. rotationTicks = 0;
  30. System.out.println(zPressed);
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement