summaryrefslogtreecommitdiff
path: root/src/main/kotlin/event/UltraEvent.kt
blob: 80f63fcc10da947765b68c497c57639f2337b14b (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package moe.nea.ultranotifier.event

abstract class UltraEvent :
//#if FORGE
//$$	net.minecraftforge.eventbus.api.Event()
//#else
	me.bush.eventbus.event.Event()
//#endif
{
	interface Silent<T> where T : Silent<T>, T : UltraEvent

//#if FORGE
//$$	override fun isCancelable(): Boolean {
//$$		return this.isCancellable()
//$$	}
//$$	fun isCancelled(): Boolean {
//$$		return isCanceled()
//$$	}
//$$	fun setCancelled(value: Boolean) {
//$$		setCanceled(value)
//$$	}
//#else
	override
//#endif

	fun isCancellable(): Boolean {
		return true
	}

//#if FORGE == 0
	override
//#endif
	fun cancel() {
		setCancelled(true)
	}

	fun post() {
		UltraNotifierEvents.post(this)
	}

}