File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
eternalcore-api/src/main/java/com/eternalcode/core/feature/adminchat/event
eternalcore-core/src/main/java/com/eternalcode/core/feature/adminchat Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public class AdminChatEvent extends Event implements Cancellable {
22
22
private boolean cancelled ;
23
23
24
24
public AdminChatEvent (@ NotNull CommandSender sender , @ NotNull String content ) {
25
- super (true );
25
+ super (false );
26
26
27
27
if (sender == null ) {
28
28
throw new IllegalArgumentException ("Sender cannot be null" );
Original file line number Diff line number Diff line change 1
1
package com .eternalcode .core .feature .adminchat ;
2
2
3
+ import com .eternalcode .commons .scheduler .Scheduler ;
3
4
import com .eternalcode .core .injector .annotations .Inject ;
4
5
import com .eternalcode .core .injector .annotations .component .Controller ;
5
6
import org .bukkit .entity .Player ;
14
15
final class AdminChatChannelController implements Listener {
15
16
16
17
private final AdminChatService adminChatService ;
18
+ private final Scheduler scheduler ;
17
19
18
20
@ Inject
19
- AdminChatChannelController (@ NotNull AdminChatService adminChatService ) {
21
+ AdminChatChannelController (@ NotNull AdminChatService adminChatService , Scheduler scheduler ) {
20
22
this .adminChatService = adminChatService ;
23
+ this .scheduler = scheduler ;
21
24
}
22
25
23
26
@ EventHandler (priority = EventPriority .HIGH , ignoreCancelled = true )
@@ -30,7 +33,7 @@ void onPlayerChat(@NotNull AsyncPlayerChatEvent event) {
30
33
31
34
event .setCancelled (true );
32
35
33
- this .adminChatService .sendAdminChatMessage (event .getMessage (), player );
36
+ this .scheduler . run (() -> this . adminChatService .sendAdminChatMessage (event .getMessage (), player ) );
34
37
}
35
38
36
39
@ EventHandler (priority = EventPriority .MONITOR )
You can’t perform that action at this time.
0 commit comments