improved waterfall check

This commit is contained in:
YouHaveTrouble
2020-11-02 01:18:13 +01:00
parent 992c6fbf07
commit 65f111759a
@@ -29,11 +29,13 @@ public final class CommandWhitelistBungee extends Plugin {
getLogger().info("Running on "+ ChatColor.DARK_AQUA+getProxy().getName()); getLogger().info("Running on "+ ChatColor.DARK_AQUA+getProxy().getName());
loadConfig(); loadConfig();
this.getProxy().getPluginManager().registerListener(this, new BungeeChatEventListener()); this.getProxy().getPluginManager().registerListener(this, new BungeeChatEventListener());
if (this.getProxy().getName().contains("Waterfall") || getProxy().getName().contains("FlameCord")) { try {
Class.forName("io.github.waterfallmc.waterfall.conf.WaterfallConfiguration");
this.getProxy().getPluginManager().registerListener(this, new BungeeTabCompleteListener()); this.getProxy().getPluginManager().registerListener(this, new BungeeTabCompleteListener());
} else { } catch (ClassNotFoundException e) {
getLogger().info("Bungee tab completion requires Waterfall, FlameCord or other Waterfall fork."); getLogger().severe(ChatColor.DARK_RED+"Bungee tab completion blocker requires Waterfall other Waterfall fork.");
} }
getProxy().getPluginManager().registerCommand(this, new BungeeMainCommand()); getProxy().getPluginManager().registerCommand(this, new BungeeMainCommand());
int pluginId = 8704; int pluginId = 8704;
@@ -77,7 +79,6 @@ public final class CommandWhitelistBungee extends Plugin {
getProxy().getScheduler().runAsync(this, () -> { getProxy().getScheduler().runAsync(this, () -> {
loadConfig(); loadConfig();
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', CommandWhitelistBungee.getConfigCache().getPrefix() + CommandWhitelistBungee.getConfigCache().getConfigReloaded())); sender.sendMessage(ChatColor.translateAlternateColorCodes('&', CommandWhitelistBungee.getConfigCache().getPrefix() + CommandWhitelistBungee.getConfigCache().getConfigReloaded()));
}); });
} }