public List<Entity> getNearestEntities(final Entity ent, double radius) {	
		List<Entity> nearestEntities = new ArrayList<Entity>();
		List<Entity> entList = core.getEntityList();
		for(Entity entN : entList) {
			if(!entN.equals(ent) && entN.getLocation().distanceTo(ent.getLocation())<radius) {
				nearestEntities.add(entN);
			}
			else if(!entN.equals(ent) && radius==-1) nearestEntities.add(entN);
		}
		
	    Collections.sort(nearestEntities, new Comparator<Entity>() {

	        public int compare(Entity o1, Entity o2) {
	            if(((o1.getLocation().distanceTo(ent.getLocation()) - o1.getSize()) - (o2.getLocation().distanceTo(ent.getLocation()) - o2.getSize()))>0) return 1;
	            return -1;
	        }
	    });
	    
//	    for(Entity ent2 : nearestEntities) {
//	    	System.out.println(ent2.getLocation().distanceTo(ent.getLocation()));
//	    }
	    
	    return nearestEntities;
		
	}