/*
 * 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.commands;

import net.minecraft.entity.EntityLivingBase;
import tk.wurst_client.utils.EntityUtils;

@Cmd.Info(description = "Toggles Follow or makes it target a specific entity.",
	name = "follow",
	syntax = {"[<entity>]"},
	help = "Commands/follow")
public class FollowCmd extends Cmd
{
	@Override
	public void execute(String[] args) throws Error
	{
		if(args.length > 1)
			syntaxError();
		if(args.length == 0)
			wurst.mods.followMod.toggle();
		else
		{
			if(wurst.mods.followMod.isEnabled())
				wurst.mods.followMod.setEnabled(false);
			EntityLivingBase entity = EntityUtils.searchEntityByName(args[0]);
			if(entity == null)
				error("Entity \"" + args[0] + "\" could not be found.");
			wurst.mods.followMod.setEnabled(true);
			wurst.mods.followMod.setEntity(entity);
		}
	}
}

@@ -345,20 +345,10 @@
 tity
-LivingBase
 ;%0A
+
 impo
@@ -384,16 +384,73 @@
 tyUtils;
+%0Aimport tk.wurst_client.utils.EntityUtils.TargetSettings;
 %0A%0A@Cmd.I
@@ -631,16 +631,156 @@
 s Cmd%0A%7B%0A
+%09private TargetSettings targetSettings = new TargetSettings()%0A%09%7B%0A%09%09@Override%0A%09%09public boolean targetFriends()%0A%09%09%7B%0A%09%09%09return true;%0A%09%09%7D%0A%09%7D;%0A%09%0A
 %09@Overri
@@ -1039,18 +1039,8 @@
 tity
-LivingBase
  ent
@@ -1044,17 +1044,21 @@
 entity =
- 
+%0A%09%09%09%09
 EntityUt
@@ -1065,22 +1065,21 @@
 ils.
-search
+get
 Entity
-By
+With
 Name
@@ -1086,16 +1086,32 @@
 (args%5B0%5D
+, targetSettings
 );%0A%09%09%09if

Update FollowCmd