Ejemplo n.º 1
0
 public ConfigAccessor(JavaPlugin plugin, String fileName) {
   if (!plugin.isInitialized()) {
     throw new IllegalArgumentException("plugin must be initialized");
   }
   this.plugin = plugin;
   this.fileName = fileName;
 }
Ejemplo n.º 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);
 }