use of gg.projecteden.nexus.framework.commands.models.events.CommandRunEvent in project Nexus by ProjectEdenGG.
the class ICustomCommand method checkCooldown.
private void checkCooldown(CustomCommand command) {
Method method = ((CommandRunEvent) command.getEvent()).getMethod();
checkCooldown(command, command.getClass().getAnnotation(Cooldown.class), command.getName());
checkCooldown(command, method.getAnnotation(Cooldown.class), command.getName() + "#" + method.getName());
}
use of gg.projecteden.nexus.framework.commands.models.events.CommandRunEvent in project Nexus by ProjectEdenGG.
the class ICustomCommand method getNewCommand.
@SneakyThrows
CustomCommand getNewCommand(CommandEvent originalEvent, Class<?> clazz) {
CustomCommand customCommand = new ObjenesisStd().newInstance((Class<? extends CustomCommand>) clazz);
CommandRunEvent newEvent = new CommandRunEvent(originalEvent.getSender(), customCommand, customCommand.getName(), new ArrayList<>(), new ArrayList<>());
return getCommand(newEvent);
}
Aggregations