blackd / Inventory-Profiles

Take control over you inventory. Sort. Move matching/all Items. Throw all/all items. Locked slots. Gear sets! And much more!
https://inventory-profiles-next.github.io/
GNU Affero General Public License v3.0
156 stars 49 forks source link

Implement stackable threshold for refill #375

Closed VelizarBG closed 7 months ago

VelizarBG commented 9 months ago

This enables a refill to happen when an item stack's count falls within a certain threshold. It's similar to Tweakeroo's handRestockPre but utilizes IPN's more latency-immune refill. Fixes desyncs with Litematica's easy place mode on high-latency connections.

blackd commented 9 months ago

looks good to me unfortunately currently the forge build is broken and I have no ETA for releasing this. I'll probably need to reimplement the whole build system before that.

VelizarBG commented 9 months ago

That's fine. I'm making this a draft for now until I figure out some weird interactions.

VelizarBG commented 9 months ago

Mkay, hopefully this should do.

blackd commented 9 months ago

OK, you'll have to explain the last commit. The added code does almost the same thing as the removed just at different moment of the execution. What's the benefit of moving it there?

Especially considering that the decision if a stack should be moved at all was done only in the original method and now it's separated between the two methods.

VelizarBG commented 9 months ago

Sure. So basically that commit fixes a desync I introduced earlier when bucketing lava on high-latency connections which I believe was caused by the checkingItem.count > 1 check. Now that you say it, I agree it kinda looks weird there so I moved it back. In this new commit I also made it shift-click the stack if its item type is stackable. This aids easy place again because it doesn't just leave the replaced stacks all over the place because it combines them.