mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 14:38:52 +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
@@ -1,6 +1,7 @@
|
||||
package net.william278.huskhomes.command;
|
||||
|
||||
import net.william278.huskhomes.HuskHomes;
|
||||
import net.william278.huskhomes.teleport.Teleportable;
|
||||
import net.william278.huskhomes.user.CommandUser;
|
||||
import net.william278.huskhomes.user.ConsoleUser;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -114,4 +115,9 @@ public abstract class Node implements Executable {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
protected Optional<Teleportable> resolveTeleportable(@NotNull CommandUser executor, @NotNull String[] args) {
|
||||
return parseStringArg(args, 0).map(Teleportable::username)
|
||||
.or(() -> executor instanceof Teleportable ? Optional.of((Teleportable) executor) : Optional.empty());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user