List commands, more refactoring work

This commit is contained in:
William278 committed 2023-03-17 17:00:44 +00:00
1 parent 9903503f03
commit f746d67339
23 files changed
+361 -450

No files matched your search

@@ -324,6 +324,13 @@ public interface HuskHomes extends TaskRunner, EventDispatcher {
@NotNull
List<Command> getCommands();
default <T extends Command> Optional<T> getCommand(@NotNull Class<T> type) {
return getCommands().stream()
.filter(command -> command.getClass().isInstance(type))
.findFirst()
.map(type::cast);
}
/**
* Reloads the {@link Settings} and {@link Locales} from their respective config files
*