Fix custom payload event

[no changelog]
This commit is contained in:
Linnea Gräf
2024-06-05 01:04:55 +02:00
parent 3b9fd665af
commit db2b96bd98
10 changed files with 99 additions and 66 deletions

View File

@@ -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)
}
}
}