From 44dfbbb419f1736530c04c02a651f7757cf83f3d Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Sun, 5 Jun 2022 15:27:36 +0700 Subject: rewrite command manager, stop using essential relocate, and reformat code (#34) * reformat code * reformat code rewrite command manager stop using essential relocate --- .../cc/polyfrost/oneconfig/test/TestCommand.java | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/main/java/cc/polyfrost/oneconfig/test/TestCommand.java (limited to 'src/main/java/cc/polyfrost/oneconfig/test/TestCommand.java') diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestCommand.java b/src/main/java/cc/polyfrost/oneconfig/test/TestCommand.java new file mode 100644 index 0000000..b757c73 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestCommand.java @@ -0,0 +1,39 @@ +package cc.polyfrost.oneconfig.test; + +import cc.polyfrost.oneconfig.utils.commands.annotations.Command; +import cc.polyfrost.oneconfig.utils.commands.annotations.Main; +import cc.polyfrost.oneconfig.utils.commands.annotations.Name; +import cc.polyfrost.oneconfig.utils.commands.annotations.SubCommand; +import gg.essential.universal.UChat; + +@Command(value = "test", aliases = {"t"}) +public class TestCommand { + + @Main + private static void main() { // /test + UChat.chat("Main command"); + } + + @SubCommand(value = "subcommand", aliases = {"s"}) + private static class TestSubCommand { + + @Main(priority = 999) + private static void main(int a, float b, @Name("named c") String c) { // /test subcommand + UChat.chat("Integer main: " + a + " " + b + " " + c); + } + + @Main(priority = 10001) + private static void main(double a, double b, @Name("named c") String c) { // /test subcommand + UChat.chat("Double main: " + a + " " + b + " " + c); + } + + @SubCommand(value = "subsubcommand", aliases = {"ss"}) + private static class TestSubSubCommand { + + @Main + private static void main(String a, String b, @Name("named c") String c) { // /test subcommand subsubcommand + UChat.chat(a + " " + b + " " + c); + } + } + } +} -- cgit