Skip to content

Commit dc3c910

Browse files
Added the ability to choose the mode of the sel command. World Edit commands who rely on the selection mode to be cuboid will now have the selection changed to the correct mode. Fixes issue #1.
1 parent 5176ccc commit dc3c910

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/main/java/com/codingpupper3033/codebtekml/mapdrawer/MinecraftCommands.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@ public class MinecraftCommands {
1111

1212
public static final String POS_COMMAND = "//pos%s";
1313
public static final String SEL_COMMAND = "//sel %s";
14+
public enum SEL_MODES {
15+
CUBOID("cuboid"),
16+
EXTEND("extend"),
17+
POLY("poly"),
18+
ELLIPSOID("ellipsoid"),
19+
SPHERE("sphere"),
20+
CYL("cyl"),
21+
CONVEX("convex");
22+
23+
private final String name;
24+
25+
SEL_MODES(String name) {
26+
27+
this.name = name;
28+
}
29+
30+
public String getName() {
31+
return name;
32+
}
33+
}
1434

1535
public static final String SET_COMMAND = "//set %s";
1636
public static final String LINE_COMMAND = "//line %s";
@@ -57,6 +77,7 @@ public static void pos(int numb) {
5777
public static void set(Coordinate pos, String blockName) {
5878
tpll(pos);
5979

80+
sel(SEL_MODES.CUBOID);
6081
pos(1);
6182
pos(2);
6283

@@ -69,10 +90,15 @@ public static void sel(String method) {
6990
send(String.format(SEL_COMMAND, method));
7091
}
7192

93+
public static void sel(SEL_MODES mode) {
94+
sel(mode.getName());
95+
}
96+
7297
public static void line(Coordinate start, Coordinate end, String blockName) {
7398
tpllDelete(start);
7499
tpllDelete(end);
75100

101+
sel(SEL_MODES.CUBOID);
76102
tpll(start);
77103
pos(1);
78104
tpll(end);

0 commit comments

Comments
 (0)