mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-12-24 01:17:41 +01:00
handle comments with newlines as individual lines, add anonymous config
This commit is contained in:
parent
448a92eebe
commit
039d73598a
@ -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