@@ -43,14 +43,14 @@ public class ConfigAPI {
43
43
* @param nameStyle Style of config's fields names
44
44
* @param commentStyle Style of config's comments
45
45
* @param automaticColorStrings Automatic translate '&' based colors
46
- * @param dir The config's directory.
46
+ * @param directory The config's directory.
47
47
* @param plugin Instance of your plugin
48
48
* @see NameStyle
49
49
* @see CommentStyle
50
50
* @return Instance of {@param clazz} ready to use methods
51
51
*/
52
52
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 ){
54
54
55
55
ConfigAPI .plugin = plugin ;
56
56
ConfigName configName = clazz .getAnnotation (ConfigName .class );
@@ -62,9 +62,10 @@ public static <T extends Config> T init(Class<T> clazz, NameStyle nameStyle, Com
62
62
String configComment = configCommentAnnotation == null ? null : configCommentAnnotation .value ();
63
63
64
64
String name = configName .value () + (configName .value ().endsWith (".yml" ) ? "" : ".yml" );
65
- File file = new File (dir , name );
65
+ File file = new File (directory , name );
66
66
67
- BukkitConfiguration rawConfiguration = new BukkitConfiguration (file , nameStyle , commentStyle , automaticColorStrings , configComment );
67
+ BukkitConfiguration rawConfiguration = new BukkitConfiguration (directory , file , nameStyle , commentStyle ,
68
+ automaticColorStrings , configComment );
68
69
rawConfigurations .put (name , rawConfiguration );
69
70
70
71
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
100
101
* @return Instance of {@param clazz} ready to use methods
101
102
*/
102
103
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 );
104
106
}
105
107
106
108
/**
107
109
* Initializes instance of Config with default values
108
110
* (CAMEL_CASE as NameStyle, ABOVE_CONTENT as CommentStyle, enabled automatic translation of '&' based colors)
109
111
* @param clazz Class of your Config interface
110
- * @param dir The config's directory.
112
+ * @param directory The config's directory.
111
113
* @param plugin Instance of your plugin
112
114
* @return Instance of {@param clazz} ready to use methods
113
115
*/
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 );
116
118
}
117
119
118
120
/**
0 commit comments