nyuppo / hotbarcycle

Minecraft Fabric mod for Stardew Valley-inspired hotbar cycling.
Creative Commons Zero v1.0 Universal
9 stars 7 forks source link

Block-picker support #11

Open Estecka opened 1 year ago

Estecka commented 1 year ago

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 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)