/*
 * Copyright  2014 - 2016 | 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 tk.wurst_client.mods;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.network.play.client.CPacketPlayer;
import tk.wurst_client.events.listeners.UpdateListener;
import tk.wurst_client.mods.Mod.Bypasses;
import tk.wurst_client.utils.EntityUtils;

@Mod.Info(
	description = "Pushes mobs like crazy.\n" + "They'll literally fly away!\n"
		+ "Can sometimes get you kicked for \"Flying is not enabled\".",
	name = "ForcePush",
	tags = "force push",
	help = "Mods/ForcePush")
@Bypasses
public class ForcePushMod extends Mod implements UpdateListener
{
	@Override
	public void onEnable()
	{
		wurst.events.add(UpdateListener.class, this);
	}
	
	@Override
	public void onUpdate()
	{
		EntityLivingBase en = EntityUtils.getClosestEntity(true, 360, false);
		if(mc.thePlayer.onGround && en != null
			&& en.getDistanceToEntity(mc.thePlayer) < 1)
			for(int i = 0; i < 1000; i++)
				mc.thePlayer.connection.sendPacket(new CPacketPlayer(true));
	}
	
	@Override
	public void onDisable()
	{
		wurst.events.remove(UpdateListener.class, this);
	}
}

@@ -307,54 +307,8 @@
 s;%0A%0A
-import net.minecraft.entity.EntityLivingBase;%0A
 impo
@@ -442,24 +442,24 @@
 ent.
-mods.Mod.Bypasse
+utils.EntityUtil
 s;%0Ai
@@ -497,16 +497,31 @@
 ityUtils
+.TargetSettings
 ;%0A%0A@Mod.
@@ -740,16 +740,20 @@
 Push%22)%0A@
+Mod.
 Bypasses
@@ -824,295 +824,429 @@
 %0A%7B%0A%09
-@Override%0A%09public void onEnable()%0A%09%7B%0A%09%09wurst.events.add(UpdateListener.class, this);%0A%09%7D%0A%09%0A%09@Override%0A%09public void onUpdate()%0A%09%7B%0A%09%09EntityLivingBase en = EntityUtils.getClosestEntity(true, 360, false);%0A%09%09if(mc.thePlayer.onGround && en != null%0A%09%09%09&& en.getDistanceToEntity(mc.thePlayer) %3C 1
+private TargetSettings targetSettings = new TargetSettings()%0A%09%7B%0A%09%09@Override%0A%09%09public boolean targetBehindWalls()%0A%09%09%7B%0A%09%09%09return true;%0A%09%09%7D;%0A%09%09%0A%09%09@Override%0A%09%09public float getRange()%0A%09%09%7B%0A%09%09%09return 1F;%0A%09%09%7D%0A%09%7D;%0A%09%0A%09@Override%0A%09public void onEnable()%0A%09%7B%0A%09%09wurst.events.add(UpdateListener.class, this);%0A%09%7D%0A%09%0A%09@Override%0A%09public void onUpdate()%0A%09%7B%0A%09%09if(mc.thePlayer.onGround%0A%09%09%09&& EntityUtils.getClosestEntity(targetSettings) != null
 )%0A%09%09

Update ForcePushMod