Search in sources :

Example 1 with SkinCommand

use of skinsrestorer.sponge.commands.SkinCommand in project SkinsRestorerX by DoNotSpamPls.

the class SkinsRestorer method onInitialize.

@Listener
public void onInitialize(GameInitializationEvent e) {
    instance = this;
    directory = Sponge.getGame().getConfigManager().getPluginConfig(this).getDirectory().toString();
    try {
        reloadConfigs();
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    if (!Sponge.getServer().getOnlineMode())
        Sponge.getEventManager().registerListener(this, ClientConnectionEvent.Login.class, new LoginListener());
    CommandSpec skinCommand = CommandSpec.builder().description(Text.of("Set your skin")).arguments(GenericArguments.onlyOne(GenericArguments.string(Text.of("skin")))).executor(new SkinCommand()).build();
    Sponge.getCommandManager().register(this, skinCommand, "skin");
}
Also used : LoginListener(skinsrestorer.sponge.listeners.LoginListener) CommandSpec(org.spongepowered.api.command.spec.CommandSpec) SkinCommand(skinsrestorer.sponge.commands.SkinCommand) LoginListener(skinsrestorer.sponge.listeners.LoginListener) Listener(org.spongepowered.api.event.Listener)

Aggregations

CommandSpec (org.spongepowered.api.command.spec.CommandSpec)1 Listener (org.spongepowered.api.event.Listener)1 SkinCommand (skinsrestorer.sponge.commands.SkinCommand)1 LoginListener (skinsrestorer.sponge.listeners.LoginListener)1