9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2026-01-04 15:41:31 +00:00

fix: fix custom bot action api, refactor

This commit is contained in:
MC_XiaoHei
2025-07-08 12:08:12 +08:00
parent 90a5a1d450
commit afefaec186
9 changed files with 68 additions and 17 deletions

View File

@@ -39,7 +39,7 @@ public interface Bot extends Player {
* @param action bot action
*/
@org.jetbrains.annotations.ApiStatus.Experimental
void addAction(@NotNull BotAction action);
void addAction(@NotNull BotAction<?> action);
/**
* Get the copy action in giving index
@@ -48,7 +48,7 @@ public interface Bot extends Player {
* @return Action of that index
*/
@org.jetbrains.annotations.ApiStatus.Experimental
BotAction getAction(int index);
BotAction<?> getAction(int index);
/**
* Get action size

View File

@@ -21,13 +21,13 @@ public interface CustomBotAction extends BotAction<CustomBotAction> {
boolean doTick(Bot bot);
/**
* Created a new action instance.
* Created a new action instance from command.
*
* @param player player who create this action
* @param args passed action arguments
* @return a new action instance with given args
*/
@Nullable CustomBotAction getNew(@Nullable Player player, String[] args);
@Nullable CustomBotAction fromCommand(Player player, String[] args);
/**
* Requests a list of possible completions for a action argument.