Skip to content

Commit

Permalink
Add a hotkey for generating a /bugreport
Browse files Browse the repository at this point in the history
  • Loading branch information
derNiklaas committed Apr 4, 2024
1 parent 998bdb5 commit aa6bff6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ You need Minecraft 1.20.4 and at least [Noxesium 1.2](https://modrinth.com/mod/n

### Usage

This mod adds the ``/buildbug`` command and a hotkey (default ``U``) to quickly gather information about your location.
This mod adds the ``/buildbug`` command and two hotkeys, the first hotkey (default ``U``) is used to quickly gather information about your location.
The second hotkey (default ``I``) is used to quickly generate a /bugreport.

- ``/buildbug`` - Prints out location information, same as the hotkey.
- ``/buildbug config clipboard <true/false>`` (default: ``false``) - If set to true, automatically copies any ``/bugreport`` links or ``/buildbug`` coordinates to the clipboard.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ class BuildBugsClientEntrypoint : ClientModInitializer {
"key.buildbugs.report", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_U, "category.buildbugs"
)
)
val bugreportKeybinding = KeyBindingHelper.registerKeyBinding(
KeyBinding(
"key.buildbugs.bugreport", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_I, "category.buildbugs"
)
)

ClientCommandRegistrationCallback.EVENT.register(BuildBugsCommand::register)

ClientTickEvents.END_CLIENT_TICK.register {
if (reportKeybinding.wasPressed()) {
BugCreator.report()
}
if (bugreportKeybinding.wasPressed()) {
val player = it.player ?: return@register
player.networkHandler.sendCommand("bugreport")
}
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/buildbugs/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"key.buildbugs.report": "Generate a build bug report",
"key.buildbugs.bugreport": "Generate a /bugreport",
"key.buildbugs.debug": "Toggle debug mode",
"category.buildbugs": "#build-bugs"
}

0 comments on commit aa6bff6

Please sign in to comment.