mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Fixed not being possible to clear a home or warp's description
This commit is contained in:
1 parent
22ba7b4cf0
commit
571f35429d
3 files changed
+25
-27
No files matched your search
@@ -134,15 +134,8 @@ public class EditHomeCommand extends CommandBase implements TabCompletable, Cons
|
||||
}).ifPresent(editor::sendMessage));
|
||||
}
|
||||
case "description" -> {
|
||||
if (editArgs == null) {
|
||||
plugin.getLocales().getLocale("error_invalid_syntax",
|
||||
"/edithome <name> description <new description>")
|
||||
.ifPresent(editor::sendMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
final String oldHomeDescription = home.meta.description;
|
||||
final String newDescription = editArgs;
|
||||
final String newDescription = editArgs != null ? editArgs : "";
|
||||
|
||||
plugin.getSavedPositionManager().updateHomeMeta(home, new PositionMeta(home.meta.name, newDescription))
|
||||
.thenAccept(descriptionUpdateResult -> (switch (descriptionUpdateResult.resultType()) {
|
||||
@@ -150,14 +143,18 @@ public class EditHomeCommand extends CommandBase implements TabCompletable, Cons
|
||||
if (home.owner.uuid.equals(editor.uuid)) {
|
||||
yield plugin.getLocales().getLocale("edit_home_update_description",
|
||||
home.meta.name,
|
||||
oldHomeDescription,
|
||||
newDescription);
|
||||
oldHomeDescription.isBlank() ? plugin.getLocales()
|
||||
.getRawLocale("item_no_description").orElse("N/A") : oldHomeDescription,
|
||||
newDescription.isBlank() ? plugin.getLocales()
|
||||
.getRawLocale("item_no_description").orElse("N/A") : newDescription);
|
||||
} else {
|
||||
yield plugin.getLocales().getLocale("edit_home_update_description_other",
|
||||
home.owner.username,
|
||||
home.meta.name,
|
||||
oldHomeDescription,
|
||||
newDescription);
|
||||
oldHomeDescription.isBlank() ? plugin.getLocales()
|
||||
.getRawLocale("item_no_description").orElse("N/A") : oldHomeDescription,
|
||||
newDescription.isBlank() ? plugin.getLocales()
|
||||
.getRawLocale("item_no_description").orElse("N/A") : newDescription);
|
||||
}
|
||||
}
|
||||
case FAILED_DESCRIPTION_LENGTH ->
|
||||
|
||||
Reference in new issue
Block a user