Search in sources :

Example 21 with RCParameters

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());
}
Also used : RCParameters(ivorius.reccomplex.commands.parameters.RCParameters) ResourceDirectory(ivorius.reccomplex.files.loading.ResourceDirectory)

Example 22 with RCParameters

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);
}
Also used : RCParameters(ivorius.reccomplex.commands.parameters.RCParameters) Entity(net.minecraft.entity.Entity)

Example 23 with RCParameters

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"));
}
Also used : RCParameters(ivorius.reccomplex.commands.parameters.RCParameters) DependencyExpression(ivorius.reccomplex.utils.expression.DependencyExpression)

Example 24 with RCParameters

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);
}
Also used : RCParameters(ivorius.reccomplex.commands.parameters.RCParameters) BlockPos(net.minecraft.util.math.BlockPos)

Example 25 with RCParameters

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)));
}
Also used : RCParameters(ivorius.reccomplex.commands.parameters.RCParameters) IvBlockCollection(ivorius.ivtoolkit.blocks.IvBlockCollection) BlockExpression(ivorius.reccomplex.utils.expression.BlockExpression) Structure(ivorius.reccomplex.world.gen.feature.structure.Structure) StructureRegistry(ivorius.reccomplex.world.gen.feature.structure.StructureRegistry) ServerTranslations(ivorius.reccomplex.utils.ServerTranslations) CommandBase(net.minecraft.command.CommandBase) BlockPos(net.minecraft.util.math.BlockPos) RCTextStyle(ivorius.reccomplex.commands.RCTextStyle) RCConfig(ivorius.reccomplex.RCConfig) RCExpect(ivorius.reccomplex.commands.parameters.RCExpect) CommandException(net.minecraft.command.CommandException) MinecraftServer(net.minecraft.server.MinecraftServer) List(java.util.List) ICommandSender(net.minecraft.command.ICommandSender) RecurrentComplex(ivorius.reccomplex.RecurrentComplex) RCParameters(ivorius.reccomplex.commands.parameters.RCParameters) Nullable(javax.annotation.Nullable) RCTextStyle(ivorius.reccomplex.commands.RCTextStyle) BlockExpression(ivorius.reccomplex.utils.expression.BlockExpression)

Aggregations

RCParameters (ivorius.reccomplex.commands.parameters.RCParameters)39 BlockPos (net.minecraft.util.math.BlockPos)17 SelectionOwner (ivorius.reccomplex.capability.SelectionOwner)14 GenericStructure (ivorius.reccomplex.world.gen.feature.structure.generic.GenericStructure)11 RCConfig (ivorius.reccomplex.RCConfig)8 RCExpect (ivorius.reccomplex.commands.parameters.RCExpect)8 ServerTranslations (ivorius.reccomplex.utils.ServerTranslations)8 Nullable (javax.annotation.Nullable)8 CommandException (net.minecraft.command.CommandException)8 ICommandSender (net.minecraft.command.ICommandSender)8 MinecraftServer (net.minecraft.server.MinecraftServer)8 BlockArea (ivorius.ivtoolkit.blocks.BlockArea)7 RecurrentComplex (ivorius.reccomplex.RecurrentComplex)7 ResourceDirectory (ivorius.reccomplex.files.loading.ResourceDirectory)7 List (java.util.List)7 WorldServer (net.minecraft.world.WorldServer)7 AxisAlignedTransform2D (ivorius.ivtoolkit.math.AxisAlignedTransform2D)6 MockWorld (ivorius.ivtoolkit.world.MockWorld)6 CommandVirtual (ivorius.reccomplex.commands.CommandVirtual)6 RCCommands (ivorius.reccomplex.commands.RCCommands)6