From a7dadf620caffabc53ae412ab54e039341ea10b1 Mon Sep 17 00:00:00 2001 From: thedarkcolour <30441001+thedarkcolour@users.noreply.github.com> Date: Sat, 18 Apr 2020 12:13:11 -0700 Subject: Update 1.2.1 --- .../thedarkcolour/kotlinforforge/KotlinModLoadingContext.kt | 12 +++++++++++- src/main/kotlin/thedarkcolour/kotlinforforge/forge/Forge.kt | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/thedarkcolour/kotlinforforge/KotlinModLoadingContext.kt b/src/main/kotlin/thedarkcolour/kotlinforforge/KotlinModLoadingContext.kt index 44aac2d..78aaef7 100644 --- a/src/main/kotlin/thedarkcolour/kotlinforforge/KotlinModLoadingContext.kt +++ b/src/main/kotlin/thedarkcolour/kotlinforforge/KotlinModLoadingContext.kt @@ -1,5 +1,6 @@ package thedarkcolour.kotlinforforge +import net.minecraftforge.eventbus.api.IEventBus import thedarkcolour.kotlinforforge.eventbus.KotlinEventBus import thedarkcolour.kotlinforforge.forge.LOADING_CONTEXT @@ -10,7 +11,16 @@ class KotlinModLoadingContext constructor(private val container: KotlinModContai /** * @see thedarkcolour.kotlinforforge.forge.MOD_BUS */ - fun getEventBus(): KotlinEventBus { + fun getKEventBus(): KotlinEventBus { + return container.eventBus + } + + /** @since 1.2.1 + * @see thedarkcolour.kotlinforforge.forge.MOD_BUS + * + * Required to make mods that use an older version of KFF work. + */ + fun getEventBus(): IEventBus { return container.eventBus } diff --git a/src/main/kotlin/thedarkcolour/kotlinforforge/forge/Forge.kt b/src/main/kotlin/thedarkcolour/kotlinforforge/forge/Forge.kt index e0b9cd8..fe8ee42 100644 --- a/src/main/kotlin/thedarkcolour/kotlinforforge/forge/Forge.kt +++ b/src/main/kotlin/thedarkcolour/kotlinforforge/forge/Forge.kt @@ -40,7 +40,7 @@ val FORGE_BUS = KotlinEventBusWrapper(MinecraftForge.EVENT_BUS as EventBus) * @see net.minecraftforge.event.RegistryEvent */ val MOD_BUS: KotlinEventBus - inline get() = KotlinModLoadingContext.get().getEventBus() + inline get() = KotlinModLoadingContext.get().getKEventBus() /** @since 1.0.0 * Mod context for Kotlin mods. -- cgit