use of com.fastasyncworldedit.core.command.tool.TargetMode in project FastAsyncWorldEdit by IntellectualSites.
the class ScrollTarget method increment.
@Override
public boolean increment(Player player, int amount) {
TargetMode mode = getTool().getTargetMode();
int index = mode.ordinal() + amount;
TargetMode[] modes = TargetMode.values();
TargetMode newMode = modes[MathMan.wrap(index, 0, modes.length - 1)];
getTool().setTargetMode(newMode);
return true;
}
use of com.fastasyncworldedit.core.command.tool.TargetMode in project FastAsyncWorldEdit by IntellectualSites.
the class ToolUtilCommands method target.
@Command(name = "target", aliases = { "tar", "/target", "/tar" }, desc = "Toggle between different target modes")
@CommandPermissions("worldedit.brush.target")
public void target(Player player, LocalSession session, @Arg(name = "mode", desc = "int", def = "0") int mode) throws WorldEditException {
BrushTool tool = session.getBrushTool(player, false);
if (tool == null) {
player.print(Caption.of("fawe.worldedit.brush.brush.none"));
return;
}
TargetMode[] modes = TargetMode.values();
TargetMode newMode = modes[MathMan.wrap(mode, 0, modes.length - 1)];
tool.setTargetMode(newMode);
player.print(Caption.of("fawe.worldedit.brush.brush.target.mode.set", newMode));
}
Aggregations