mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-26 10:23:02 +00:00
misc cleanup
This commit is contained in:
36 files changed
+281
-4022
No files matched your search
@@ -99,14 +99,11 @@ public class SpongeCommandExecutor extends CommandManager implements CommandCall
|
||||
String element = it.next();
|
||||
if (element.startsWith("@")) {
|
||||
try {
|
||||
Player ret = Selector.parse(element).resolve(source).stream()
|
||||
Selector.parse(element).resolve(source).stream()
|
||||
.filter(e -> e instanceof Player)
|
||||
.map(e -> ((Player) e))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
if (ret != null) {
|
||||
it.set(ret.getUniqueId().toString());
|
||||
}
|
||||
.findFirst()
|
||||
.ifPresent(ret -> it.set(ret.getUniqueId().toString()));
|
||||
} catch (IllegalArgumentException e) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ public class SpongeMainCommand extends Command<Void, LPSubjectData> {
|
||||
|
||||
@Override
|
||||
public boolean isAuthorized(Sender sender) {
|
||||
return getSubCommands().stream().filter(sc -> sc.isAuthorized(sender)).count() != 0;
|
||||
return getSubCommands().stream().anyMatch(sc -> sc.isAuthorized(sender));
|
||||
}
|
||||
|
||||
public List<Command<LPSubjectData, ?>> getSubCommands() {
|
||||
|
||||
Reference in new issue
Block a user