@@ -43,14 +43,14 @@ public class ConfigAPI {
4343 * @param nameStyle Style of config's fields names
4444 * @param commentStyle Style of config's comments
4545 * @param automaticColorStrings Automatic translate '&' based colors
46- * @param dir The config's directory.
46+ * @param directory The config's directory.
4747 * @param plugin Instance of your plugin
4848 * @see NameStyle
4949 * @see CommentStyle
5050 * @return Instance of {@param clazz} ready to use methods
5151 */
5252 public static <T extends Config > T init (Class <T > clazz , NameStyle nameStyle , CommentStyle commentStyle ,
53- boolean automaticColorStrings , File dir , JavaPlugin plugin ){
53+ boolean automaticColorStrings , File directory , JavaPlugin plugin ){
5454
5555 ConfigAPI .plugin = plugin ;
5656 ConfigName configName = clazz .getAnnotation (ConfigName .class );
@@ -62,9 +62,10 @@ public static <T extends Config> T init(Class<T> clazz, NameStyle nameStyle, Com
6262 String configComment = configCommentAnnotation == null ? null : configCommentAnnotation .value ();
6363
6464 String name = configName .value () + (configName .value ().endsWith (".yml" ) ? "" : ".yml" );
65- File file = new File (dir , name );
65+ File file = new File (directory , name );
6666
67- BukkitConfiguration rawConfiguration = new BukkitConfiguration (file , nameStyle , commentStyle , automaticColorStrings , configComment );
67+ BukkitConfiguration rawConfiguration = new BukkitConfiguration (directory , file , nameStyle , commentStyle ,
68+ automaticColorStrings , configComment );
6869 rawConfigurations .put (name , rawConfiguration );
6970
7071 T configuration = (T ) Proxy .newProxyInstance (clazz .getClassLoader (), new Class []{clazz },
@@ -100,19 +101,20 @@ public static <T extends Config> T init(Class<T> clazz, NameStyle nameStyle, Com
100101 * @return Instance of {@param clazz} ready to use methods
101102 */
102103 public static <T extends Config > T init (Class <T > clazz , JavaPlugin plugin ) {
103- return init (clazz , NameStyle .CAMEL_CASE , CommentStyle .ABOVE_CONTENT , true , plugin );
104+ return init (clazz , NameStyle .CAMEL_CASE , CommentStyle .ABOVE_CONTENT ,
105+ true , plugin .getDataFolder (), plugin );
104106 }
105107
106108 /**
107109 * Initializes instance of Config with default values
108110 * (CAMEL_CASE as NameStyle, ABOVE_CONTENT as CommentStyle, enabled automatic translation of '&' based colors)
109111 * @param clazz Class of your Config interface
110- * @param dir The config's directory.
112+ * @param directory The config's directory.
111113 * @param plugin Instance of your plugin
112114 * @return Instance of {@param clazz} ready to use methods
113115 */
114- public static <T extends Config > T init (Class <T > clazz , File dir , JavaPlugin plugin ) {
115- return init (clazz , NameStyle .CAMEL_CASE , CommentStyle .ABOVE_CONTENT , true , dir , plugin );
116+ public static <T extends Config > T init (Class <T > clazz , File directory , JavaPlugin plugin ) {
117+ return init (clazz , NameStyle .CAMEL_CASE , CommentStyle .ABOVE_CONTENT , true , directory , plugin );
116118 }
117119
118120 /**
0 commit comments