/** * Retrieve the injection method that has been set in the configuration, or use a default value. * * @return Injection method to use. * @throws IllegalArgumentException If the configuration option is malformed. */ public PlayerInjectHooks getInjectionMethod() throws IllegalArgumentException { String text = global.getString(INJECTION_METHOD); // Default hook if nothing has been set PlayerInjectHooks hook = getDefaultMethod(); if (text != null) hook = PlayerInjectHooks.valueOf(text.toUpperCase(Locale.ENGLISH).replace(" ", "_")); return hook; }