summaryrefslogtreecommitdiff
path: root/src/main/kotlin/event/UltraNotifierEvents.kt
blob: 34d17690e8f1f8235ef2129f74eee396a4e62918 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package moe.nea.ultranotifier.event

import moe.nea.ultranotifier.UltraNotifier

object UltraNotifierEvents {
	val eventBus =
//#if FORGE
//$$		net.minecraftforge.common.MinecraftForge.EVENT_BUS
//#else
		me.bush.eventbus.bus.EventBus { UltraNotifier.logger.warn("EventBus: $it") }
//#endif
	@JvmStatic
	fun <T : UltraEvent> post(event: T): T {
		UltraNotifier.logger.info("Posting $event")
		eventBus.post(event)
		return event
	}

	fun register(obj: Any) {
//#if FORGE
//$$		eventBus.register(obj)
//#else
		eventBus.subscribe(obj)
//#endif
	}
}