diff options
author | Cow <cow@volloeko.de> | 2020-08-06 18:01:42 +0200 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2020-08-06 18:01:42 +0200 |
commit | ba4dc3a0cbb58152c1fbdfe58224cb65685acc55 (patch) | |
tree | 7b516e171223640172b9e6b77de67f1bbb52cf9b /src/main/java/de/cowtipper/cowlection/Cowlection.java | |
parent | 2346e0ead0722f5fa9ce6e5bfda15ce927e3529a (diff) | |
download | Cowlection-ba4dc3a0cbb58152c1fbdfe58224cb65685acc55.tar.gz Cowlection-ba4dc3a0cbb58152c1fbdfe58224cb65685acc55.tar.bz2 Cowlection-ba4dc3a0cbb58152c1fbdfe58224cb65685acc55.zip |
Conflicts resolving
- Added keybinding to open chat with `/moo ` pre-typed
- New sub-command: `/m cmd` to fix command conflicts with server-side commands with the same name `/m`
- Added `/<command with tab-completable username> say` (similar to `/moo say`)
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/Cowlection.java')
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/Cowlection.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/Cowlection.java b/src/main/java/de/cowtipper/cowlection/Cowlection.java index de92ab9..50df539 100644 --- a/src/main/java/de/cowtipper/cowlection/Cowlection.java +++ b/src/main/java/de/cowtipper/cowlection/Cowlection.java @@ -12,15 +12,18 @@ import de.cowtipper.cowlection.listener.ChatListener; import de.cowtipper.cowlection.listener.PlayerListener; import de.cowtipper.cowlection.util.ChatHelper; import de.cowtipper.cowlection.util.VersionChecker; +import net.minecraft.client.settings.KeyBinding; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; import java.io.File; @@ -33,6 +36,7 @@ public class Cowlection { public static final String VERSION = "@VERSION@"; public static final String MODNAME = "@MODNAME@"; public static final String GITURL = "@GITURL@"; + public static KeyBinding[] keyBindings; private static Cowlection instance; private File configDir; private File modsDir; @@ -71,6 +75,13 @@ public class Cowlection { for (String tabCompletableNamesCommand : MooConfig.tabCompletableNamesCommands) { ClientCommandHandler.instance.registerCommand(new TabCompletableCommand(this, tabCompletableNamesCommand)); } + // key bindings + keyBindings = new KeyBinding[1]; + keyBindings[0] = new KeyBinding("key.cowlection.moo.desc", Keyboard.KEY_M, "key.cowlection.category"); + + for (KeyBinding keyBinding : keyBindings) { + ClientRegistry.registerKeyBinding(keyBinding); + } } @EventHandler |