Skip to content

Commit

Permalink
Allow to set the dimension in the cli
Browse files Browse the repository at this point in the history
  • Loading branch information
hube12 committed May 28, 2024
1 parent 03cef87 commit f9e608c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx4G

version=1.0.26
version=1.0.27-beta1

lwjglVersion=3.3.1

Expand Down
16 changes: 14 additions & 2 deletions src/main/java/com/seedfinding/minemap/MineMap.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.seedfinding.minemap;

import com.formdev.flatlaf.*;
import com.formdev.flatlaf.intellijthemes.FlatAllIJThemes;
import com.seedfinding.mccore.util.data.Pair;
import com.seedfinding.mccore.version.MCVersion;
import com.seedfinding.mcfeature.misc.SlimeChunk;
Expand Down Expand Up @@ -174,7 +173,20 @@ private static void doScreenshot(String[] args) throws IOException {
System.err.println("No size argument provided, command is --screenshot --seed <seed> --version <version> --pos <x> <z> --size <size>");
return;
}
MapSettings settings = new MapSettings(version, OVERWORLD).refresh();
com.seedfinding.mccore.state.Dimension dimension = OVERWORLD;
if (Arrays.asList(args).contains("--dimension")) {
int idx = Arrays.asList(args).indexOf("--dimension");
if (idx + 1 > args.length) {
System.err.println("Error no dimension provided");
return;
}
dimension = com.seedfinding.mccore.state.Dimension.fromString(args[idx + 1]);
if (dimension == null) {
System.err.println("Invalid dimension provided, should be: " + Arrays.toString(com.seedfinding.mccore.state.Dimension.values()));
return;
}
}
MapSettings settings = new MapSettings(version, dimension).refresh();
MapContext context = new MapContext(seed, settings);
settings.hide(SlimeChunk.class, Mineshaft.class);
Fragment fragment = new Fragment(blockX, blockZ, size, context);
Expand Down

0 comments on commit f9e608c

Please sign in to comment.