File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/main/java/pro/cloudnode/smp/bankaccounts/events Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 11package pro .cloudnode .smp .bankaccounts .events ;
22
3+ import net .kyori .adventure .text .Component ;
34import org .bukkit .entity .Player ;
45import org .bukkit .event .EventHandler ;
56import org .bukkit .event .Listener ;
67import org .bukkit .event .player .PlayerJoinEvent ;
78import org .jetbrains .annotations .NotNull ;
89import pro .cloudnode .smp .bankaccounts .Account ;
910import pro .cloudnode .smp .bankaccounts .BankAccounts ;
11+ import pro .cloudnode .smp .bankaccounts .Invoice ;
1012import pro .cloudnode .smp .bankaccounts .Permissions ;
1113
1214import java .math .BigDecimal ;
@@ -31,6 +33,13 @@ public void onPlayerJoin(final @NotNull PlayerJoinEvent event) {
3133 player .sendMessage (BankAccounts .getInstance ().config ().messagesUpdateAvailable (latestVersion ));
3234 }), 20L );
3335 }
36+
37+ if (player .hasPermission (Permissions .INVOICE_NOTIFY ) && BankAccounts .getInstance ().config ().invoiceNotifyJoin ()) {
38+ BankAccounts .getInstance ().getServer ().getScheduler ().runTaskLater (BankAccounts .getInstance (), () -> {
39+ final @ NotNull Optional <@ NotNull Component > message = BankAccounts .getInstance ().config ().messagesInvoiceNotify (Invoice .countUnpaid (player ));
40+ message .ifPresent (player ::sendMessage );
41+ }, 20L );
42+ }
3443 });
3544 }
3645}
You can’t perform that action at this time.
0 commit comments