Move proxy check to funconstants

This commit is contained in:
Draycia committed 2020-09-12 02:28:34 -07:00
1 parent 93c7d7fb15
commit 39b7c68818
3 files changed
+18 -19

No files matched your search

@@ -43,7 +43,6 @@ import org.bukkit.plugin.java.JavaPlugin;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.io.File;
import java.lang.reflect.Field;
public final class CarbonChat extends JavaPlugin {
@@ -80,8 +79,6 @@ public final class CarbonChat extends JavaPlugin {
@Override
public void onEnable() {
this.checkForBungee();
CommandAPI.onEnable(this);
final Metrics metrics = new Metrics(this, BSTATS_PLUGIN_ID);
@@ -200,21 +197,6 @@ public final class CarbonChat extends JavaPlugin {
this.filterHandler.reloadFilters();
}
private boolean bungeeEnabled = false;
private void checkForBungee() {
try {
final Class<?> spigotConfig = Class.forName("org.spigotmc.Spigotconfig");
final Field bungee = spigotConfig.getField("bungee");
this.bungeeEnabled = bungee.getBoolean(null);
} catch (final ClassNotFoundException | NoSuchFieldException | IllegalAccessException ignored) {
}
}
public boolean bungeeEnabled() {
return this.bungeeEnabled;
}
private void loadModConfig() {
this.modConfig = YamlConfiguration.loadConfiguration(new File(this.getDataFolder(), "moderation.yml"));
}