File tree Expand file tree Collapse file tree
src/main/kotlin/org/polyfrost/chatting Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,11 +213,25 @@ object Chatting {
213213 return ChattingConfig .chatWindow.customWidth
214214 }
215215
216- fun screenshotLine (line : ChatLine ): BufferedImage ? {
216+ fun screenshotLine (line : ChatLine ? ): BufferedImage ? {
217+ if (line == null || line !is ChatLineHook ) {
218+ Notifications .INSTANCE .send(" Chatting" , " No chat line provided." )
219+ return null
220+ }
221+
217222 return screenshot(
218223 linkedMapOf<ChatLine , String >().also { map ->
219224 val fullMessage = (line as ChatLineHook ).`chatting$getFullMessage`()
225+ if (fullMessage == null ) {
226+ Notifications .INSTANCE .send(" Chatting" , " No full message found for the provided chat line." )
227+ return null
228+ }
229+
220230 for (chatLine in (mc.ingameGUI.chatGUI as GuiNewChatAccessor ).drawnChatLines) {
231+ if (chatLine == null || chatLine !is ChatLineHook ) {
232+ continue
233+ }
234+
221235 if ((chatLine as ChatLineHook ).`chatting$getFullMessage`() == fullMessage) {
222236 map[chatLine] = chatLine.chatComponent.formattedText
223237 }
You can’t perform that action at this time.
0 commit comments