use of ivorius.reccomplex.commands.parameters.RCParameters in project RecurrentComplex by Ivorforce.
the class CommandVisitFiles method execute.
@Override
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException {
RCParameters parameters = RCParameters.of(args);
ResourceDirectory directory = parameters.rc("dir").resourceDirectory().optional().orElse(ResourceDirectory.ACTIVE);
OpenGlHelper.openFile(directory.toFile());
}
use of ivorius.reccomplex.commands.parameters.RCParameters in project RecurrentComplex by Ivorforce.
the class CommandAs method execute.
@Override
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException {
RCParameters parameters = RCParameters.of(args);
Entity entity = parameters.mc().entity(server, commandSender).require();
String command = buildString(args, 1);
server.commandManager.executeCommand(entity, command);
}
use of ivorius.reccomplex.commands.parameters.RCParameters in project RecurrentComplex by Ivorforce.
the class CommandEval method execute.
@Override
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException {
RCParameters parameters = RCParameters.of(args);
DependencyExpression matcher = parameters.rc().expression(new DependencyExpression()).require();
boolean result = matcher.test(RecurrentComplex.saver);
commandSender.sendMessage(ServerTranslations.get(result ? "commands.rceval.result.true" : "commands.rceval.result.false"));
}
use of ivorius.reccomplex.commands.parameters.RCParameters in project RecurrentComplex by Ivorforce.
the class CommandSelecting method execute.
@Override
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException {
RCParameters parameters = RCParameters.of(args);
BlockPos p1 = parameters.mc().pos(commandSender.getPosition(), false).require();
BlockPos p2 = parameters.mc().move(3).pos(commandSender.getPosition(), false).require();
String command = parameters.get().move(6).text().optional().orElse("");
server.commandManager.executeCommand(new SelectingSender(commandSender, p1, p2), command);
}
use of ivorius.reccomplex.commands.parameters.RCParameters in project RecurrentComplex by Ivorforce.
the class CommandContaining method execute.
@Override
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException {
RCParameters parameters = RCParameters.of(args);
BlockExpression matcher = parameters.rc().expression(new BlockExpression(RecurrentComplex.specialRegistry)).require();
CommandSearchStructure.postResultMessage(commandSender, RCTextStyle::structure, CommandSearchStructure.search(StructureRegistry.INSTANCE.ids(), name -> containedBlocks(StructureRegistry.INSTANCE.get(name), matcher)));
}
Aggregations