mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
//chunk no longer switches from //sel extend to //sel cuboid.
This commit is contained in:
parent
afb9052cc9
commit
bb5f3477c2
@ -193,14 +193,15 @@ public void chunk(CommandContext args, LocalSession session, LocalPlayer player,
|
||||
|
||||
final Vector min;
|
||||
final Vector max;
|
||||
final LocalWorld world = player.getWorld();
|
||||
if (args.hasFlag('s')) {
|
||||
Region region = session.getSelection(player.getWorld());
|
||||
Region region = session.getSelection(world);
|
||||
|
||||
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, player.getWorld().getMaxY(), max2D.getBlockZ() * 16 + 15);
|
||||
max = new Vector(max2D.getBlockX() * 16 + 15, world.getMaxY(), max2D.getBlockZ() * 16 + 15);
|
||||
|
||||
player.print("Chunks selected: ("
|
||||
+ min2D.getBlockX() + ", " + min2D.getBlockZ() + ") - ("
|
||||
@ -209,16 +210,20 @@ public void chunk(CommandContext args, LocalSession session, LocalPlayer player,
|
||||
final Vector2D min2D = ChunkStore.toChunk(player.getBlockIn());
|
||||
|
||||
min = new Vector(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16);
|
||||
max = min.add(15, player.getWorld().getMaxY(), 15);
|
||||
max = min.add(15, world.getMaxY(), 15);
|
||||
|
||||
player.print("Chunk selected: "
|
||||
+ min2D.getBlockX() + ", " + min2D.getBlockZ());
|
||||
}
|
||||
|
||||
CuboidRegionSelector selector = new CuboidRegionSelector(player.getWorld());
|
||||
final CuboidRegionSelector selector;
|
||||
if (session.getRegionSelector(world) instanceof ExtendingCuboidRegionSelector)
|
||||
selector = new ExtendingCuboidRegionSelector(world);
|
||||
else
|
||||
selector = new CuboidRegionSelector(world);
|
||||
selector.selectPrimary(min);
|
||||
selector.selectSecondary(max);
|
||||
session.setRegionSelector(player.getWorld(), selector);
|
||||
session.setRegionSelector(world, selector);
|
||||
|
||||
session.dispatchCUISelection(player);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user