Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tech.elitebyte.helloplugin;
- import com.google.inject.Inject;
- import org.spongepowered.api.Game;
- import org.spongepowered.api.Sponge;
- import org.spongepowered.api.command.spec.CommandSpec;
- import org.spongepowered.api.event.Listener;
- import org.spongepowered.api.event.game.state.GameStartedServerEvent;
- import org.spongepowered.api.plugin.Plugin;
- import org.spongepowered.api.text.Text;
- import tech.elitebyte.helloplugin.commands.HelloWorldCommand;
- import tech.elitebyte.helloplugin.commands.SmiteCommand;
- @Plugin(id = "exampleplugin", name = "Example Plugin",
- version = "1.0", description = "Temporary description of plugin")
- public class HelloPlugin {
- @Inject
- public Game game;
- @Listener
- public void onServerStart(GameStartedServerEvent event) {
- // Hey! The server has started!
- // Try instantiating your logger in here.
- // (There's a guide for that)
- CommandSpec helloworldCommand = CommandSpec.builder()
- .description(Text.of("Hello World Command!"))
- .executor(new HelloWorldCommand(game))
- .build();
- CommandSpec smiteCommand = CommandSpec.builder()
- .description(Text.of("Smite Command"))
- .executor(new SmiteCommand(game))
- .build();
- Sponge.getCommandManager().register(this, smiteCommand, "smite");
- Sponge.getCommandManager().register(this, helloworldCommand, "helloworld");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement