From 0277eabfb74c262c10524eeed90c97dceeaa60a8 Mon Sep 17 00:00:00 2001 From: Gabber235 Date: Tue, 8 Oct 2024 20:55:58 +0200 Subject: [PATCH] Add has message check for chat history --- .../engine/paper/interaction/ChatHistoryHandler.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/interaction/ChatHistoryHandler.kt b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/interaction/ChatHistoryHandler.kt index 48fb48e659..45c49add54 100644 --- a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/interaction/ChatHistoryHandler.kt +++ b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/interaction/ChatHistoryHandler.kt @@ -125,6 +125,10 @@ class ChatHistory { } } + fun hasMessage(message: Component): Boolean { + return messages.any { it.message == message } + } + fun clear() { messages.clear() }