mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Major command changes that don't work yet.
This commit is contained in:
@ -19,27 +19,31 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import static com.sk89q.worldedit.command.util.Logging.LogMode.POSITION;
|
||||
import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION;
|
||||
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.object.clipboard.URIClipboardHolder;
|
||||
import com.boydti.fawe.object.mask.IdMask;
|
||||
import com.boydti.fawe.object.regions.selector.FuzzyRegionSelector;
|
||||
import com.boydti.fawe.object.regions.selector.PolyhedralRegionSelector;
|
||||
import com.sk89q.minecraft.util.commands.Command;
|
||||
import com.sk89q.minecraft.util.commands.CommandContext;
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
||||
import com.sk89q.minecraft.util.commands.Logging;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.BaseItemStack;
|
||||
import com.sk89q.worldedit.command.argument.SelectorChoice;
|
||||
import com.sk89q.worldedit.command.util.CommandPermissions;
|
||||
import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator;
|
||||
import com.sk89q.worldedit.command.util.Logging;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.internal.annotation.Direction;
|
||||
import com.sk89q.worldedit.internal.annotation.MultiDirection;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
@ -55,28 +59,29 @@ import com.sk89q.worldedit.regions.selector.RegionSelectorType;
|
||||
import com.sk89q.worldedit.regions.selector.SphereRegionSelector;
|
||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import com.sk89q.worldedit.util.Countable;
|
||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||
import com.sk89q.worldedit.util.formatting.ColorCodeBuilder;
|
||||
import com.sk89q.worldedit.util.formatting.Style;
|
||||
import com.sk89q.worldedit.util.formatting.StyledFragment;
|
||||
import com.sk89q.worldedit.util.formatting.component.CommandListBox;
|
||||
import com.sk89q.worldedit.util.formatting.component.SubtleFormat;
|
||||
import com.sk89q.worldedit.util.formatting.component.TextComponentProducer;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.ClickEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import com.sk89q.worldedit.world.storage.ChunkStore;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION;
|
||||
import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION;
|
||||
import java.util.stream.Stream;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
import org.enginehub.piston.annotation.CommandContainer;
|
||||
import org.enginehub.piston.annotation.param.Arg;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
|
||||
/**
|
||||
* Selection commands.
|
||||
*/
|
||||
@Command(aliases = {}, desc = "Change your selection points, mode or view info about your selection: [More Info](http://wiki.sk89q.com/wiki/WorldEdit/Selection)")
|
||||
@CommandContainer(superTypes = CommandPermissionsConditionGenerator.Registration.class)
|
||||
public class SelectionCommands {
|
||||
|
||||
private final WorldEdit we;
|
||||
@ -86,26 +91,17 @@ public class SelectionCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/pos1", "posa", "/1"},
|
||||
usage = "[coordinates]",
|
||||
desc = "Set position 1",
|
||||
min = 0,
|
||||
max = 1
|
||||
name = "/pos1",
|
||||
desc = "Set position 1"
|
||||
)
|
||||
@Logging(POSITION)
|
||||
@CommandPermissions("worldedit.selection.pos")
|
||||
public void pos1(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
|
||||
public void pos1(Player player, LocalSession session,
|
||||
@Arg(desc = "Coordinates to set position 1 to", def = "")
|
||||
BlockVector3 coordinates) throws WorldEditException {
|
||||
BlockVector3 pos;
|
||||
|
||||
if (args.argsLength() == 1) {
|
||||
if (args.getString(0).matches("-?\\d+,-?\\d+,-?\\d+")) {
|
||||
String[] coords = args.getString(0).split(",");
|
||||
pos = BlockVector3.at(Integer.parseInt(coords[0]), Integer.parseInt(coords[1]), Integer.parseInt(coords[2]));
|
||||
} else {
|
||||
BBC.SELECTOR_INVALID_COORDINATES.send(player, args.getString(0));
|
||||
return;
|
||||
}
|
||||
if (coordinates != null) {
|
||||
pos = coordinates;
|
||||
} else {
|
||||
pos = player.getBlockIn().toBlockPoint();
|
||||
}
|
||||
@ -115,31 +111,22 @@ public class SelectionCommands {
|
||||
return;
|
||||
}
|
||||
|
||||
session.getRegionSelector(player.getWorld()).explainPrimarySelection(player, session, pos);
|
||||
session.getRegionSelector(player.getWorld())
|
||||
.explainPrimarySelection(player, session, pos);
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/pos2", "posb", "/2"},
|
||||
usage = "[coordinates]",
|
||||
desc = "Set position 2",
|
||||
min = 0,
|
||||
max = 1
|
||||
name = "/pos2",
|
||||
desc = "Set position 2"
|
||||
)
|
||||
@Logging(POSITION)
|
||||
@CommandPermissions("worldedit.selection.pos")
|
||||
public void pos2(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
|
||||
public void pos2(Player player, LocalSession session,
|
||||
@Arg(desc = "Coordinates to set position 2 to", def = "")
|
||||
BlockVector3 coordinates) throws WorldEditException {
|
||||
BlockVector3 pos;
|
||||
if (args.argsLength() == 1) {
|
||||
if (args.getString(0).matches("-?\\d+,-?\\d+,-?\\d+")) {
|
||||
String[] coords = args.getString(0).split(",");
|
||||
pos = BlockVector3.at(Integer.parseInt(coords[0]),
|
||||
Integer.parseInt(coords[1]),
|
||||
Integer.parseInt(coords[2]));
|
||||
} else {
|
||||
BBC.SELECTOR_INVALID_COORDINATES.send(player, args.getString(0));
|
||||
return;
|
||||
}
|
||||
if (coordinates != null) {
|
||||
pos = coordinates;
|
||||
} else {
|
||||
pos = player.getBlockIn().toBlockPoint();
|
||||
}
|
||||
@ -154,15 +141,13 @@ public class SelectionCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/hpos1"},
|
||||
usage = "",
|
||||
desc = "Set position 1 to targeted block",
|
||||
min = 0,
|
||||
max = 0
|
||||
name = "/hpos1",
|
||||
desc = "Set position 1 to targeted block"
|
||||
)
|
||||
@CommandPermissions("worldedit.selection.hpos")
|
||||
public void hpos1(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
BlockVector3 pos = player.getBlockTrace(300).toBlockPoint();
|
||||
public void hpos1(Player player, LocalSession session) throws WorldEditException {
|
||||
|
||||
BlockVector3 pos = player.getBlockTrace(300).toBlockPoint();
|
||||
|
||||
if (pos != null) {
|
||||
if (!session.getRegionSelector(player.getWorld()).selectPrimary(pos, ActorSelectorLimits.forActor(player))) {
|
||||
@ -178,15 +163,13 @@ public class SelectionCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/hpos2"},
|
||||
usage = "",
|
||||
desc = "Set position 2 to targeted block",
|
||||
min = 0,
|
||||
max = 0
|
||||
name = "/hpos2",
|
||||
desc = "Set position 2 to targeted block"
|
||||
)
|
||||
@CommandPermissions("worldedit.selection.hpos")
|
||||
public void hpos2(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
BlockVector3 pos = player.getBlockTrace(300).toBlockPoint();
|
||||
public void hpos2(Player player, LocalSession session) throws WorldEditException {
|
||||
|
||||
BlockVector3 pos = player.getBlockTrace(300).toBlockPoint();
|
||||
|
||||
if (pos != null) {
|
||||
if (!session.getRegionSelector(player.getWorld()).selectSecondary(pos, ActorSelectorLimits.forActor(player))) {
|
||||
@ -202,28 +185,22 @@ public class SelectionCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/chunk"},
|
||||
usage = "[x,z coordinates]",
|
||||
flags = "sc",
|
||||
desc = "Set the selection to your current chunk.",
|
||||
help =
|
||||
"Set the selection to the chunk you are currently in.\n" +
|
||||
"With the -s flag, your current selection is expanded\n" +
|
||||
"to encompass all chunks that are part of it.\n\n" +
|
||||
"Specifying coordinates will use those instead of your\n" +
|
||||
"current position. Use -c to specify chunk coordinates,\n" +
|
||||
"otherwise full coordinates will be implied.\n" +
|
||||
"(for example, the coordinates 5,5 are the same as -c 0,0)",
|
||||
min = 0,
|
||||
max = 1
|
||||
name = "/chunk",
|
||||
desc = "Set the selection to your current chunk."
|
||||
)
|
||||
@Logging(POSITION)
|
||||
@CommandPermissions("worldedit.selection.chunk")
|
||||
public void chunk(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
public void chunk(Player player, LocalSession session,
|
||||
@Arg(desc = "The chunk to select", def = "")
|
||||
BlockVector2 coordinates,
|
||||
@Switch(name = 's', desc = "Expand your selection to encompass all chunks that are part of it")
|
||||
boolean expandSelection,
|
||||
@Switch(name = 'c', desc = "Use chunk coordinates instead of block coordinates")
|
||||
boolean useChunkCoordinates) throws WorldEditException {
|
||||
final BlockVector3 min;
|
||||
final BlockVector3 max;
|
||||
final World world = player.getWorld();
|
||||
if (args.hasFlag('s')) {
|
||||
if (expandSelection) {
|
||||
Region region = session.getSelection(world);
|
||||
|
||||
final BlockVector2 min2D = ChunkStore.toChunk(region.getMinimumPoint());
|
||||
@ -235,16 +212,11 @@ public class SelectionCommands {
|
||||
BBC.SELECTION_CHUNKS.send(player, min2D.getBlockX() + ", " + min2D.getBlockZ(), max2D.getBlockX() + ", " + max2D.getBlockZ());
|
||||
} else {
|
||||
final BlockVector2 min2D;
|
||||
if (args.argsLength() == 1) {
|
||||
if (coordinates != null) {
|
||||
// coords specified
|
||||
String[] coords = args.getString(0).split(",");
|
||||
if (coords.length != 2) {
|
||||
BBC.SELECTOR_INVALID_COORDINATES.send(player, args.getString(0));
|
||||
}
|
||||
int x = Integer.parseInt(coords[0]);
|
||||
int z = Integer.parseInt(coords[1]);
|
||||
BlockVector2 pos = BlockVector2.at(x, z);
|
||||
min2D = (args.hasFlag('c')) ? pos : ChunkStore.toChunk(pos.toBlockVector3());
|
||||
min2D = useChunkCoordinates
|
||||
? coordinates
|
||||
: ChunkStore.toChunk(coordinates.toBlockVector3());
|
||||
} else {
|
||||
// use player loc
|
||||
min2D = ChunkStore.toChunk(player.getBlockIn().toBlockPoint());
|
||||
@ -271,14 +243,12 @@ public class SelectionCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/wand", "/w"},
|
||||
usage = "",
|
||||
desc = "Get the wand object",
|
||||
min = 0,
|
||||
max = 0
|
||||
name = "/wand",
|
||||
desc = "Get the wand object"
|
||||
)
|
||||
@CommandPermissions("worldedit.wand")
|
||||
public void wand(Player player) throws WorldEditException {
|
||||
public void wand(Player player, LocalSession session,
|
||||
@Switch(name = 'n', desc = "Get a navigation wand") boolean navWand) throws WorldEditException {
|
||||
player.giveItem(new BaseItemStack(ItemTypes.parse(we.getConfiguration().wandItem), 1));
|
||||
BBC.SELECTION_WAND.send(player);
|
||||
if (!player.hasPermission("fawe.tips"))
|
||||
@ -286,176 +256,46 @@ public class SelectionCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"toggleeditwand"},
|
||||
usage = "",
|
||||
desc = "Toggle functionality of the edit wand",
|
||||
min = 0,
|
||||
max = 0
|
||||
name = "toggleeditwand",
|
||||
desc = "Remind the user that the wand is now a tool and can be unbound with /none."
|
||||
)
|
||||
@CommandPermissions("worldedit.wand.toggle")
|
||||
public void toggleWand(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
|
||||
session.setToolControl(!session.isToolControlEnabled());
|
||||
|
||||
if (session.isToolControlEnabled()) {
|
||||
BBC.SELECTION_WAND_ENABLE.m().send(player);
|
||||
} else {
|
||||
BBC.SELECTION_WAND_DISABLE.send(player);
|
||||
}
|
||||
public void toggleWand(Player player) {
|
||||
player.print(TextComponent.of("The selection wand is now a normal tool. You can disable it with ")
|
||||
.append(TextComponent.of("/none", TextColor.AQUA).clickEvent(
|
||||
ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "/none")))
|
||||
.append(TextComponent.of(" and rebind it to any item with "))
|
||||
.append(TextComponent.of("//selwand", TextColor.AQUA).clickEvent(
|
||||
ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "//selwand")))
|
||||
.append(TextComponent.of(" or get a new wand with "))
|
||||
.append(TextComponent.of("//wand", TextColor.AQUA).clickEvent(
|
||||
ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "//wand"))));
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/expand"},
|
||||
usage = "<amount> [reverse-amount] <direction>",
|
||||
desc = "Expand the selection area",
|
||||
min = 1,
|
||||
max = 3
|
||||
)
|
||||
@Logging(REGION)
|
||||
@CommandPermissions("worldedit.selection.expand")
|
||||
public void expand(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
|
||||
// Special syntax (//expand vert) to expand the selection between
|
||||
// sky and bedrock.
|
||||
if (args.getString(0).equalsIgnoreCase("vert") || args.getString(0).equalsIgnoreCase("vertical")) {
|
||||
Region region = session.getSelection(player.getWorld());
|
||||
try {
|
||||
int oldSize = region.getArea();
|
||||
region.expand(
|
||||
BlockVector3.at(0, (player.getWorld().getMaxY() + 1), 0),
|
||||
BlockVector3.at(0, -(player.getWorld().getMaxY() + 1), 0));
|
||||
session.getRegionSelector(player.getWorld()).learnChanges();
|
||||
int newSize = region.getArea();
|
||||
session.getRegionSelector(player.getWorld()).explainRegionAdjust(player, session);
|
||||
BBC.SELECTION_EXPAND_VERT.send(player, (newSize - oldSize));
|
||||
} catch (RegionOperationException e) {
|
||||
player.printError(e.getMessage());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
List<BlockVector3> dirs = new ArrayList<>();
|
||||
int change = args.getInteger(0);
|
||||
int reverseChange = 0;
|
||||
|
||||
switch (args.argsLength()) {
|
||||
case 2:
|
||||
// Either a reverse amount or a direction
|
||||
try {
|
||||
reverseChange = args.getInteger(1);
|
||||
dirs.add(we.getDirection(player, "me"));
|
||||
} catch (NumberFormatException e) {
|
||||
if (args.getString(1).contains(",")) {
|
||||
String[] split = args.getString(1).split(",");
|
||||
for (String s : split) {
|
||||
dirs.add(we.getDirection(player, s.toLowerCase()));
|
||||
}
|
||||
} else {
|
||||
dirs.add(we.getDirection(player, args.getString(1).toLowerCase()));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// Both reverse amount and direction
|
||||
reverseChange = args.getInteger(1);
|
||||
if (args.getString(2).contains(",")) {
|
||||
String[] split = args.getString(2).split(",");
|
||||
for (String s : split) {
|
||||
dirs.add(we.getDirection(player, s.toLowerCase()));
|
||||
}
|
||||
} else {
|
||||
dirs.add(we.getDirection(player, args.getString(2).toLowerCase()));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
dirs.add(we.getDirection(player, "me"));
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
Region region = session.getSelection(player.getWorld());
|
||||
int oldSize = region.getArea();
|
||||
|
||||
if (reverseChange == 0) {
|
||||
for (BlockVector3 dir : dirs) {
|
||||
region.expand(dir.multiply(change));
|
||||
}
|
||||
} else {
|
||||
for (BlockVector3 dir : dirs) {
|
||||
region.expand(dir.multiply(change), dir.multiply(-reverseChange));
|
||||
}
|
||||
}
|
||||
|
||||
session.getRegionSelector(player.getWorld()).learnChanges();
|
||||
int newSize = region.getArea();
|
||||
|
||||
session.getRegionSelector(player.getWorld()).explainRegionAdjust(player, session);
|
||||
BBC.SELECTION_EXPAND.send(player, (newSize - oldSize));
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/contract"},
|
||||
usage = "<amount> [reverse-amount] [direction]",
|
||||
desc = "Contract the selection area",
|
||||
min = 1,
|
||||
max = 3
|
||||
name = "/contract",
|
||||
desc = "Contract the selection area"
|
||||
)
|
||||
@Logging(REGION)
|
||||
@CommandPermissions("worldedit.selection.contract")
|
||||
public void contract(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
|
||||
List<BlockVector3> dirs = new ArrayList<>();
|
||||
int change = args.getInteger(0);
|
||||
int reverseChange = 0;
|
||||
|
||||
switch (args.argsLength()) {
|
||||
case 2:
|
||||
// Either a reverse amount or a direction
|
||||
try {
|
||||
reverseChange = args.getInteger(1);
|
||||
dirs.add(we.getDirection(player, "me"));
|
||||
} catch (NumberFormatException e) {
|
||||
if (args.getString(1).contains(",")) {
|
||||
String[] split = args.getString(1).split(",");
|
||||
for (String s : split) {
|
||||
dirs.add(we.getDirection(player, s.toLowerCase()));
|
||||
}
|
||||
} else {
|
||||
dirs.add(we.getDirection(player, args.getString(1).toLowerCase()));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// Both reverse amount and direction
|
||||
reverseChange = args.getInteger(1);
|
||||
if (args.getString(2).contains(",")) {
|
||||
String[] split = args.getString(2).split(",");
|
||||
for (String s : split) {
|
||||
dirs.add(we.getDirection(player, s.toLowerCase()));
|
||||
}
|
||||
} else {
|
||||
dirs.add(we.getDirection(player, args.getString(2).toLowerCase()));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
dirs.add(we.getDirection(player, "me"));
|
||||
break;
|
||||
}
|
||||
|
||||
public void contract(Player player, LocalSession session,
|
||||
@Arg(desc = "Amount to contract the selection by")
|
||||
int amount,
|
||||
@Arg(desc = "Amount to contract the selection by in the other direction", def = "0")
|
||||
int reverseAmount,
|
||||
@Arg(desc = "Direction to contract", def = Direction.AIM)
|
||||
@MultiDirection
|
||||
List<BlockVector3> direction) throws WorldEditException {
|
||||
try {
|
||||
Region region = session.getSelection(player.getWorld());
|
||||
int oldSize = region.getArea();
|
||||
if (reverseChange == 0) {
|
||||
for (BlockVector3 dir : dirs) {
|
||||
region.contract(dir.multiply(change));
|
||||
if (reverseAmount == 0) {
|
||||
for (BlockVector3 dir : direction) {
|
||||
region.contract(dir.multiply(amount));
|
||||
}
|
||||
} else {
|
||||
for (BlockVector3 dir : dirs) {
|
||||
region.contract(dir.multiply(change), dir.multiply(-reverseChange));
|
||||
for (BlockVector3 dir : direction) {
|
||||
region.contract(dir.multiply(amount), dir.multiply(-reverseAmount));
|
||||
}
|
||||
}
|
||||
session.getRegionSelector(player.getWorld()).learnChanges();
|
||||
@ -463,6 +303,7 @@ public class SelectionCommands {
|
||||
|
||||
session.getRegionSelector(player.getWorld()).explainRegionAdjust(player, session);
|
||||
|
||||
|
||||
BBC.SELECTION_CONTRACT.send(player, (oldSize - newSize));
|
||||
} catch (RegionOperationException e) {
|
||||
player.printError(e.getMessage());
|
||||
@ -470,40 +311,28 @@ public class SelectionCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/shift"},
|
||||
usage = "<amount> [direction]",
|
||||
desc = "Shift the selection area",
|
||||
min = 1,
|
||||
max = 2
|
||||
name = "/shift",
|
||||
desc = "Shift the selection area"
|
||||
)
|
||||
@Logging(REGION)
|
||||
@CommandPermissions("worldedit.selection.shift")
|
||||
public void shift(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
|
||||
List<BlockVector3> dirs = new ArrayList<>();
|
||||
int change = args.getInteger(0);
|
||||
if (args.argsLength() == 2) {
|
||||
if (args.getString(1).contains(",")) {
|
||||
for (String s : args.getString(1).split(",")) {
|
||||
dirs.add(we.getDirection(player, s.toLowerCase()));
|
||||
}
|
||||
} else {
|
||||
dirs.add(we.getDirection(player, args.getString(1).toLowerCase()));
|
||||
}
|
||||
} else {
|
||||
dirs.add(we.getDirection(player, "me"));
|
||||
}
|
||||
|
||||
public void shift(Player player, LocalSession session,
|
||||
@Arg(desc = "Amount to shift the selection by")
|
||||
int amount,
|
||||
@Arg(desc = "Direction to contract", def = Direction.AIM)
|
||||
@MultiDirection
|
||||
List<BlockVector3> direction) throws WorldEditException {
|
||||
try {
|
||||
Region region = session.getSelection(player.getWorld());
|
||||
|
||||
for (BlockVector3 dir : dirs) {
|
||||
region.shift(dir.multiply(change));
|
||||
for (BlockVector3 dir : direction) {
|
||||
region.shift(dir.multiply(amount));
|
||||
}
|
||||
|
||||
session.getRegionSelector(player.getWorld()).learnChanges();
|
||||
|
||||
session.getRegionSelector(player.getWorld()).explainRegionAdjust(player, session);
|
||||
|
||||
BBC.SELECTION_SHIFT.send(player);
|
||||
} catch (RegionOperationException e) {
|
||||
player.printError(e.getMessage());
|
||||
@ -511,81 +340,73 @@ public class SelectionCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/outset"},
|
||||
usage = "<amount>",
|
||||
desc = "Outset the selection area",
|
||||
help =
|
||||
"Expands the selection by the given amount in all directions.\n" +
|
||||
"Flags:\n" +
|
||||
" -h only expand horizontally\n" +
|
||||
" -v only expand vertically\n",
|
||||
flags = "hv",
|
||||
min = 1,
|
||||
max = 1
|
||||
name = "/outset",
|
||||
desc = "Outset the selection area"
|
||||
)
|
||||
@Logging(REGION)
|
||||
@CommandPermissions("worldedit.selection.outset")
|
||||
public void outset(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
public void outset(Player player, LocalSession session,
|
||||
@Arg(desc = "Amount to expand the selection by in all directions")
|
||||
int amount,
|
||||
@Switch(name = 'h', desc = "Only expand horizontally")
|
||||
boolean onlyHorizontal,
|
||||
@Switch(name = 'v', desc = "Only expand vertically")
|
||||
boolean onlyVertical) throws WorldEditException {
|
||||
Region region = session.getSelection(player.getWorld());
|
||||
region.expand(getChangesForEachDir(args));
|
||||
region.expand(getChangesForEachDir(amount, onlyHorizontal, onlyVertical));
|
||||
session.getRegionSelector(player.getWorld()).learnChanges();
|
||||
session.getRegionSelector(player.getWorld()).explainRegionAdjust(player, session);
|
||||
BBC.SELECTION_OUTSET.send(player);
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/inset"},
|
||||
usage = "<amount>",
|
||||
desc = "Inset the selection area",
|
||||
help =
|
||||
"Contracts the selection by the given amount in all directions.\n" +
|
||||
"Flags:\n" +
|
||||
" -h only contract horizontally\n" +
|
||||
" -v only contract vertically\n",
|
||||
flags = "hv",
|
||||
min = 1,
|
||||
max = 1
|
||||
name = "/inset",
|
||||
desc = "Inset the selection area"
|
||||
)
|
||||
@Logging(REGION)
|
||||
@CommandPermissions("worldedit.selection.inset")
|
||||
public void inset(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
public void inset(Player player, LocalSession session,
|
||||
@Arg(desc = "Amount to contract the selection by in all directions")
|
||||
int amount,
|
||||
@Switch(name = 'h', desc = "Only contract horizontally")
|
||||
boolean onlyHorizontal,
|
||||
@Switch(name = 'v', desc = "Only contract vertically")
|
||||
boolean onlyVertical) throws WorldEditException {
|
||||
Region region = session.getSelection(player.getWorld());
|
||||
region.contract(getChangesForEachDir(args));
|
||||
region.contract(getChangesForEachDir(amount, onlyHorizontal, onlyVertical));
|
||||
session.getRegionSelector(player.getWorld()).learnChanges();
|
||||
session.getRegionSelector(player.getWorld()).explainRegionAdjust(player, session);
|
||||
BBC.SELECTION_INSET.send(player);
|
||||
}
|
||||
|
||||
private BlockVector3[] getChangesForEachDir(CommandContext args) {
|
||||
List<BlockVector3> changes = new ArrayList<>(6);
|
||||
int change = args.getInteger(0);
|
||||
private BlockVector3[] getChangesForEachDir(int amount, boolean onlyHorizontal, boolean onlyVertical) {
|
||||
Stream.Builder<BlockVector3> changes = Stream.builder();
|
||||
|
||||
if (!args.hasFlag('h')) {
|
||||
changes.add((BlockVector3.at(0, 1, 0)).multiply(change));
|
||||
changes.add((BlockVector3.at(0, -1, 0)).multiply(change));
|
||||
if (!onlyHorizontal) {
|
||||
changes.add(BlockVector3.UNIT_Y);
|
||||
changes.add(BlockVector3.UNIT_MINUS_Y);
|
||||
}
|
||||
|
||||
if (!args.hasFlag('v')) {
|
||||
changes.add((BlockVector3.at(1, 0, 0)).multiply(change));
|
||||
changes.add((BlockVector3.at(-1, 0, 0)).multiply(change));
|
||||
changes.add((BlockVector3.at(0, 0, 1)).multiply(change));
|
||||
changes.add((BlockVector3.at(0, 0, -1)).multiply(change));
|
||||
if (!onlyVertical) {
|
||||
changes.add(BlockVector3.UNIT_X);
|
||||
changes.add(BlockVector3.UNIT_MINUS_X);
|
||||
changes.add(BlockVector3.UNIT_Z);
|
||||
changes.add(BlockVector3.UNIT_MINUS_Z);
|
||||
}
|
||||
|
||||
return changes.toArray(new BlockVector3[0]);
|
||||
return changes.build().map(v -> v.multiply(amount)).toArray(BlockVector3[]::new);
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/size"},
|
||||
flags = "c",
|
||||
usage = "",
|
||||
desc = "Get information about the selection",
|
||||
min = 0,
|
||||
max = 0
|
||||
name = "/size",
|
||||
desc = "Get information about the selection"
|
||||
)
|
||||
@CommandPermissions("worldedit.selection.size")
|
||||
public void size(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||
if (args.hasFlag('c')) {
|
||||
public void size(Player player, LocalSession session,
|
||||
@Switch(name = 'c', desc = "Get clipboard info instead")
|
||||
boolean clipboardInfo) throws WorldEditException {
|
||||
Region region;
|
||||
if (clipboardInfo) {
|
||||
ClipboardHolder root = session.getClipboard();
|
||||
// Clipboard clipboard = holder.getClipboard();
|
||||
int index = 0;
|
||||
@ -603,8 +424,10 @@ public class SelectionCommands {
|
||||
name = Integer.toString(index);
|
||||
}
|
||||
|
||||
Region region = clipboard.getRegion();
|
||||
BlockVector3 size = region.getMaximumPoint().subtract(region.getMinimumPoint()).add(BlockVector3.ONE);
|
||||
region = clipboard.getRegion();
|
||||
BlockVector3 size = region.getMaximumPoint()
|
||||
.subtract(region.getMinimumPoint()).
|
||||
add(1, 1, 1);
|
||||
BlockVector3 origin = clipboard.getOrigin();
|
||||
|
||||
String sizeStr = size.getBlockX() + "*" + size.getBlockY() + "*" + size.getBlockZ();
|
||||
@ -617,30 +440,10 @@ public class SelectionCommands {
|
||||
|
||||
index++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// player.print("Cuboid dimensions (max - min): " + size);
|
||||
// player.print("Offset: " + origin);
|
||||
// player.print("Cuboid distance: " + size.distance(Vector.ONE));
|
||||
// player.print("# of blocks: " + (int) (size.getX() * size.getY() * size.getZ()));
|
||||
//=======
|
||||
// public void size(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||
// if (args.hasFlag('c')) {
|
||||
// ClipboardHolder holder = session.getClipboard();
|
||||
// Clipboard clipboard = holder.getClipboard();
|
||||
// Region region = clipboard.getRegion();
|
||||
// BlockVector3 size = region.getMaximumPoint().subtract(region.getMinimumPoint());
|
||||
// BlockVector3 origin = clipboard.getOrigin();
|
||||
//
|
||||
// player.print("Cuboid dimensions (max - min): " + size);
|
||||
// player.print("Offset: " + origin);
|
||||
// player.print("Cuboid distance: " + size.distance(BlockVector3.ONE));
|
||||
// player.print("# of blocks: " + (int) (size.getX() * size.getY() * size.getZ()));
|
||||
return;
|
||||
}
|
||||
|
||||
Region region = session.getSelection(player.getWorld());
|
||||
region = session.getSelection(player.getWorld());
|
||||
BlockVector3 size = region.getMaximumPoint()
|
||||
.subtract(region.getMinimumPoint())
|
||||
.add(1, 1, 1);
|
||||
@ -660,57 +463,53 @@ public class SelectionCommands {
|
||||
|
||||
|
||||
@Command(
|
||||
aliases = {"/count"},
|
||||
usage = "<mask>",
|
||||
desc = "Counts the number of a certain type of block",
|
||||
flags = "d",
|
||||
min = 1,
|
||||
max = 1
|
||||
name = "/count",
|
||||
desc = "Counts the number of a certain type of block"
|
||||
)
|
||||
@CommandPermissions("worldedit.analysis.count")
|
||||
public void count(Player player, LocalSession session, EditSession editSession, Mask mask) throws WorldEditException {
|
||||
public void count(Player player, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "The mask of blocks to match")
|
||||
Mask mask) throws WorldEditException {
|
||||
int count = editSession.countBlock(session.getSelection(player.getWorld()), mask);
|
||||
BBC.SELECTION_COUNT.send(player, count);
|
||||
player.print("Counted: " + count);
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/distr"},
|
||||
usage = "",
|
||||
desc = "Get the distribution of blocks in the selection",
|
||||
help =
|
||||
"Gets the distribution of blocks in the selection.\n" +
|
||||
"The -c flag gets the distribution of your clipboard.",
|
||||
flags = "c",
|
||||
min = 0,
|
||||
max = 0
|
||||
name = "/distr",
|
||||
desc = "Get the distribution of blocks in the selection"
|
||||
)
|
||||
@CommandPermissions("worldedit.analysis.distr")
|
||||
public void distr(Player player, LocalSession session, EditSession editSession, @Switch('c') boolean useClipboard, @Switch('d') boolean useData) throws WorldEditException, CommandException {
|
||||
int size;
|
||||
List<Countable> distributionData;
|
||||
public void distr(Player player, LocalSession session, EditSession editSession,
|
||||
@Switch(name = 'c', desc = "Get the distribution of the clipboard instead")
|
||||
boolean clipboardDistr,
|
||||
@Switch(name = 'd', desc = "Separate blocks by state")
|
||||
boolean separateStates) throws WorldEditException {
|
||||
List<Countable> distribution;
|
||||
|
||||
Region region;
|
||||
if (useClipboard) {
|
||||
if (clipboardDistr) {
|
||||
// TODO multi clipboard distribution
|
||||
Clipboard clipboard = session.getClipboard().getClipboard();
|
||||
Clipboard clipboard = session.getClipboard().getClipboard(); // throws if missing
|
||||
region = clipboard.getRegion();
|
||||
editSession.setExtent(new AbstractDelegateExtent(clipboard));
|
||||
} else {
|
||||
region = session.getSelection(player.getWorld());
|
||||
}
|
||||
if (useData)
|
||||
distributionData = (List) editSession.getBlockDistributionWithData(region);
|
||||
if (separateStates)
|
||||
distribution = (List) editSession.getBlockDistributionWithData(region);
|
||||
else
|
||||
distributionData = (List) editSession.getBlockDistribution(region);
|
||||
size = session.getSelection(player.getWorld()).getArea();
|
||||
distribution = (List) editSession.getBlockDistribution(region);
|
||||
|
||||
if (distributionData.size() <= 0) {
|
||||
if (distribution.isEmpty()) { // *Should* always be false
|
||||
player.printError("No blocks counted.");
|
||||
return;
|
||||
}
|
||||
|
||||
// note: doing things like region.getArea is inaccurate for non-cuboids.
|
||||
int size = session.getSelection(player.getWorld()).getArea();
|
||||
BBC.SELECTION_DISTR.send(player, size);
|
||||
|
||||
for (Countable c : distributionData) {
|
||||
for (Countable c : distribution) {
|
||||
String name = c.getID().toString();
|
||||
String str = String.format("%-7s (%.3f%%) %s",
|
||||
String.valueOf(c.getAmount()),
|
||||
@ -721,16 +520,17 @@ public class SelectionCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"/sel", ";", "/desel", "/deselect"},
|
||||
flags = "d",
|
||||
usage = "[cuboid|extend|poly|polyhedron|ellipsoid|sphere|cyl|convex|fuzzy]",
|
||||
desc = "Choose a region selector",
|
||||
min = 0,
|
||||
max = 1
|
||||
name = "/sel",
|
||||
aliases = { ";", "/desel", "/deselect" },
|
||||
desc = "Choose a region selector"
|
||||
)
|
||||
public void select(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||
public void select(Player player, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "Selector to switch to", def = "")
|
||||
SelectorChoice selector,
|
||||
@Switch(name = 'd', desc = "Set default selector")
|
||||
boolean setDefaultSelector) throws WorldEditException {
|
||||
final World world = player.getWorld();
|
||||
if (args.argsLength() == 0) {
|
||||
if (selector == null) {
|
||||
session.getRegionSelector(world).clear();
|
||||
session.dispatchCUISelection(player);
|
||||
BBC.SELECTION_CLEARED.send(player);
|
||||
@ -740,79 +540,93 @@ public class SelectionCommands {
|
||||
final String typeName = args.getString(0);
|
||||
final RegionSelector oldSelector = session.getRegionSelector(world);
|
||||
|
||||
final RegionSelector selector;
|
||||
if (typeName.equalsIgnoreCase("cuboid")) {
|
||||
selector = new CuboidRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_CUBOID.s());
|
||||
} else if (typeName.equalsIgnoreCase("extend")) {
|
||||
selector = new ExtendingCuboidRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_CUBOID_EXTEND.s());
|
||||
} else if (typeName.equalsIgnoreCase("poly")) {
|
||||
selector = new Polygonal2DRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_2D_POLYGON.s());
|
||||
Optional<Integer> limit = ActorSelectorLimits.forActor(player).getPolygonVertexLimit();
|
||||
limit.ifPresent(integer -> player.print(BBC.SEL_MAX.f(integer)));
|
||||
player.print(BBC.SEL_LIST.s());
|
||||
} else if (typeName.equalsIgnoreCase("ellipsoid")) {
|
||||
selector = new EllipsoidRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_ELLIPSIOD.s());
|
||||
} else if (typeName.equalsIgnoreCase("sphere")) {
|
||||
selector = new SphereRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_SPHERE.s());
|
||||
} else if (typeName.equalsIgnoreCase("cyl")) {
|
||||
selector = new CylinderRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_CYLINDRICAL.s());
|
||||
} else if (typeName.equalsIgnoreCase("convex") || typeName.equalsIgnoreCase("hull")) {
|
||||
selector = new ConvexPolyhedralRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_CONVEX_POLYHEDRAL.s());
|
||||
Optional<Integer> limit = ActorSelectorLimits.forActor(player).getPolyhedronVertexLimit();
|
||||
limit.ifPresent(integer -> player.print(BBC.SEL_MAX.f(integer)));
|
||||
player.print(BBC.SEL_LIST.s());
|
||||
} else if (typeName.equalsIgnoreCase("polyhedral") || typeName.equalsIgnoreCase("polyhedron")) {
|
||||
selector = new PolyhedralRegionSelector(player.getWorld());
|
||||
player.print(BBC.SEL_CONVEX_POLYHEDRAL.s());
|
||||
Optional<Integer> limit = ActorSelectorLimits.forActor(player).getPolyhedronVertexLimit();
|
||||
limit.ifPresent(integer -> player.print(BBC.SEL_MAX.f(integer)));
|
||||
player.print(BBC.SEL_LIST.s());
|
||||
} else if (typeName.startsWith("fuzzy") || typeName.startsWith("magic")) {
|
||||
Mask mask;
|
||||
if (typeName.length() > 6) {
|
||||
ParserContext parserContext = new ParserContext();
|
||||
parserContext.setActor(player);
|
||||
parserContext.setWorld(player.getWorld());
|
||||
parserContext.setSession(session);
|
||||
parserContext.setExtent(editSession);
|
||||
mask = we.getMaskFactory().parseFromInput(typeName.substring(6), parserContext);
|
||||
} else {
|
||||
mask = new IdMask(editSession);
|
||||
final RegionSelector newSelector;
|
||||
switch (selector) {
|
||||
case CUBOID:
|
||||
newSelector = new CuboidRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_CUBOID.s());
|
||||
break;
|
||||
case EXTEND:
|
||||
newSelector = new ExtendingCuboidRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_CUBOID_EXTEND.s());
|
||||
break;
|
||||
case POLY: {
|
||||
newSelector = new Polygonal2DRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_2D_POLYGON.s());
|
||||
Optional<Integer> limit = ActorSelectorLimits.forActor(player).getPolygonVertexLimit();
|
||||
limit.ifPresent(integer -> player.print(BBC.SEL_MAX.f(integer)));
|
||||
break;
|
||||
}
|
||||
selector = new FuzzyRegionSelector(player, editSession, mask);
|
||||
player.print(BBC.SEL_FUZZY.f());
|
||||
player.print(BBC.SEL_LIST.f());
|
||||
} else {
|
||||
CommandListBox box = new CommandListBox("Selection modes");
|
||||
StyledFragment contents = box.getContents();
|
||||
StyledFragment tip = contents.createFragment(Style.RED);
|
||||
tip.append(BBC.SEL_MODES.s()).newLine();
|
||||
case ELLIPSOID:
|
||||
newSelector = new EllipsoidRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_ELLIPSIOD.s());
|
||||
break;
|
||||
case SPHERE:
|
||||
newSelector = new SphereRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_SPHERE.s());
|
||||
break;
|
||||
case CYL:
|
||||
newSelector = new CylinderRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_CYLINDRICAL.s());
|
||||
break;
|
||||
case CONVEX:
|
||||
case HULL:
|
||||
case POLYHEDRON: {
|
||||
newSelector = new ConvexPolyhedralRegionSelector(oldSelector);
|
||||
player.print(BBC.SEL_CONVEX_POLYHEDRAL.s());
|
||||
Optional<Integer> limit = ActorSelectorLimits.forActor(player).getPolyhedronVertexLimit();
|
||||
limit.ifPresent(integer -> player.print(BBC.SEL_MAX.f(integer)));
|
||||
break;
|
||||
}
|
||||
case POLYHEDRAL:
|
||||
newSelector = new PolyhedralRegionSelector(player.getWorld());
|
||||
player.print(BBC.SEL_CONVEX_POLYHEDRAL.s());
|
||||
Optional<Integer> limit = ActorSelectorLimits.forActor(player).getPolyhedronVertexLimit();
|
||||
limit.ifPresent(integer -> player.print(BBC.SEL_MAX.f(integer)));
|
||||
player.print(BBC.SEL_LIST.s());
|
||||
break;
|
||||
case FUZZY:
|
||||
case MAGIC:
|
||||
Mask mask;
|
||||
if (typeName.length() > 6) {
|
||||
ParserContext parserContext = new ParserContext();
|
||||
parserContext.setActor(player);
|
||||
parserContext.setWorld(player.getWorld());
|
||||
parserContext.setSession(session);
|
||||
parserContext.setExtent(editSession);
|
||||
mask = we.getMaskFactory().parseFromInput(typeName.substring(6), parserContext);
|
||||
} else {
|
||||
mask = new IdMask(world);
|
||||
}
|
||||
newSelector = new FuzzyRegionSelector(player, editSession, mask);
|
||||
player.print(BBC.SEL_FUZZY.f());
|
||||
player.print(BBC.SEL_LIST.f());
|
||||
break;
|
||||
case LIST:
|
||||
default:
|
||||
CommandListBox box = new CommandListBox("Selection modes", null);
|
||||
box.setHidingHelp(true);
|
||||
TextComponentProducer contents = box.getContents();
|
||||
contents.append(SubtleFormat.wrap("Select one of the modes below:")).newline();
|
||||
|
||||
box.appendCommand("//sel cuboid", "Select two corners of a cuboid");
|
||||
box.appendCommand("//sel extend", "Fast cuboid selection mode");
|
||||
box.appendCommand("//sel poly", "Select a 2D polygon with height");
|
||||
box.appendCommand("//sel ellipsoid", "Select an ellipsoid");
|
||||
box.appendCommand("//sel sphere", "Select a sphere");
|
||||
box.appendCommand("//sel cyl", "Select a cylinder");
|
||||
box.appendCommand("//sel convex", "Select a convex polyhedral");
|
||||
box.appendCommand("//sel polyhedral", "Select a hollow polyhedral");
|
||||
box.appendCommand("//sel fuzzy[=<mask>]", "Select all connected blocks (magic wand)");
|
||||
box.appendCommand("cuboid", "Select two corners of a cuboid", "//sel cuboid");
|
||||
box.appendCommand("extend", "Fast cuboid selection mode", "//sel extend");
|
||||
box.appendCommand("poly", "Select a 2D polygon with height", "//sel poly");
|
||||
box.appendCommand("ellipsoid", "Select an ellipsoid", "//sel ellipsoid");
|
||||
box.appendCommand("sphere", "Select a sphere", "//sel sphere");
|
||||
box.appendCommand("cyl", "Select a cylinder", "//sel cyl");
|
||||
box.appendCommand("convex", "Select a convex polyhedral", "//sel convex");
|
||||
box.appendCommand("polyhedral", "Select a hollow polyhedral", "//sel polyhedral");
|
||||
box.appendCommand("fuzzy[=<mask>]", "Select all connected blocks (magic wand)", "//sel fuzzy[=<mask>]");
|
||||
|
||||
player.printRaw(ColorCodeBuilder.asColorCodes(box));
|
||||
return;
|
||||
player.print(box.create(1));
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.hasFlag('d')) {
|
||||
if (setDefaultSelector) {
|
||||
RegionSelectorType found = null;
|
||||
for (RegionSelectorType type : RegionSelectorType.values()) {
|
||||
if (type.getSelectorClass() == selector.getClass()) {
|
||||
if (type.getSelectorClass() == newSelector.getClass()) {
|
||||
found = type;
|
||||
break;
|
||||
}
|
||||
@ -826,9 +640,8 @@ public class SelectionCommands {
|
||||
}
|
||||
}
|
||||
|
||||
session.setRegionSelector(world, selector);
|
||||
session.setRegionSelector(world, newSelector);
|
||||
session.dispatchCUISelection(player);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user