mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-27 12:35:12 +01:00
handle comments with newlines as individual lines, add anonymous config
This commit is contained in:
parent
19563b088e
commit
d323358604
@ -23,24 +23,21 @@ public class Comment {
|
||||
}
|
||||
|
||||
public Comment(String... lines) {
|
||||
this.lines.addAll(Arrays.asList(lines));
|
||||
this(null, Arrays.asList(lines));
|
||||
}
|
||||
|
||||
public Comment(List<String> lines) {
|
||||
if (lines != null) {
|
||||
this.lines.addAll(lines);
|
||||
}
|
||||
this(null, lines);
|
||||
}
|
||||
|
||||
public Comment(CommentStyle commentStyle, String... lines) {
|
||||
this.commentStyle = commentStyle;
|
||||
this.lines.addAll(Arrays.asList(lines));
|
||||
this(commentStyle, Arrays.asList(lines));
|
||||
}
|
||||
|
||||
public Comment(CommentStyle commentStyle, List<String> lines) {
|
||||
this.commentStyle = commentStyle;
|
||||
if (lines != null) {
|
||||
this.lines.addAll(lines);
|
||||
lines.forEach(s -> this.lines.addAll(Arrays.asList(s.split("\n"))));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,6 +109,13 @@ public class Config extends ConfigSection {
|
||||
*/
|
||||
int commentSpacing = 1;
|
||||
|
||||
public Config() {
|
||||
this.plugin = null;
|
||||
this.file = null;
|
||||
dirName = null;
|
||||
fileName = null;
|
||||
}
|
||||
|
||||
public Config(@NotNull File file) {
|
||||
this.plugin = null;
|
||||
this.file = file.getAbsoluteFile();
|
||||
|
Loading…
Reference in New Issue
Block a user