@@ -38,7 +38,11 @@ public static void sendCaptureInfo(@Nonnull PsrUser user, @Nonnull CaptureInfo i
3838 hoverTextBuilder .append ("\n §b§lDirects: " + (info .getDirects ().isEmpty () ? "§fN/A\n " : "\n " ));
3939 for (String direct : info .getDirects ()) {
4040 hoverTextBuilder .append ("§6§l- " );
41- hoverTextBuilder .append (TextComponent .fromLegacyText (ColorUtils .showColorCodes (direct , true ) + "\n " ));
41+ if (ProtocolStringReplacer .getInstance ().getServerMajorVersion () >= 12 ) {
42+ hoverTextBuilder .append (TextComponent .fromLegacyText (ColorUtils .showColorCodes (direct , true ) + "\n " ));
43+ } else {
44+ hoverTextBuilder .append (ColorUtils .showColorCodes (direct , true ) + "\n " );
45+ }
4246 }
4347 if (info .getExtra () != null ) {
4448 hoverTextBuilder .append ("\n " );
@@ -85,11 +89,16 @@ public static void sendCaptureInfoClipboard(@Nonnull PsrUser user, @Nonnull Capt
8589 for (String direct : info .getDirects ()) {
8690 ClickEvent clickEvent = ProtocolStringReplacer .getInstance ().getServerMajorVersion () >= 15 ?
8791 new ClickEvent (ClickEvent .Action .COPY_TO_CLIPBOARD , direct ) : new ClickEvent (ClickEvent .Action .SUGGEST_COMMAND , direct );
88- user . sendFilteredMessage ( new ComponentBuilder (" - " ).color (ChatColor .GOLD ).bold (true ).event (clickEvent )
92+ ComponentBuilder clickableMsg = new ComponentBuilder (" - " ).color (ChatColor .GOLD ).bold (true ).event (clickEvent )
8993 .event (new HoverEvent (HoverEvent .Action .SHOW_TEXT ,
9094 TextComponent .fromLegacyText (PsrLocalization .getLocaledMessage ("Sender.Commands.Capture.Capture-Info.Click-To-Copy" ))))
91- .append ("" ).color (ChatColor .RESET ).bold (false )
92- .append (TextComponent .fromLegacyText (ColorUtils .showColorCodes (direct , true ))).create ());
95+ .append ("" ).color (ChatColor .RESET ).bold (false );
96+ if (ProtocolStringReplacer .getInstance ().getServerMajorVersion () >= 12 ) {
97+ clickableMsg .append (TextComponent .fromLegacyText (ColorUtils .showColorCodes (direct , true )));
98+ } else {
99+ clickableMsg .append (ColorUtils .showColorCodes (direct , true ));
100+ }
101+ user .sendFilteredMessage (clickableMsg .create ());
93102 }
94103 if (info .getExtra () != null ) {
95104 user .sendFilteredMessage (info .getExtra ());
0 commit comments