public void setEntity(AbstractEntity entity) {
		if (entity == null) {
			entity = EntityManager.getEntityManager().getEntity("Air");
		}
		
		if (entity.isSolid() && getAgents().size() > 0) {
			throw new IllegalArgumentException("Putting solid over agent");
		}
		
		AbstractEntity oldentity = this.entity;
		this.entity = entity;
		
		//if visible and we have been taken from solid to non-solid
		if (isVisible() && oldentity.isSolid() && !entity.isSolid()) {
			setVisible();
		}
	}