From 17c3f0c6c016e76d93801654126f9d80f388ef0e Mon Sep 17 00:00:00 2001 From: Taah Date: Sat, 5 Mar 2022 17:25:34 -0800 Subject: [PATCH] Add example command --- src/main/java/dev/plex/ExampleModule.java | 3 ++- .../java/dev/plex/command/ExampleCommand.java | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/main/java/dev/plex/command/ExampleCommand.java diff --git a/src/main/java/dev/plex/ExampleModule.java b/src/main/java/dev/plex/ExampleModule.java index 724601b..09c8466 100644 --- a/src/main/java/dev/plex/ExampleModule.java +++ b/src/main/java/dev/plex/ExampleModule.java @@ -1,12 +1,13 @@ package dev.plex; +import dev.plex.command.ExampleCommand; import dev.plex.module.PlexModule; public class ExampleModule extends PlexModule { @Override public void enable() { - getLogger().info("Test"); + registerCommand(new ExampleCommand()); } @Override diff --git a/src/main/java/dev/plex/command/ExampleCommand.java b/src/main/java/dev/plex/command/ExampleCommand.java new file mode 100644 index 0000000..bd40830 --- /dev/null +++ b/src/main/java/dev/plex/command/ExampleCommand.java @@ -0,0 +1,19 @@ +package dev.plex.command; + +import dev.plex.command.annotation.CommandParameters; +import dev.plex.command.annotation.CommandPermissions; +import net.kyori.adventure.text.Component; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@CommandParameters(name = "examplemodule") +@CommandPermissions +public class ExampleCommand extends PlexCommand +{ + @Override + protected Component execute(@NotNull CommandSender commandSender, @Nullable Player player, @NotNull String[] strings) { + return Component.text("Example module command"); + } +}