Skip to content

Commit 44dfe7f

Browse files
committed
fix: still show feedback if no regions affected by cmd
1 parent a37edaa commit 44dfe7f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/main/java/xyz/nucleoid/creator_tools/command/MapMetadataCommand.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ private static boolean executeRegionDataGet(CommandContext<ServerCommandSource>
279279
context.getSource().sendFeedback(() -> withMapPrefix(map,
280280
Text.translatable("text.nucleoid_creator_tools.map.region.data.get", region.marker(), formatNbt(region.data()))
281281
), false);
282-
return false;
282+
return true;
283283
}
284284

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

617617
if (count > 0) {
618-
int finalCount = count;
619-
source.sendFeedback(() -> withMapPrefix(map, Text.literal(String.format(message, finalCount))), false);
618+
if (!message.isEmpty()) {
619+
int finalCount = count;
620+
source.sendFeedback(() -> withMapPrefix(map, Text.literal(String.format(message, finalCount))), false);
621+
}
622+
} else {
623+
var text = Text.translatable("text.nucleoid_creator_tools.map.region.none_affected");
624+
source.sendFeedback(() -> withMapPrefix(map, text), false);
620625
}
626+
621627
return 2;
622628
};
623629
}

src/main/resources/data/nucleoid_creator_tools/lang/en_us.json

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"text.nucleoid_creator_tools.map.open.map_already_exists": "Map with id '%s' already exists!",
4848
"text.nucleoid_creator_tools.map.open.success": "Opened workspace '%s'! Use %s to join this map",
4949
"text.nucleoid_creator_tools.map.origin.set": "Updated origin for workspace",
50+
"text.nucleoid_creator_tools.map.region.none_affected": "No regions affected.",
5051
"text.nucleoid_creator_tools.map.region.add.success": "Added region '%s'.",
5152
"text.nucleoid_creator_tools.map.region.add.success.excited": "Added region '%s'!",
5253
"text.nucleoid_creator_tools.map.region.bounds.get": "%s to %s",

0 commit comments

Comments
 (0)