diff options
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/Registrations.kt')
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/Registrations.kt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/Registrations.kt b/src/main/kotlin/com/dulkirfabric/Registrations.kt index 3068b86..b221971 100644 --- a/src/main/kotlin/com/dulkirfabric/Registrations.kt +++ b/src/main/kotlin/com/dulkirfabric/Registrations.kt @@ -3,7 +3,14 @@ package com.dulkirfabric import com.dulkirfabric.DulkirModFabric.EVENT_BUS import com.dulkirfabric.commands.ConfigCommand import com.dulkirfabric.commands.JoinDungeonCommands +import com.dulkirfabric.events.ClientTickEvent +import com.dulkirfabric.events.ServerTickEvent import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback +import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents +import net.minecraft.server.MinecraftServer +import net.minecraft.util.profiling.jfr.event.WorldLoadFinishedEvent + /** * Collection of different mod registration stuff ran on initializing the mod. It is separated for readability @@ -33,4 +40,15 @@ object Registrations { fun registerEventListeners() { EVENT_BUS.subscribe(DulkirModFabric) } + + fun registerEvents() { + // Register Custom Tick events so we can use them like 1.8.9 forge + ServerTickEvents.START_SERVER_TICK.register( + ServerTickEvents.StartTick { _ -> EVENT_BUS.post(ServerTickEvent.get()) } + ) + ClientTickEvents.START_CLIENT_TICK.register( + ClientTickEvents.StartTick { _ -> EVENT_BUS.post(ClientTickEvent.get()) } + ) + // WorldLoadFinishedEvent + } }
\ No newline at end of file |