mirror of
https://github.com/aikar/commands.git
synced 2026-06-09 01:47:36 +00:00
Removed wrong dependency injection note, added hint for dependency injections
+2
-1
@@ -36,7 +36,8 @@ First you need to create a class that extends `BaseCommand`, then register that
|
||||
manager.registerCommand(new MyCommand());
|
||||
```
|
||||
|
||||
If you need your plugin instance, pass it to your commands constructor like so (this is called dependency injection if you are not aware)
|
||||
If you need your plugin instance, pass it to your commands constructor like so.
|
||||
Take note that there is another possibility to use objects in your command class with [dependency injections](https://github.com/aikar/commands/wiki/Dependency-Injection).
|
||||
|
||||
```java
|
||||
manager.registerCommand(new MyCommand(myPlugin));
|
||||
|
||||
Reference in New Issue
Block a user