Only set executor when the command is executable

This commit is contained in:
Alexander Söderberg 2020-09-15 17:51:09 +02:00
parent c88b267758
commit f5e230945d
No known key found for this signature in database
GPG key ID: C0207FF7EA146678
2 changed files with 18 additions and 4 deletions

View file

@ -25,7 +25,10 @@ package com.intellectualsites.commands;
import com.intellectualsites.commands.components.StaticComponent;
import com.intellectualsites.commands.components.parser.ComponentParseResult;
import com.intellectualsites.commands.components.standard.BooleanComponent;
import com.intellectualsites.commands.components.standard.DoubleComponent;
import com.intellectualsites.commands.components.standard.EnumComponent;
import com.intellectualsites.commands.components.standard.FloatComponent;
import com.intellectualsites.commands.components.standard.IntegerComponent;
import com.intellectualsites.commands.components.standard.StringComponent;
import com.intellectualsites.commands.execution.CommandExecutionCoordinator;
@ -136,6 +139,13 @@ public final class BukkitTest extends JavaPlugin {
c.getSender().asPlayer().teleport(world.getSpawnLocation());
c.getSender().sendMessage("Teleported.");
})
.build())
.command(mgr.commandBuilder("brigadier")
.component(FloatComponent.required("float"))
.component(DoubleComponent.required("double"))
.component(IntegerComponent.required("int"))
.component(BooleanComponent.required("bool"))
.component(StringComponent.required("string"))
.build());
} catch (final Exception e) {
e.printStackTrace();