Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private float rotationTicks = 0;
- @SubscribeEvent
- public void onKeyInput(InputEvent.KeyInputEvent event) {
- EntityPlayer player = mc.thePlayer;
- if(KeyHandler.RIVEN_Z.isPressed()) {
- if(zPressed) return;
- else {
- 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)));
- float x = player.rotationYaw;
- }
- }
- }
- @SubscribeEvent(priority = EventPriority.HIGHEST)
- public void clientTickEvent(ClientTickEvent event) {
- if(zPressed) {
- System.out.println(zPressed);
- float yaw = mc.thePlayer.rotationYaw;
- rotationTicks += 1F;
- mc.thePlayer.rotationYaw += rotationTicks;
- if(mc.thePlayer.rotationYaw < yaw) {
- rotationTicks += 1F;
- mc.thePlayer.rotationYaw += rotationTicks;
- } else if(mc.thePlayer.rotationYaw == yaw) {
- zPressed = false;
- rotationTicks = 0;
- System.out.println(zPressed);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement