Search in sources :

Example 6 with NaP

use of ivorius.mcopts.commands.parameters.NaP in project RecurrentComplex by Ivorforce.

the class CommandEval method execute.

@Override
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException {
    Parameters parameters = Parameters.of(args, expect()::declare);
    DependencyExpression matcher = parameters.get(0).rest(NaP::join).to(RCP::expression, new DependencyExpression()).require();
    boolean result = matcher.test(RecurrentComplex.saver);
    commandSender.sendMessage(RecurrentComplex.translations.get(result ? "commands.rceval.result.true" : "commands.rceval.result.false"));
}
Also used : Parameters(ivorius.mcopts.commands.parameters.Parameters) DependencyExpression(ivorius.reccomplex.utils.expression.DependencyExpression) NaP(ivorius.mcopts.commands.parameters.NaP)

Aggregations

NaP (ivorius.mcopts.commands.parameters.NaP)6 Parameters (ivorius.mcopts.commands.parameters.Parameters)6 CommandExpecting (ivorius.mcopts.commands.CommandExpecting)4 Expect (ivorius.mcopts.commands.parameters.expect.Expect)4 RCConfig (ivorius.reccomplex.RCConfig)4 RecurrentComplex (ivorius.reccomplex.RecurrentComplex)4 RCCommands (ivorius.reccomplex.commands.RCCommands)4 RCP (ivorius.reccomplex.commands.parameters.RCP)4 RCE (ivorius.reccomplex.commands.parameters.expect.RCE)4 CommandException (net.minecraft.command.CommandException)4 ICommandSender (net.minecraft.command.ICommandSender)4 LeveledRegistry (ivorius.reccomplex.files.loading.LeveledRegistry)3 ResourceDirectory (ivorius.reccomplex.files.loading.ResourceDirectory)3 RawResourceLocation (ivorius.reccomplex.utils.RawResourceLocation)3 ResourceExpression (ivorius.reccomplex.utils.expression.ResourceExpression)3 MinecraftServer (net.minecraft.server.MinecraftServer)3 BlockPos (net.minecraft.util.math.BlockPos)3 BlockArea (ivorius.ivtoolkit.blocks.BlockArea)2 IvWorldData (ivorius.ivtoolkit.tools.IvWorldData)2 MockWorld (ivorius.ivtoolkit.world.MockWorld)2