diff options
author | IlmarsXd <ilmars500@gmail.com> | 2023-06-29 18:05:08 +0300 |
---|---|---|
committer | IlmarsXd <ilmars500@gmail.com> | 2023-06-29 18:05:08 +0300 |
commit | 5f0fd39650659010a23055c11eae66fb3ffb2ad0 (patch) | |
tree | cd3eb0615037b8650f469f194a28fcac88cf6adb /src/main/kotlin/com/dulkirfabric/events | |
parent | 1fc9c0f7fe8a998e4cf04c8b498abc643533d6e7 (diff) | |
download | DulkirMod-Fabric-5f0fd39650659010a23055c11eae66fb3ffb2ad0.tar.gz DulkirMod-Fabric-5f0fd39650659010a23055c11eae66fb3ffb2ad0.tar.bz2 DulkirMod-Fabric-5f0fd39650659010a23055c11eae66fb3ffb2ad0.zip |
Fix NPE with PlaySoundEvent
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/events')
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/events/base/CancellableEvent.kt | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/events/base/CancellableEvent.kt b/src/main/kotlin/com/dulkirfabric/events/base/CancellableEvent.kt index 09027ed..c7c8ea6 100644 --- a/src/main/kotlin/com/dulkirfabric/events/base/CancellableEvent.kt +++ b/src/main/kotlin/com/dulkirfabric/events/base/CancellableEvent.kt @@ -4,8 +4,7 @@ import com.dulkirfabric.DulkirModFabric import meteordevelopment.orbit.ICancellable abstract class CancellableEvent: ICancellable { - @JvmField - var cancelled: Boolean = false + private var cancelled = false override fun isCancelled(): Boolean { return cancelled @@ -19,7 +18,6 @@ abstract class CancellableEvent: ICancellable { * Posts a given event to the bus and returns whether the user wishes to cancel it */ fun post(): Boolean { - DulkirModFabric.EVENT_BUS.post(this) - return cancelled + return DulkirModFabric.EVENT_BUS.post(this).isCancelled } }
\ No newline at end of file |