Add allow_unicode_descriptions config option to allow unicode in descriptions (default on), Close #67

Split invalid description locales in two for more specific errors
Add defaults in Settings config reader

Signed-off-by: BuildTools <[email protected]>
This commit is contained in:
BuildTools committed 2021-07-13 00:44:08 +03:00
1 parent 85b51bc5ae
commit 3b5140f794
8 files changed
+118 -95

No files matched your search

@@ -133,10 +133,16 @@ public class EditHomeCommand extends CommandBase implements TabCompleter {
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
try {
// Check the description is valid
if (newDescriptionString.length() > 255 || !RegexUtil.DESCRIPTION_PATTERN.matcher(newDescriptionString).matches()) {
MessageManager.sendMessage(p, "error_edit_home_invalid_description");
if (newDescriptionString.length() > 255) {
MessageManager.sendMessage(p, "error_edit_home_description_length");
return;
}
if (!HuskHomes.getSettings().doUnicodeInDescriptions()) {
if (!RegexUtil.DESCRIPTION_PATTERN.matcher(newDescriptionString).matches()) {
MessageManager.sendMessage(p, "error_edit_home_description_characters");
return;
}
}
// Remove old marker if on the Dynmap
if (descriptionChangedHome.isPublic() && HuskHomes.getSettings().doMapIntegration() && HuskHomes.getSettings().showPublicHomesOnMap()) {