From e762856a7881d97fa862c093d84e8e7f673e7168 Mon Sep 17 00:00:00 2001 From: inglettronald Date: Fri, 30 Jun 2023 03:57:46 -0500 Subject: Added ModifyCommand Registration --- src/main/kotlin/com/dulkirfabric/Registrations.kt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/com') diff --git a/src/main/kotlin/com/dulkirfabric/Registrations.kt b/src/main/kotlin/com/dulkirfabric/Registrations.kt index 9346504..59ba213 100644 --- a/src/main/kotlin/com/dulkirfabric/Registrations.kt +++ b/src/main/kotlin/com/dulkirfabric/Registrations.kt @@ -4,12 +4,19 @@ import com.dulkirfabric.DulkirModFabric.EVENT_BUS import com.dulkirfabric.commands.ConfigCommand import com.dulkirfabric.commands.DynamicKeyCommand import com.dulkirfabric.commands.JoinDungeonCommands -import com.dulkirfabric.events.* +import com.dulkirfabric.events.BlockOutlineEvent +import com.dulkirfabric.events.ClientTickEvent +import com.dulkirfabric.events.MouseScrollEvent +import com.dulkirfabric.events.WorldRenderLastEvent +import com.dulkirfabric.events.chat.ChatReceivedEvent +import com.dulkirfabric.events.chat.ModifyCommandEvent +import com.dulkirfabric.events.chat.OverlayReceivedEvent import com.dulkirfabric.features.* import com.dulkirfabric.features.chat.AbiPhoneDND import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents +import net.fabricmc.fabric.api.client.message.v1.ClientSendMessageEvents import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents import net.fabricmc.fabric.api.client.screen.v1.ScreenMouseEvents @@ -49,6 +56,7 @@ object Registrations { EVENT_BUS.subscribe(CustomBlockOutline) EVENT_BUS.subscribe(AbiPhoneDND) EVENT_BUS.subscribe(InventoryScale) + EVENT_BUS.subscribe(AliasImpl) } fun registerEvents() { @@ -62,6 +70,11 @@ object Registrations { else !ChatReceivedEvent(message).post() } ) + ClientSendMessageEvents.MODIFY_COMMAND.register( + ClientSendMessageEvents.ModifyCommand { command -> + ModifyCommandEvent(command).also { it.post() }.command + } + ) WorldRenderEvents.END.register( WorldRenderEvents.End { context -> WorldRenderLastEvent(context).post()} ) -- cgit