@@ -48,32 +48,39 @@ const ChatChatDeluxeChatConverter = new Converter<
48
48
( segment ) => {
49
49
let formattedSegment = dcFormat [ segment ] ;
50
50
51
- // Add in the click command if it exists
52
- let segmentClick =
53
- dcFormat [ ( segment + "_click_command" ) as keyof DeluxeChatFormat ] ;
54
- if ( segmentClick && segmentClick !== "" ) {
55
- formattedSegment =
56
- "<click:run_command:'" +
57
- segmentClick +
58
- "'>" +
59
- formattedSegment +
60
- "</click>" ;
61
- }
51
+ if ( formattedSegment ) {
62
52
63
- // Add in the hover if it exists
64
- let segmentHover : string [ ] = ( < string [ ] > (
65
- dcFormat [ ( segment + "_tooltip" ) as keyof DeluxeChatFormat ]
66
- ) ) . filter ( ( s ) => s && s !== "" ) ;
67
- if ( segmentHover && segmentHover . length > 0 ) {
68
- formattedSegment =
69
- "<hover:show_text:'" +
70
- segmentHover . join ( "<newline>" ) +
71
- "'>" +
72
- formattedSegment +
73
- "</hover>" ;
74
- }
75
- if ( formattedSegment !== "" ) {
76
- ccFormat . parts . push ( MiniMessage ( formattedSegment ) ) ;
53
+ // Add in the click command if it exists
54
+ if ( dcFormat [ ( segment + "_click_command" ) as keyof DeluxeChatFormat ] ) {
55
+ let segmentClick =
56
+ dcFormat [ ( segment + "_click_command" ) as keyof DeluxeChatFormat ] ;
57
+ if ( segmentClick && segmentClick !== "" ) {
58
+ formattedSegment =
59
+ "<click:run_command:'" +
60
+ segmentClick +
61
+ "'>" +
62
+ formattedSegment +
63
+ "</click>" ;
64
+ }
65
+ }
66
+
67
+ // Add in the hover if it exists
68
+ if ( dcFormat [ ( segment + "_tooltip" ) as keyof DeluxeChatFormat ] ) {
69
+ let segmentHover : string [ ] = ( < string [ ] > (
70
+ dcFormat [ ( segment + "_tooltip" ) as keyof DeluxeChatFormat ]
71
+ ) ) . filter ( ( s ) => s && s !== "" ) ;
72
+ if ( segmentHover && segmentHover . length > 0 ) {
73
+ formattedSegment =
74
+ "<hover:show_text:'" +
75
+ segmentHover . join ( "<newline>" ) +
76
+ "'>" +
77
+ formattedSegment +
78
+ "</hover>" ;
79
+ }
80
+ }
81
+ if ( formattedSegment !== "" ) {
82
+ ccFormat . parts . push ( MiniMessage ( formattedSegment ) ) ;
83
+ }
77
84
}
78
85
}
79
86
) ;
0 commit comments