19
19
package com .andre601 .oneversionremake .bungeecord .commands ;
20
20
21
21
import com .andre601 .oneversionremake .core .CommandPermissions ;
22
+ import com .andre601 .oneversionremake .core .OneVersionRemake ;
22
23
import com .andre601 .oneversionremake .core .interfaces .CmdSender ;
23
- import net .kyori .adventure .text . Component ;
24
+ import net .kyori .adventure .platform . bungeecord . BungeeAudiences ;
24
25
import net .kyori .adventure .text .format .NamedTextColor ;
25
- import net .kyori .adventure .text .serializer .bungeecord .BungeeComponentSerializer ;
26
26
import net .md_5 .bungee .api .CommandSender ;
27
27
28
28
public class BungeeSender implements CmdSender {
29
29
30
+ private final OneVersionRemake core ;
30
31
private final CommandSender sender ;
32
+ private final BungeeAudiences bungeeAudiences ;
31
33
32
- public BungeeSender (CommandSender sender ){
34
+ public BungeeSender (OneVersionRemake core , CommandSender sender , BungeeAudiences bungeeAudiences ){
35
+ this .core = core ;
33
36
this .sender = sender ;
37
+ this .bungeeAudiences = bungeeAudiences ;
34
38
}
35
39
36
40
@ Override
@@ -50,8 +54,8 @@ public void sendMsg(String msg, Object... args){
50
54
51
55
@ Override
52
56
public void sendMsg (NamedTextColor color , String msg , Object ... args ){
53
- sender . sendMessage ( BungeeComponentSerializer . get (). serialize (
54
- Component . text (String .format (msg , args )).color (color )
55
- )) ;
57
+ bungeeAudiences . sender ( sender ). sendMessage (
58
+ core . getComponentParser (). toComponent (String .format (msg , args )).color (color )
59
+ );
56
60
}
57
61
}
0 commit comments