public ConfigAccessor(JavaPlugin plugin, String fileName) { if (!plugin.isInitialized()) { throw new IllegalArgumentException("plugin must be initialized"); } this.plugin = plugin; this.fileName = fileName; }
@SuppressWarnings("deprecation") public ConfigFile(JavaPlugin plugin, String fileName) { if (plugin == null) throw new IllegalArgumentException("plugin cannot be null"); if (!plugin.isInitialized()) throw new IllegalArgumentException("plugin must be initialized"); this.plugin = plugin; this.fileName = fileName; File dataFolder = plugin.getDataFolder(); if (dataFolder == null) throw new IllegalStateException(); this.configFile = new File(plugin.getDataFolder(), fileName); }