diff options
author | inglettronald <inglettronald@gmail.com> | 2023-06-30 03:55:49 -0500 |
---|---|---|
committer | inglettronald <inglettronald@gmail.com> | 2023-06-30 03:55:49 -0500 |
commit | cd7b08b4799b5ee08f1dca6ff92a28e74d9db102 (patch) | |
tree | 86691df35e72dc3d4e15891f049e1edbc8a2bc3a /src/main/kotlin/com/dulkirfabric/features/AliasImpl.kt | |
parent | f01846879e226b932d81fa842e4eee4567f0a28c (diff) | |
download | DulkirMod-Fabric-cd7b08b4799b5ee08f1dca6ff92a28e74d9db102.tar.gz DulkirMod-Fabric-cd7b08b4799b5ee08f1dca6ff92a28e74d9db102.tar.bz2 DulkirMod-Fabric-cd7b08b4799b5ee08f1dca6ff92a28e74d9db102.zip |
Added Alias Code And Implemented Dynamic Key
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/features/AliasImpl.kt')
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/features/AliasImpl.kt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/features/AliasImpl.kt b/src/main/kotlin/com/dulkirfabric/features/AliasImpl.kt new file mode 100644 index 0000000..2e552e7 --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/features/AliasImpl.kt @@ -0,0 +1,16 @@ +package com.dulkirfabric.features + +import com.dulkirfabric.config.DulkirConfig +import com.dulkirfabric.events.chat.ModifyCommandEvent +import meteordevelopment.orbit.EventHandler + +object AliasImpl { + @EventHandler + fun onCommand(event: ModifyCommandEvent) { + DulkirConfig.configOptions.aliasList.forEach { + if (it.alias == event.command) { + event.command = it.command + } + } + } +}
\ No newline at end of file |