You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -110,13 +111,10 @@ all fields in your class will be loaded and saved to the yaml document.
110
111
111
112
- The file specified in the constructor should be in the plugin's data folder, else it will appear in the main server directory.
112
113
113
-
- You can optionally set the defaults for the plugin by using `getResource`, this shouldn't be used by most people unless you are directly accessing values.
114
-
115
114
```java
116
115
public Settings(ExamplePlugin plugin) {
117
116
super(
118
-
newFile(plugin.getDataFolder(), "settings.yml"), // Point 1 (Required)
119
-
plugin.getResource("settings.yml"), // Point 2 (Optional)
117
+
newFile(plugin.getDataFolder(), "settings.yml"),
120
118
plugin.getConfigHandler()
121
119
);
122
120
}
@@ -292,6 +290,26 @@ override: true
292
290
# OVERRIDE is set to true.
293
291
```
294
292
293
+
#### @Priority
294
+
295
+
Used to set the position / order of a node instead of
296
+
using the position of the static member in the class.
297
+
298
+
Nodes have a priority of `Integer.MAX_VALUE` by default.
299
+
300
+
```java
301
+
@Priority(2)
302
+
public static int EXAMPLE = 3;
303
+
304
+
@Priority(1)
305
+
public static class TEST { }
306
+
```
307
+
308
+
```yaml
309
+
test: {}
310
+
example: 3
311
+
```
312
+
295
313
#### @Header & @Footer
296
314
297
315
- @Header is used to add a header comment to the top of a config document.
@@ -413,7 +431,7 @@ For more information about resolvers, please refer to the internal javadocs.
413
431
### Limitations
414
432
415
433
Due to the way that class members are retrieved in java, fields are always above
416
-
subclasses meaning the following is not possible.
434
+
subclasses meaning the following is not possible without using @Priority.
0 commit comments