File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/main/java/pro/cloudnode/smp/bankaccounts/commands Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,13 @@ else if (args.length == 3) {
8686 if (sender .hasPermission (Permissions .INVOICE_SEND_OTHER )) list .addAll (Arrays .stream (Invoice .get ()).map (a -> a .id ).toList ());
8787 else list .addAll (Arrays .stream (Invoice .get (BankAccounts .getOfflinePlayer (sender ), Account .get (BankAccounts .getOfflinePlayer (sender )))).filter (i -> i .transaction == null ).map (a -> a .id ).toList ());
8888 }
89+ if (args .length == 3 ) {
90+ final @ NotNull Optional <@ NotNull Invoice > invoice = Invoice .get (args [1 ]);
91+ if (invoice .isPresent () && (sender .hasPermission (Permissions .INVOICE_SEND_OTHER ) || invoice .get ().seller .owner .equals (BankAccounts .getOfflinePlayer (sender )))) {
92+ invoice .get ().buyer ().flatMap (buyer -> Optional .ofNullable (buyer .getPlayer ()))
93+ .ifPresent (player -> list .add (player .getName ()));
94+ }
95+ }
8996 }
9097 case "list" -> {
9198 if (!sender .hasPermission (Permissions .INVOICE_VIEW )) break ;
You can’t perform that action at this time.
0 commit comments