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");
}
Aggregations