aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/events/FirmamentEventBus.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-06-05 01:04:55 +0200
committerLinnea Gräf <nea@nea.moe>2024-06-05 01:04:55 +0200
commitdb2b96bd9801d1e9f0dc108520310f9add8df4b7 (patch)
tree559fa8ce7db8b3cc6b488c1bf8c0411a1b809bb8 /src/main/kotlin/moe/nea/firmament/events/FirmamentEventBus.kt
parent3b9fd665af85f08f3bcae711f99c49528fc4b666 (diff)
downloadFirmament-db2b96bd9801d1e9f0dc108520310f9add8df4b7.tar.gz
Firmament-db2b96bd9801d1e9f0dc108520310f9add8df4b7.tar.bz2
Firmament-db2b96bd9801d1e9f0dc108520310f9add8df4b7.zip
Fix custom payload event
[no changelog]
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/events/FirmamentEventBus.kt')
-rw-r--r--src/main/kotlin/moe/nea/firmament/events/FirmamentEventBus.kt7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/events/FirmamentEventBus.kt b/src/main/kotlin/moe/nea/firmament/events/FirmamentEventBus.kt
index 8a7b387..f0a0ed3 100644
--- a/src/main/kotlin/moe/nea/firmament/events/FirmamentEventBus.kt
+++ b/src/main/kotlin/moe/nea/firmament/events/FirmamentEventBus.kt
@@ -1,5 +1,6 @@
/*
* SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
+ * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
@@ -8,6 +9,7 @@ package moe.nea.firmament.events
import java.util.concurrent.CopyOnWriteArrayList
import moe.nea.firmament.Firmament
+import moe.nea.firmament.util.MC
/**
* A pubsub event bus.
@@ -47,4 +49,9 @@ open class FirmamentEventBus<T : FirmamentEvent> {
return event
}
+ fun publishSync(event: T) {
+ MC.onMainThread {
+ publish(event)
+ }
+ }
}