Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: still show feedback if no regions affected by cmd #29

Open
wants to merge 1 commit into
base: 1.20.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ private static boolean executeRegionDataGet(CommandContext<ServerCommandSource>
context.getSource().sendFeedback(() -> withMapPrefix(map,
Text.translatable("text.nucleoid_creator_tools.map.region.data.get", region.marker(), formatNbt(region.data()))
), false);
return false;
return true;
}

private static boolean executeRegionDataMerge(CommandContext<ServerCommandSource> context, MapWorkspace map, WorkspaceRegion region) {
Expand Down Expand Up @@ -615,9 +615,15 @@ private static Command<ServerCommandSource> executeInRegions(String message, Reg
}

if (count > 0) {
int finalCount = count;
source.sendFeedback(() -> withMapPrefix(map, Text.literal(String.format(message, finalCount))), false);
if (!message.isEmpty()) {
int finalCount = count;
source.sendFeedback(() -> withMapPrefix(map, Text.literal(String.format(message, finalCount))), false);
}
} else {
var text = Text.translatable("text.nucleoid_creator_tools.map.region.none_affected");
source.sendFeedback(() -> withMapPrefix(map, text), false);
}

return 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't relevant to this pull request, but it's odd that this command has a result of 2.

};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"text.nucleoid_creator_tools.map.open.map_already_exists": "Map with id '%s' already exists!",
"text.nucleoid_creator_tools.map.open.success": "Opened workspace '%s'! Use %s to join this map",
"text.nucleoid_creator_tools.map.origin.set": "Updated origin for workspace",
"text.nucleoid_creator_tools.map.region.none_affected": "No regions affected.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this key should be sorted after text.nucleoid_creator_tools.map.region.entity.remove.success.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why particularly? That is for entity removal, and this is for any kind of region processing (e.g. remove, data get, merge, etc)

"text.nucleoid_creator_tools.map.region.add.success": "Added region '%s'.",
"text.nucleoid_creator_tools.map.region.add.success.excited": "Added region '%s'!",
"text.nucleoid_creator_tools.map.region.bounds.get": "%s to %s",
Expand Down
Loading