Skip to content

Commit

Permalink
Merge pull request #386 from arvitus/cli-arguments
Browse files Browse the repository at this point in the history
Fixing import and export mode in CLI
  • Loading branch information
Querz authored Jun 1, 2023
2 parents a04e863 + 3b27827 commit 47d2002
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/main/java/net/querz/mcaselector/cli/ParamExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ public final class ParamExecutor {
.longOpt("force")
.desc("Whether to force NBT tags during NBT change")
.build());
options.addOption(Option.builder()
.longOpt("sections")
.desc("One or a range of section indices to import into the target world during chunk import")
.hasArg()
.build());
options.addOption(Option.builder()
.longOpt("render-height")
.desc("The highest Y level to render in image mode")
Expand Down Expand Up @@ -340,7 +345,7 @@ public Future<Boolean> run() {
private void printHelp() {
String[] helpOrder = new String[]{
"help", "version", "mode", "output", "query", "selection", "source-selection", "radius", "x-offset",
"y-offset", "z-offset", "overwrite", "force", "render-height", "render-caves", "render-layer-only",
"y-offset", "z-offset", "overwrite", "force", "sections", "render-height", "render-caves", "render-layer-only",
"render-shade", "render-water-shade", "overlay-type", "overlay-min-value", "overlay-max-value",
"overlay-data", "overlay-min-hue", "overlay-max-hue", "zoom-level", "world", "region", "poi", "entities",
"source-world", "source-region", "source-poi", "source-entities", "output-world", "output-region",
Expand Down Expand Up @@ -513,7 +518,7 @@ private WorldDirectories parseAndCreateWorldDirectories(String prefix) throws Pa
poi = parseDirAndCreate(poiName);
} else {
poi = new File(world, "poi");
if (!region.mkdirs()) {
if (!poi.mkdirs()) {
throw new ParseException(String.format("failed to create poi directory %s", poi));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public boolean execute() {

ChunkSet targetChunks = null;
if (targetSelection != null) {
targetChunks = sourceSelection.getSelectedChunks(target);
targetChunks = targetSelection.getSelectedChunks(target);
}

for (Map.Entry<Point2i, byte[]> sourceData : sourceDataMappingRegion.entrySet()) {
Expand Down

0 comments on commit 47d2002

Please sign in to comment.