Allow multiline comments and improve comment about Floodgate

This commit is contained in:
Phoenix616 2021-03-18 14:41:34 +01:00
parent f68a3203ac
commit a3c5ec618a
No known key found for this signature in database
GPG Key ID: 40E2321E71738EB0
2 changed files with 6 additions and 2 deletions

View File

@ -19,7 +19,9 @@ public class FieldParser {
StringBuilder builder = new StringBuilder(50);
if (field.isAnnotationPresent(ConfigurationComment.class)) {
builder.append("# ").append(field.getAnnotation(ConfigurationComment.class).value()).append('\n');
for (String commentLine : field.getAnnotation(ConfigurationComment.class).value().split("\n")) {
builder.append("# ").append(commentLine).append('\n');
}
}
ValueParser parser = Configuration.getParser(field);

View File

@ -197,7 +197,9 @@ public class Properties {
@ConfigurationComment("This makes sure that the UUIDs of player shop accounts match the server's online-mode setting. Disabling this might lead to issues with offline players and is therefore unsupported!")
public static boolean ENSURE_CORRECT_PLAYERID = true;
@ConfigurationComment("This regexp validates the name of the player. If the name doesn't match, the player will neither be able to create a valid shop sign, nor buy/sell from a shop. Note to Bedrock players: If you have Floodgate on your server, you should set this regexp to ^\\\\*?\\\\w+$ and ENSURE_CORRECT_PLAYERID to false")
@ConfigurationComment("This regexp validates the name of the player. If the name doesn't match, the player will neither be able to create a valid shop sign, nor buy/sell from a shop.\n" +
"Note for Bedrock support: If you have Floodgate on your server, you should set this regexp to ^\\\\*?\\\\w+$ and ENSURE_CORRECT_PLAYERID to false\n" +
"If your Floodgate prefix is not *, change the first * in the regexp (the one before the question mark) to whatever your prefix is.")
public static String VALID_PLAYERNAME_REGEXP = "^\\\\w+$";
@PrecededBySpace