geforkt von Mirrors/FastAsyncWorldEdit
Added a -s flag to //chunk, which extends your current selection to the encompassed chunks.
Dieser Commit ist enthalten in:
Ursprung
c79d90bb99
Commit
ea445ebcf5
@ -170,7 +170,8 @@ public class SelectionCommands {
|
|||||||
@Command(
|
@Command(
|
||||||
aliases = {"/chunk"},
|
aliases = {"/chunk"},
|
||||||
usage = "",
|
usage = "",
|
||||||
desc = "Set the selection to your current chunk",
|
flags = "s",
|
||||||
|
desc = "Set the selection to your current chunk. The -s flag extends your current selection to the encompassed chunks.",
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 0
|
max = 0
|
||||||
)
|
)
|
||||||
@ -179,9 +180,30 @@ public class SelectionCommands {
|
|||||||
LocalSession session, LocalPlayer player, EditSession editSession)
|
LocalSession session, LocalPlayer player, EditSession editSession)
|
||||||
throws WorldEditException {
|
throws WorldEditException {
|
||||||
|
|
||||||
Vector2D min2D = ChunkStore.toChunk(player.getBlockIn());
|
final Vector min;
|
||||||
Vector min = new Vector(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16);
|
final Vector max;
|
||||||
Vector max = min.add(15, 127, 15);
|
if (args.hasFlag('s')) {
|
||||||
|
Region region = session.getSelection(player.getWorld());
|
||||||
|
|
||||||
|
final Vector2D min2D = ChunkStore.toChunk(region.getMinimumPoint());
|
||||||
|
final Vector2D max2D = ChunkStore.toChunk(region.getMaximumPoint());
|
||||||
|
|
||||||
|
min = new Vector(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16);
|
||||||
|
max = new Vector(max2D.getBlockX() * 16 + 15, 127, max2D.getBlockZ() * 16 + 15);
|
||||||
|
|
||||||
|
player.print("Chunks selected: ("
|
||||||
|
+ min2D.getBlockX() + ", " + min2D.getBlockZ() + ") - ("
|
||||||
|
+ max2D.getBlockX() + ", " + max2D.getBlockZ() + ")");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
final Vector2D min2D = ChunkStore.toChunk(player.getBlockIn());
|
||||||
|
|
||||||
|
min = new Vector(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16);
|
||||||
|
max = min.add(15, 127, 15);
|
||||||
|
|
||||||
|
player.print("Chunk selected: "
|
||||||
|
+ min2D.getBlockX() + ", " + min2D.getBlockZ());
|
||||||
|
}
|
||||||
|
|
||||||
CuboidRegionSelector selector = new CuboidRegionSelector();
|
CuboidRegionSelector selector = new CuboidRegionSelector();
|
||||||
selector.selectPrimary(min);
|
selector.selectPrimary(min);
|
||||||
@ -190,8 +212,6 @@ public class SelectionCommands {
|
|||||||
|
|
||||||
session.dispatchCUISelection(player);
|
session.dispatchCUISelection(player);
|
||||||
|
|
||||||
player.print("Chunk selected: "
|
|
||||||
+ min2D.getBlockX() + ", " + min2D.getBlockZ());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren