Пример #1
0
 public ConfigAccessor(JavaPlugin plugin, String fileName) {
   if (!plugin.isInitialized()) {
     throw new IllegalArgumentException("plugin must be initialized");
   }
   this.plugin = plugin;
   this.fileName = fileName;
 }
Пример #2
0
 @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);
 }