/*
 * Copyright  2014 - 2017 | Wurst-Imperium | All rights reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package net.wurstclient.features.mods.fun;

import net.minecraft.network.play.client.CPacketPlayer;
import net.wurstclient.compatibility.WConnection;
import net.wurstclient.compatibility.WMinecraft;
import net.wurstclient.events.listeners.UpdateListener;
import net.wurstclient.features.HelpPage;
import net.wurstclient.features.Mod;
import net.wurstclient.features.SearchTags;

@SearchTags({"head roll"})
@HelpPage("Mods/HeadRoll")
@Mod.Bypasses(ghostMode = false, latestNCP = false, olderNCP = false)
public final class HeadRollMod extends Mod implements UpdateListener
{
	public HeadRollMod()
	{
		super("HeadRoll",
			"While this is active, other people will think you are\n"
				+ "rolling your head around!\n" + "Looks a bit like nodding.");
	}
	
	@Override
	public void onEnable()
	{
		wurst.events.add(UpdateListener.class, this);
	}
	
	@Override
	public void onDisable()
	{
		wurst.events.remove(UpdateListener.class, this);
	}
	
	@Override
	public void onUpdate()
	{
		WConnection.sendPacket(
			new CPacketPlayer.Rotation(WMinecraft.getPlayer().rotationYaw,
				(float)Math.sin(
					WMinecraft.getPlayer().ticksExisted % 20 / 10d * Math.PI)
					* 90,
				WMinecraft.getPlayer().onGround));
	}
}

@@ -421,16 +421,60 @@
 ection;%0A
+import net.wurstclient.compatibility.WMath;%0A
 import n
@@ -574,50 +574,8 @@
 er;%0A
-import net.wurstclient.features.HelpPage;%0A
 impo
@@ -683,35 +683,8 @@
 %22%7D)%0A
-@HelpPage(%22Mods/HeadRoll%22)%0A
 @Mod
@@ -868,133 +868,36 @@
 ll%22,
-%0A%09%09%09%22While this is active, other people will think you are%5Cn%22%0A%09%09%09%09+ %22rolling your head around!%5Cn%22 + %22Looks a bit like nodding
+ %22Makes you nod all the time
 .%22);
@@ -1132,197 +1132,233 @@
 %7B%0A%09%09
-WConnection.sendPacket(%0A%09%09%09new CPacketPlayer.Rotation(WMinecraft.getPlayer().rotationYaw,%0A%09%09%09%09(float)Math.sin(%0A%09%09%09%09%09WMinecraft.getPlayer().ticksExisted %25 20 / 10d * Math.PI)%0A%09%09%09%09%09* 90,%0A%09%09%09%09
+float timer = WMinecraft.getPlayer().ticksExisted %25 20 / 10F;%0A%09%09float pitch = WMath.sin(timer * (float)Math.PI) * 90F;%0A%09%09%0A%09%09WConnection.sendPacket(%0A%09%09%09new CPacketPlayer.Rotation(WMinecraft.getPlayer().rotationYaw,%0A%09%09%09%09pitch, 
 WMin

Update HeadRollMod