mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Give some form of feedback when trying to applyedits no changes instead of no feedback at all (#1136)
This commit is contained in:
parent
486ddb3d42
commit
553da9baf6
@ -76,13 +76,21 @@ public class ApplyEditsCommand extends SingleCommand {
|
||||
return CommandResult.FAILURE;
|
||||
}
|
||||
|
||||
boolean success = false;
|
||||
|
||||
if (data.has("tabs") && data.get("tabs").isJsonArray()) {
|
||||
JsonArray rows = data.get("tabs").getAsJsonArray();
|
||||
for (JsonElement row : rows) {
|
||||
read(row.getAsJsonObject(), sender, plugin);
|
||||
if (read(row.getAsJsonObject(), sender, plugin)) {
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
read(data, sender, plugin);
|
||||
success = read(data, sender, plugin);
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
Message.APPLY_EDITS_TARGET_NO_CHANGES_PRESENT.send(sender);
|
||||
}
|
||||
|
||||
return CommandResult.SUCCESS;
|
||||
|
@ -155,6 +155,7 @@ public enum Message {
|
||||
APPLY_EDITS_TARGET_USER_NOT_UUID("&cTarget user &4{}&c is not a valid uuid.", true),
|
||||
APPLY_EDITS_TARGET_USER_UNABLE_TO_LOAD("&cUnable to load target user &4{}&c.", true),
|
||||
APPLY_EDITS_TARGET_UNKNOWN("&cInvalid target. &7({})", true),
|
||||
APPLY_EDITS_TARGET_NO_CHANGES_PRESENT("&aNo changes were applied from the web editor. The returned data didn't contain any edits.", true),
|
||||
APPLY_EDITS_SUCCESS("&aWeb editor data was applied to &b{}&a successfully.", true),
|
||||
APPLY_EDITS_SUCCESS_SUMMARY("&7(&a{} &7{} and &c{} &7{})", true),
|
||||
APPLY_EDITS_DIFF_ADDED("&a+ &f{}", false),
|
||||
|
Loading…
Reference in New Issue
Block a user