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

import java.util.TreeSet;

import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.wurstclient.WurstClient;
import net.wurstclient.files.ConfigFiles;

public class FriendsList extends TreeSet<String>
{
	public void middleClick(Entity entityHit)
	{
		if(entityHit != null && entityHit instanceof EntityPlayer)
		{
			WurstClient wurst = WurstClient.INSTANCE;
			if(wurst.options.middleClickFriends)
			{
				FriendsList friends = wurst.friends;
				String entityName = entityHit.getName();
				if(friends.contains(entityName))
					friends.remove(entityName);
				else
					friends.add(entityName);
				ConfigFiles.FRIENDS.save();
			}
		}
	}
}

@@ -612,19 +612,21 @@
 Hit 
-!
+=
 = null 
-&& 
+%7C%7C !(
 enti
@@ -659,36 +659,30 @@
 yer)
-%0A%09%09%7B%0A%09%09%09WurstClient wurst = 
+)%0A%09%09%09return;%0A%09%09%0A%09%09if(!
 Wurs
@@ -701,21 +701,8 @@
 ANCE
-;%0A%09%09%09if(wurst
 .opt
@@ -733,53 +733,19 @@
 %0A%09%09%09
-%7B%0A%09%09%09%09FriendsList friends = wurst.friends
+return
 ;%0A%09%09
+%0A
 %09%09St
@@ -749,23 +749,17 @@
 %09String 
-entityN
+n
 ame = en
@@ -779,21 +779,43 @@
 me();%0A%09%09
+%0A
 %09%09if(
+WurstClient.INSTANCE.
 friends.
@@ -823,23 +823,17 @@
 ontains(
-entityN
+n
 ame))%0A%09%09
@@ -829,26 +829,45 @@
 s(name))%0A%09%09%09
-%09%09
+WurstClient.INSTANCE.
 friends.remo
@@ -869,31 +869,23 @@
 .remove(
-entityN
+n
 ame);%0A
-%09%09
 %09%09else%0A%09
@@ -886,18 +886,37 @@
 else%0A%09%09%09
-%09%09
+WurstClient.INSTANCE.
 friends.
@@ -923,23 +923,17 @@
 add(
-entityN
+n
 ame);%0A%09%09
 %09%09Co
@@ -928,16 +928,17 @@
 ame);%0A%09%09
+%0A
 %09%09Config
@@ -963,17 +963,8 @@
 ();%0A
-%09%09%09%7D%0A%09%09%7D%0A
 %09%7D%0A%7D

Update FriendsList