File tree Expand file tree Collapse file tree
modded/src/main/java/com/discordsrv/modded Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import com .discordsrv .api .component .MinecraftComponent ;
2222import com .discordsrv .common .core .component .ComponentFactory ;
2323import com .discordsrv .common .util .ComponentUtil ;
24+ import com .discordsrv .modded .command .game .sender .ModdedCommandSender ;
2425import com .google .common .base .Suppliers ;
2526import com .discordsrv .unrelocate .com .google .gson .Gson ;
2627import com .discordsrv .unrelocate .com .google .gson .JsonElement ;
2930import net .kyori .adventure .audience .Audience ;
3031import net .kyori .adventure .text .Component ;
3132import net .kyori .adventure .text .serializer .gson .GsonComponentSerializer ;
32- import net .minecraft .commands .CommandSourceStack ;
3333import net .minecraft .core .HolderLookup ;
3434import net .minecraft .core .RegistryAccess ;
3535import org .jetbrains .annotations .NotNull ;
@@ -84,11 +84,11 @@ public MinecraftComponent toAPI(net.minecraft.network.chat.Component text) {
8484 return toAPI (fromNative (text ));
8585 }
8686
87- public Audience audience (@ NotNull CommandSourceStack source ) {
87+ public Audience audience (@ NotNull ModdedCommandSender sender ) {
8888 return new Audience () {
8989 @ Override
9090 public void sendMessage (@ NotNull Component message ) {
91- source .sendSystemMessage (serialize (message ));
91+ sender . commandSource .sendSystemMessage (serialize (message ));
9292 }
9393 };
9494 }
Original file line number Diff line number Diff line change 3434public class ModdedCommandSender implements ICommandSender {
3535
3636 protected final ModdedDiscordSRV discordSRV ;
37- protected CommandSourceStack commandSource ;
3837 protected Audience audience ;
3938
39+ public CommandSourceStack commandSource ;
40+
4041 public ModdedCommandSender (ModdedDiscordSRV discordSRV , CommandSourceStack commandSource ) {
4142 this .discordSRV = discordSRV ;
4243 this .commandSource = commandSource ;
43- this .audience = discordSRV .componentFactory ().audience (commandSource );
44+ this .audience = discordSRV .componentFactory ().audience (this );
4445 }
4546
4647 @ Override
You can’t perform that action at this time.
0 commit comments