From 480f3cc93b3b77aa53225b3d65a5eb30de81bc30 Mon Sep 17 00:00:00 2001 From: inglettronald Date: Fri, 9 Jun 2023 18:38:24 -0500 Subject: Some event stuff --- src/main/kotlin/com/dulkirfabric/DulkirModFabric.kt | 15 --------------- .../com/dulkirfabric/events/InventoryKeyPressEvent.kt | 3 ++- .../kotlin/com/dulkirfabric/events/WorldKeyPressEvent.kt | 6 ++++++ .../com/dulkirfabric/events/base/CancellableEvent.kt | 2 +- 4 files changed, 9 insertions(+), 17 deletions(-) create mode 100644 src/main/kotlin/com/dulkirfabric/events/WorldKeyPressEvent.kt (limited to 'src/main/kotlin/com') diff --git a/src/main/kotlin/com/dulkirfabric/DulkirModFabric.kt b/src/main/kotlin/com/dulkirfabric/DulkirModFabric.kt index e32e50a..112bf2a 100644 --- a/src/main/kotlin/com/dulkirfabric/DulkirModFabric.kt +++ b/src/main/kotlin/com/dulkirfabric/DulkirModFabric.kt @@ -15,7 +15,6 @@ package com.dulkirfabric import com.dulkirfabric.config.DulkirConfig import meteordevelopment.orbit.EventBus -import meteordevelopment.orbit.EventHandler import net.fabricmc.api.ModInitializer import net.minecraft.client.MinecraftClient import org.slf4j.LoggerFactory @@ -28,7 +27,6 @@ object DulkirModFabric : ModInitializer { val EVENT_BUS = EventBus() @JvmField val mc: MinecraftClient = MinecraftClient.getInstance() - var widgetLoadTime = 0L override fun onInitialize() { logger.info("Initializing DulkirMod...") @@ -46,19 +44,6 @@ object DulkirModFabric : ModInitializer { DulkirConfig.loadConfig() } - - @EventHandler - fun onPreInit(event: WidgetInitEvent) { - if (!event.initialized) println("have not initialized widgets yet!!!!") - widgetLoadTime = System.nanoTime() - } - - @EventHandler - fun onPostInit(event: WidgetInitEvent) { - val time = System.nanoTime() - widgetLoadTime - if (event.initialized) println("widgets initialized!!!!!, took: $time ns") - } - //!this.client.options.getPerspective().isFirstPerson(), this.client.options.getPerspective().isFrontView() } \ No newline at end of file diff --git a/src/main/kotlin/com/dulkirfabric/events/InventoryKeyPressEvent.kt b/src/main/kotlin/com/dulkirfabric/events/InventoryKeyPressEvent.kt index f4f9e13..6ba0667 100644 --- a/src/main/kotlin/com/dulkirfabric/events/InventoryKeyPressEvent.kt +++ b/src/main/kotlin/com/dulkirfabric/events/InventoryKeyPressEvent.kt @@ -2,4 +2,5 @@ package com.dulkirfabric.events import com.dulkirfabric.events.base.CancellableEvent -data class InventoryKeyPressEvent(val keyCode: Int, val scanCode: Int, val modifiers: Int): CancellableEvent() \ No newline at end of file +data class +InventoryKeyPressEvent(val keyCode: Int, val scanCode: Int, val modifiers: Int): CancellableEvent() \ No newline at end of file diff --git a/src/main/kotlin/com/dulkirfabric/events/WorldKeyPressEvent.kt b/src/main/kotlin/com/dulkirfabric/events/WorldKeyPressEvent.kt new file mode 100644 index 0000000..2e6545b --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/events/WorldKeyPressEvent.kt @@ -0,0 +1,6 @@ +package com.dulkirfabric.events + +import com.dulkirfabric.events.base.Event + +data class +WorldKeyPressEvent(val key: Int, val scancode: Int, val modifiers: Int): Event() \ No newline at end of file diff --git a/src/main/kotlin/com/dulkirfabric/events/base/CancellableEvent.kt b/src/main/kotlin/com/dulkirfabric/events/base/CancellableEvent.kt index 1c1ddcd..09027ed 100644 --- a/src/main/kotlin/com/dulkirfabric/events/base/CancellableEvent.kt +++ b/src/main/kotlin/com/dulkirfabric/events/base/CancellableEvent.kt @@ -4,7 +4,7 @@ import com.dulkirfabric.DulkirModFabric import meteordevelopment.orbit.ICancellable abstract class CancellableEvent: ICancellable { - + @JvmField var cancelled: Boolean = false override fun isCancelled(): Boolean { -- cgit