From e3d4fa610221daa2e63ebe00f7b55ed2e6cd1b45 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sun, 6 Mar 2022 00:39:02 -0600 Subject: [PATCH] Add more detail to annotations --- src/main/java/dev/plex/ExampleModule.java | 7 ++++--- src/main/java/dev/plex/command/ExampleCommand.java | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/dev/plex/ExampleModule.java b/src/main/java/dev/plex/ExampleModule.java index 09c8466..9ddaee2 100644 --- a/src/main/java/dev/plex/ExampleModule.java +++ b/src/main/java/dev/plex/ExampleModule.java @@ -6,12 +6,13 @@ import dev.plex.module.PlexModule; public class ExampleModule extends PlexModule { @Override - public void enable() { + public void enable() + { registerCommand(new ExampleCommand()); } @Override - public void disable() { - + public void disable() + { } } diff --git a/src/main/java/dev/plex/command/ExampleCommand.java b/src/main/java/dev/plex/command/ExampleCommand.java index bd40830..e08610f 100644 --- a/src/main/java/dev/plex/command/ExampleCommand.java +++ b/src/main/java/dev/plex/command/ExampleCommand.java @@ -2,18 +2,20 @@ package dev.plex.command; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; +import dev.plex.rank.enums.Rank; 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 +@CommandParameters(name = "examplemodule", description = "An example command provided by Plex's example module") +@CommandPermissions(level = Rank.OP, permission = "plex.module.command") public class ExampleCommand extends PlexCommand { @Override - protected Component execute(@NotNull CommandSender commandSender, @Nullable Player player, @NotNull String[] strings) { + protected Component execute(@NotNull CommandSender commandSender, @Nullable Player player, @NotNull String[] strings) + { return Component.text("Example module command"); } }