Currently, when picking a block, if the corresponding item is in your inventory, but not your hotbar, the item will be swapped into your currently selected slot.
With this PR, the mod will first attempt to cycle the item into the hotbar, and then select the corresponding slot.
[x] Users have the choice to cycle either the whole hotbar, only the appropriate slot, or to disable the feature entirely.
[x] Disabled rows and columns are respected. If the item is in a disabled slot, vanilla mechanics apply instead.
I implented my own version of shiftRows and shiftSingle. They accept an arbitrary offset as an argument, instead of just Up or Down, so they end up sending less packets to the server than repeated calls to the old ones.
The old implementations could be made to rely onto those, but I preferred to leave them untouched for now.
I'm using two boolean options in the config.
I think a single three-choices (enum?) option would be more intuitive, but I'm not familiar enough with cloth-config to make it look clean in the config screen.
If this is accepted, I'll also make a PR for a 1.19.4 backport (which I still play on)
Currently, when picking a block, if the corresponding item is in your inventory, but not your hotbar, the item will be swapped into your currently selected slot.
With this PR, the mod will first attempt to cycle the item into the hotbar, and then select the corresponding slot.
I implented my own version of
shiftRows
andshiftSingle
. They accept an arbitrary offset as an argument, instead of just Up or Down, so they end up sending less packets to the server than repeated calls to the old ones. The old implementations could be made to rely onto those, but I preferred to leave them untouched for now.I'm using two boolean options in the config. I think a single three-choices (enum?) option would be more intuitive, but I'm not familiar enough with cloth-config to make it look clean in the config screen.
If this is accepted, I'll also make a PR for a 1.19.4 backport (which I still play on)