-
Notifications
You must be signed in to change notification settings - Fork 0
Delegate class
ancap-kun edited this page Feb 20, 2023
·
2 revisions
Delegate is, as the name implies, a command statement that will, depending on the subcommand, pass processing somewhere.
This is roughly how you can add subcommands to your command:
public class FooExecutor extends CommandTarget {
public FooExecutor() {
super(new Delegate(
new SubCommand(
new StringDelegatePattern( /* main argument */ "foo", /* aliases */ "foo1", "foo2"),
new Delegate( /* code */)
),
new SubCommand(
new StringDelegatePattern("bar", "baz"),
new Arguments(/* code */)
),
new SubCommand(
new StringDelegatePattern("ochko",)
new Advice(/* code */)
),
));
}
}-
Создание плагина
- Создание main-класса
- Настройка ancapplugin.yml
- Использование AncapPluginAPI
- Использование LanguageAPI
- Использование CommunicatorAPI
- Использование ConfigurationAPI
- Использование CommandAPI
- Использование DatabaseAPI
- Использование EventAPI
- Использование MaterialAPI
- Использование WorldIteratorAPI
- Использование BukkitUtil
- Использование ResourceAPI
-
- Creating main class
- Setting up the ancapplugin.yml
- Using the AncapPluginAPI
- Using the LanguageAPI
- Using the CommunicatorAPI
- Using the ConfigurationAPI
- Using the CommandAPI
- Using the DatabaseAPI
- Using the EventAPI
- Using the MaterialAPI
- Using the WorldIteratorAPI
- Using the BukkitUtil
- Using the ResouceAPI