ZNPCsPlus/plugin/src/main/java/lol/pyr/znpcsplus/interaction/InteractionCommandHandler.java

25 lines
960 B
Java
Raw Normal View History

2023-05-21 11:32:55 +00:00
package lol.pyr.znpcsplus.interaction;
2023-05-28 05:32:00 +00:00
import lol.pyr.director.adventure.command.CommandContext;
2023-05-21 11:32:55 +00:00
import lol.pyr.director.adventure.command.CommandHandler;
2023-05-28 05:32:00 +00:00
import lol.pyr.director.common.command.CommandExecutionException;
2023-05-29 20:10:51 +00:00
import lol.pyr.znpcsplus.npc.NpcEntryImpl;
2023-05-28 05:32:00 +00:00
import lol.pyr.znpcsplus.npc.NpcImpl;
2023-05-29 20:10:51 +00:00
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
2023-05-21 11:32:55 +00:00
public interface InteractionCommandHandler extends CommandHandler {
String getSubcommandName();
2023-05-28 05:32:00 +00:00
2023-07-15 20:57:54 +00:00
InteractionActionImpl parse(CommandContext context) throws CommandExecutionException;
2023-05-29 20:10:51 +00:00
void appendUsage(CommandContext context);
@Override
default void run(CommandContext context) throws CommandExecutionException {
appendUsage(context);
NpcImpl npc = context.parse(NpcEntryImpl.class).getNpc();
npc.addAction(parse(context));
context.send(Component.text("Added action to npc", NamedTextColor.GREEN));
}
2023-05-21 11:32:55 +00:00
}