diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-05-28 22:41:38 +0700 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-05-28 22:41:38 +0700 |
commit | 688869d1a5d60b8bdd89c78e0deab6b53b04a694 (patch) | |
tree | 079620c9471115b88c046046d6db4f5f567a9425 /src/main/java/cc/polyfrost/oneconfig/test/TestCommand.java | |
parent | fe58fa4924522e24ff32d2a4abb2ae959252d553 (diff) | |
download | OneConfig-688869d1a5d60b8bdd89c78e0deab6b53b04a694.tar.gz OneConfig-688869d1a5d60b8bdd89c78e0deab6b53b04a694.tar.bz2 OneConfig-688869d1a5d60b8bdd89c78e0deab6b53b04a694.zip |
command utils
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/test/TestCommand.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/test/TestCommand.java | 39 |
1 files changed, 39 insertions, 0 deletions
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..753c353 --- /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.libs.universal.UChat; +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; + +@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 <a> <b> <c> + 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 <a> <b> <c> + 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 <a> <b> <c> + UChat.chat(a + " " + b + " " + c); + } + } + } +} |