Skip to content

Commit

Permalink
Fix for spigot 1.18.1 enabling config comments by default. (#428)
Browse files Browse the repository at this point in the history
* Fix for spigot 1.18.1 enabling config comments by default.

* Unbump version number.
  • Loading branch information
LlmDl authored Dec 23, 2021
1 parent dc2d3c6 commit 2b253bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.4-R0.1-SNAPSHOT</version>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public boolean load() {
}

public void save() {

try {
// Spigot 1.18.1 added SnakeYaml's ability to use Comments in yaml.
// They have it enabled by default, we need to stop it happening.
yamlOptions.setProcessComments(false);
} catch (NoSuchMethodError ignored) {}

boolean saved = true;

Expand Down Expand Up @@ -206,6 +212,7 @@ public void addComment(String path, String... commentLines) {
comments.put(path, commentstring.toString());
}

@SuppressWarnings("deprecation")
@Override
public String saveToString() {
yamlOptions.setIndent(options().indent());
Expand Down

0 comments on commit 2b253bb

Please sign in to comment.