Skip to content

Conversation

@beanbag44
Copy link
Collaborator

alters the inventory move module to use the players keybinds over default, and lets minecraft handle the movement logic

@github-actions github-actions bot added the triage Requires labelling or review label Jul 29, 2025
@emyfops
Copy link
Collaborator

emyfops commented Jul 29, 2025

This is a regression as the user is no longer able to rotate using the arrow keys

@beanbag44
Copy link
Collaborator Author

oh sorry i didn't mean to remove that feature. I'll fix it. I don't think any of the changes i made should affect it

…nto improvement/inventory-move

# Conflicts:
#	common/src/main/kotlin/com/lambda/module/modules/player/InventoryMove.kt
@emyfops emyfops requested a review from Copilot August 2, 2025 09:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the InventoryMove module by switching from manual movement input handling to using Minecraft's native keybind system. This allows the module to respect player-configured keybinds and delegates movement logic to Minecraft's built-in systems.

  • Removed custom movement input handling and replaced it with keybind-based movement detection
  • Added keyboard input interception to maintain movement key states when inventory screens are open
  • Introduced selective key unpressing to preserve movement keys while clearing other keybinds during screen transitions

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
lambda.accesswidener Exposes KeyBinding internals for accessing key mappings and reset functionality
InventoryMove.kt Refactored from manual input handling to keybind detection with arrow key rotation option
KeyboardMixin.java Added input interception to maintain movement key states during inventory screens
MinecraftClientMixin.java Modified key unpressing behavior to preserve movement keys during screen transitions


@Redirect(method = "setScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/KeyBinding;unpressAll()V"))
private void redirectUnPressAll() {
if (InventoryMove.INSTANCE.isDisabled() || InventoryMove.hasInputOrNull(currentScreen)) {
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition InventoryMove.INSTANCE.isDisabled() || InventoryMove.hasInputOrNull(currentScreen) is duplicated in KeyboardMixin. Consider extracting this logic into a utility method to reduce code duplication.

Suggested change
if (InventoryMove.INSTANCE.isDisabled() || InventoryMove.hasInputOrNull(currentScreen)) {
if (shouldUnpressAll(currentScreen)) {

Copilot uses AI. Check for mistakes.
Comment on lines +102 to +106
KeyBinding.KEYS_BY_ID.values().forEach(bind -> {
if (!InventoryMove.isKeyMovementRelated(bind.boundKey.getCode())) {
bind.reset();
}
});
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using forEach with a lambda on every screen transition could be inefficient. Consider using a traditional for-each loop or caching the filtered keybindings for better performance.

Suggested change
KeyBinding.KEYS_BY_ID.values().forEach(bind -> {
if (!InventoryMove.isKeyMovementRelated(bind.boundKey.getCode())) {
bind.reset();
}
});
for (KeyBinding bind : KeyBinding.KEYS_BY_ID.values()) {
if (!InventoryMove.isKeyMovementRelated(bind.boundKey.getCode())) {
bind.reset();
}
}

Copilot uses AI. Check for mistakes.
@Avanatiker Avanatiker changed the base branch from master to 1.21.5 September 5, 2025 01:45
@lambda-client lambda-client deleted a comment from Copilot AI Sep 5, 2025
@Avanatiker
Copy link
Member

Thanks but i had to redo it from scratch due to massively outdated target branch :/

@Avanatiker Avanatiker closed this Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Requires labelling or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants