misc cleanup

This commit is contained in:
Luck committed 2017-12-23 23:51:42 +00:00
1 parent 862fe6e2e3
commit 6602b23f09
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() {