mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 22:17:17 +00:00
List commands, more refactoring work
This commit is contained in:
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
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user