use of io.github.wysohn.triggerreactor.sponge.bridge.SpongeCommandSender in project TriggerReactor by wysohn.
the class TriggerReactor method onInitialize.
@Listener
public void onInitialize(GameAboutToStartServerEvent e) {
Sponge.getCommandManager().register(this, new CommandCallable() {
@Override
public CommandResult process(CommandSource src, String args) throws CommandException {
if (src instanceof Player) {
onCommand(new SpongePlayer((Player) src), "triggerreactor", args.split(" "));
} else {
onCommand(new SpongeCommandSender(src), "triggerreactor", args.split(" "));
}
return CommandResult.success();
}
@Override
public List<String> getSuggestions(CommandSource source, String arguments, Location<World> targetPosition) throws CommandException {
// return io.github.wysohn.triggerreactor.core.main.TriggerReactor.onTabComplete(arguments.split(" "));
return new ArrayList<>();
}
@Override
public boolean testPermission(CommandSource source) {
return source.hasPermission("triggerreactor.admin");
}
@Override
public Optional<Text> getShortDescription(CommandSource source) {
return Optional.of(Text.of("TriggerReactor"));
}
@Override
public Optional<Text> getHelp(CommandSource source) {
return Optional.of(Text.of("/trg for details"));
}
@Override
public Text getUsage(CommandSource source) {
return Text.of("/trg for details");
}
}, "trg", "trigger");
migrateOldConfig();
}
Aggregations