use of com.fastasyncworldedit.core.command.tool.scroll.Scroll in project FastAsyncWorldEdit by IntellectualSites.
the class ToolUtilCommands method scroll.
@Command(name = "scroll", desc = "Toggle between different target modes")
@CommandPermissions("worldedit.brush.scroll")
public void scroll(Player player, EditSession editSession, LocalSession session, @Switch(name = 'h', desc = "Whether the offhand should be considered or not") boolean offHand, @Arg(desc = "Target Modes", def = "none") Scroll.Action mode, @Arg(desc = "The scroll action", variable = true) List<String> commandStr) throws WorldEditException {
BrushTool bt = session.getBrushTool(player, false);
if (bt == null) {
player.print(Caption.of("fawe.worldedit.brush.brush.none"));
return;
}
BrushSettings settings = offHand ? bt.getOffHand() : bt.getContext();
Scroll action = Scroll.fromArguments(bt, player, session, mode, commandStr, true);
settings.setScrollAction(action);
if (mode == Scroll.Action.NONE) {
player.print(Caption.of("fawe.worldedit.brush.brush.scroll.action.unset"));
} else if (action != null) {
String full = (mode.name().toLowerCase(Locale.ROOT) + " " + StringMan.join(commandStr, " ")).trim();
settings.addSetting(BrushSettings.SettingType.SCROLL_ACTION, full);
player.print(Caption.of("fawe.worldedit.brush.brush.scroll.action.set", mode));
}
bt.update();
}
use of com.fastasyncworldedit.core.command.tool.scroll.Scroll in project FastAsyncWorldEdit by IntellectualSites.
the class BrushTool method increment.
@Override
public boolean increment(Player player, int amount) {
BrushSettings current = getContext();
Scroll tmp = current.getScrollAction();
if (tmp != null) {
tmp.setTool(this);
return tmp.increment(player, amount);
}
return false;
}
Aggregations