File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/main/java/com/github/thiagotgm/modular_commands/api Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 30
30
import org .slf4j .Logger ;
31
31
import org .slf4j .LoggerFactory ;
32
32
33
+ import com .github .thiagotgm .modular_commands .command .annotation .AnnotationParser ;
33
34
import com .github .thiagotgm .modular_commands .registry .ClientCommandRegistry ;
34
35
import com .github .thiagotgm .modular_commands .registry .ModuleCommandRegistry ;
35
36
@@ -595,6 +596,19 @@ public void registerAllCommands( CommandRegistry registry ) {
595
596
596
597
}
597
598
599
+ /**
600
+ * Parses the annotated commands from the given object and registers the parsed main
601
+ * commands into this registry.
602
+ *
603
+ * @param obj The object to parse commands from.
604
+ */
605
+ public void registerAnnotatedCommands ( Object obj ) {
606
+
607
+ AnnotationParser parser = new AnnotationParser ( obj );
608
+ registerAllCommands ( parser .parse () ); // Parse an add all commands.
609
+
610
+ }
611
+
598
612
/**
599
613
* Unregisters a command from this registry.
600
614
*
You can’t perform that action at this time.
0 commit comments