Void "Hook" in plugin name

This commit is contained in:
InkerBot
2021-04-06 22:07:26 +08:00
parent f766e6213e
commit fb98dd8393
2 changed files with 4 additions and 3 deletions

View File

@ -94,13 +94,13 @@ public class DelayedAuthHook implements Runnable {
private AuthPlugin<Player> getAuthHook() {
try {
@SuppressWarnings("unchecked")
List<Class<? extends AuthPlugin<Player>>> hooks = Arrays.asList(AuthMeHook.class,
CrazyLoginHook.class, LogItHook.class, LoginSecurityHook.class,
SodionAuthHook.class, UltraAuthHook.class, xAuthHook.class);
for (Class<? extends AuthPlugin<Player>> clazz : hooks) {
String pluginName = clazz.getSimpleName().replace("Hook", "");
String pluginName = clazz.getSimpleName();
pluginName = pluginName.substring(0, pluginName.length() - 4);
//uses only member classes which uses AuthPlugin interface (skip interfaces)
if (Bukkit.getPluginManager().isPluginEnabled(pluginName)) {
//check only for enabled plugins. A single plugin could be disabled by plugin managers

View File

@ -121,7 +121,8 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
BungeeAuthHook.class, BungeeCordAuthenticatorBungeeHook.class, SodionAuthHook.class);
for (Class<? extends AuthPlugin<ProxiedPlayer>> clazz : hooks) {
String pluginName = clazz.getSimpleName().replace("Hook", "");
String pluginName = clazz.getSimpleName();
pluginName = pluginName.substring(0, pluginName.length() - 4);
//uses only member classes which uses AuthPlugin interface (skip interfaces)
Plugin plugin = getProxy().getPluginManager().getPlugin(pluginName);
if (plugin != null) {