public <T extends IComponent> T getComponentAsType(Class<T> clazz, Entity entity, boolean required) {
		HashMap<Entity, IComponent> entityComponentMap = registeredComponents.get(clazz);
		// If this component existed, return their registered component
		if (entityComponentMap != null) {
			return clazz.cast(entityComponentMap.get(entity));
		}

		// Output logging that it failed if it was a required component type
		if (required) {
			logger.info("no component of type ", clazz, " found for entity ", entity);
		}
		return null;
	}