Skip to content

Commit

Permalink
fix: still show feedback if no regions affected by cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Restioson committed Jun 13, 2024
1 parent a60df65 commit b567de1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private static boolean executeRegionDataGet(CommandContext<ServerCommandSource>
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 @@ -598,9 +598,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;
};
}
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.",
"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

0 comments on commit b567de1

Please sign in to comment.