Amecs (Fabric)

Amecs (Fabric)

200k Downloads

Drop Item incompatibility

CodeF53 opened this issue ยท 7 comments

commented

In vanilla minecraft, ctrl+drop bind allows dropping a stack of an item at once

Using this mod to assign dropping to shift+q, works as expected for normal dropping, but when attempting to drop a stack ctrl+shift+q nothing happens.

commented

could we temporarily implement Klotzi111's hacky fix?

commented

You can use my "hacky fix" when you download my forked version mod release. On the github releases page of my fork repo

commented

After some constructive discussion we've decided that this issue will be fixed in a more general way.

This will basically mean that if the game receives a Ctrl+Shift+Q, it'll then try to find other key bindings that are "contained" in that key combination like Ctrl+Q or Shift+Q. This will require some additional work and will most likely be made into its own pr.

commented

I added this functionality in my fork. Either wait for @Siphalor to publish it. Or compile it yourself.

commented

Yes I see the problem. I am going to fix that. I will add a keybinding for "drop entire stack" (which than can be configured ctrl + shift + q or anything else)

commented

I added this functionality in my fork. Either wait for Siphalor to publish it. Or compile it yourself.

I don't really like the way you "fixed" this. This is basically fighting the symptoms with the real problem still sitting deeper.

This issue should be fixed in a more general way that'd address similar kinds of issues with other keybindings.
I'd have to take a closer look though to get to the cause.

commented

I already know the cause. In many places in the vanilla code static methods like "hasControlDown()" and friends are used to modify the actions (like making drop item to drop entire stack). But the main keybinding (drop item for exmaple) is not triggered because Amces reportes the key "not pressed" when the keybinding has at least one modifier (in his example shift) but the currently pressed modifiers do not match exactly (because shift AND control are pressed).

One possible fix would be to report a keybind as pressed when the modifiers bound to the keybinding are pressed (and ignore any additionaly pressed modifiers). But this would also reduce the "feature set" because then (Example:) When you have the keybindings "shift + c" and "shift + control + c". "shift + c" would trigger together with "shift + control + c" (when pressing actually pressing "shift + control + c")

Because of that I would prefer manually patching this (and adding a configureable keybinding) for every "modifier action keybinding" of the vanilla game. Other mods can use the amces api to do the same