/*
 * 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({"Retarded"})
@HelpPage("Mods/Derp")
@Mod.Bypasses(ghostMode = false, latestNCP = false, olderNCP = false)
public final class DerpMod extends Mod implements UpdateListener
{
	public DerpMod()
	{
		super("Derp", "While this is active, other people will think you are\n"
			+ "derping around.");
	}
	
	@Override
	public void onEnable()
	{
		wurst.events.add(UpdateListener.class, this);
	}
	
	@Override
	public void onDisable()
	{
		wurst.events.remove(UpdateListener.class, this);
	}
	
	@Override
	public void onUpdate()
	{
		float yaw = WMinecraft.getPlayer().rotationYaw
			+ (float)(Math.random() * 360 - 180);
		float pitch = (float)(Math.random() * 180 - 90);
		WConnection.sendPacket(new CPacketPlayer.Rotation(yaw, pitch,
			WMinecraft.getPlayer().onGround));
	}
}

@@ -315,16 +315,42 @@
 s.fun;%0A%0A
+import java.util.Random;%0A%0A
 import n
@@ -556,50 +556,8 @@
 er;%0A
-import net.wurstclient.features.HelpPage;%0A
 impo
@@ -664,31 +664,8 @@
 %22%7D)%0A
-@HelpPage(%22Mods/Derp%22)%0A
 @Mod
@@ -803,114 +803,115 @@
 %7B%0A%09p
-ublic DerpMod()%0A%09%7B%0A%09%09super(%22Derp%22, %22While this is active, other people will think you are%5Cn%22%0A%09%09%09+ %22derping
+rivate final Random random = new Random();%0A%09%0A%09public DerpMod()%0A%09%7B%0A%09%09super(%22Derp%22, %22Randomly moves your head
  aro
@@ -1205,35 +1205,32 @@
 %09%09+ 
-(float)(Math.random
+random.nextFloat
 () * 360
  - 1
@@ -1229,15 +1229,16 @@
  360
+F
  - 180
-)
+F
 ;%0A%09%09
@@ -1255,35 +1255,32 @@
 h = 
-(float)(Math.random
+random.nextFloat
 () * 180
  - 9
@@ -1279,15 +1279,19 @@
  180
+F
  - 90
-);
+F;%0A%09%09
 %0A%09%09W

Update DerpMod