File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/main/java/pro/cloudnode/smp/bankaccounts/integrations Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 88
99import java .math .BigDecimal ;
1010import java .util .Arrays ;
11+ import java .util .stream .Collectors ;
1112
1213public final class PAPIIntegration extends PlaceholderExpansion {
1314 @ Override
@@ -66,6 +67,18 @@ yield switch (args[1]) {
6667 case "owner" -> args .length != 2 ? null : Account .get (Account .Tag .from (args [1 ])).map (value -> value .owner .getName ()).orElse (null );
6768 case "type" -> args .length != 2 ? null : Account .get (Account .Tag .from (args [1 ])).map (value -> value .type .getName ()).orElse (null );
6869 case "name" -> args .length != 2 ? null : Account .get (Account .Tag .from (args [1 ])).map (value -> value .name ).orElse (null );
70+ case "account" -> {
71+ if (args .length == 2 ) {
72+ final @ NotNull Account @ NotNull [] accounts = Account .get (player );
73+ yield switch (args [1 ]) {
74+ case "list" -> Arrays .stream (accounts ).map (account -> account .id ).collect (Collectors .joining (", " ));
75+ case "names" -> Arrays .stream (accounts ).map (Account ::name ).collect (Collectors .joining (", " ));
76+ case "count" -> String .valueOf (accounts .length );
77+ default -> null ;
78+ };
79+ }
80+ yield null ;
81+ }
6982 default -> null ;
7083 };
7184 }
You can’t perform that action at this time.
0 commit comments