Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling on multiplayer will randomly pick up the stack #6

Open
Ricket opened this issue Oct 11, 2023 · 8 comments
Open

Scrolling on multiplayer will randomly pick up the stack #6

Ricket opened this issue Oct 11, 2023 · 8 comments

Comments

@Ricket
Copy link

Ricket commented Oct 11, 2023

mousetweaks-1.12.2-3.1.4

Must be connected to a multiplayer server -- a separate computer; I could not repro it in the same computer even in separate client/server mode but I repro it every time over LAN to another computer in my house.

If you scroll your wheel fairly rapidly, like if you wanted to gather 10+ items, you'll find that about 2-4 of them will transfer and then suddenly you'll be holding the stack of the rest of the items.

Specifically one example scenario:

  1. Start with 30 cobblestone in a chest and none in your inventory.
  2. Hover over the cobblestone. Scroll rapidly down.
  3. Some cobblestone will transfer to the inventory, usually < 10, and you'll be holding the rest of the stack.
@Ricket
Copy link
Author

Ricket commented Oct 12, 2023

I was thinking about this some more and obviously there are a few other mods that implement scrolling to move items, I'm curious how they differ.

Item Scroller has a slightly different procedure that's kind of a cool hack: they left-click the slotFrom to pick up the items, but then instead of right-clicking the slotTo, they just right-click the slotFrom once (to put back one item) and then shift-click it to send it to the destination inventory without needing to know which destination slot. And then they put the items back down with a left click.

We could try that procedure and see if it avoids this bug? It could also result in cleaner code since all the logic of figuring out slotTo would go away.

https://github.com/maruohon/itemscroller/blob/liteloader_1.12.2/src/main/java/fi/dy/masa/itemscroller/util/InventoryUtils.java#L1962

@Ricket
Copy link
Author

Ricket commented Oct 12, 2023

If the push is changed to implement that way then we should be careful to test what happens when scrolling while already holding a stack of items

@Ricket
Copy link
Author

Ricket commented Oct 14, 2023

I just installed Clumsy and added lag to the loopback (localhost) connection. Ran server & client from the MouseTweaks codebase and tested the scrolling, and it never picked up the stack. So I'm starting to think this bug could actually be an interaction between mods in E2E:E.

@Ricket
Copy link
Author

Ricket commented Oct 14, 2023

Ok well I started up a singleplayer instance of E2E:E and couldn't get it to reproduce. And then, I opened to LAN and again opened Clumsy, and I confirmed I was able to add a lag because I set it to 1 second and felt it in opening chests and punching blocks. But still in this situation, scrolling was perfectly fine, could not reproduce the issue where the stack picks up. This is really unexpected but maybe opening to LAN isn't sufficient, maybe it needs to run in separate server-client.

@Rongmario
Copy link
Member

Need to test on its own to see if it's just MouseTweaks. As E2E:E has several different inventory improvement mods that may have introduced race conditions.

@Ricket
Copy link
Author

Ricket commented Oct 16, 2023

Ok I have new information! This only seems to happen for Framed Chests from BiblioCraft. It just so happens that we're in early game of E2E:E where framed chests are the majority of our storage because of a quest reward (and they're cheaper to make than regular chests). But now that I have some regular chests and also Cabinet from Rustic, I finally just noticed tonight that this bug doesn't happen with those.

Framed chests have an interesting behavior that they show the majority item on the front of them (and it's a bit complicated how it figures out the majority item or whether it switches to a different majority item). So I'm guessing that behavior is probably somehow what's causing this bug.

@Rongmario
Copy link
Member

Framed Chests from Bibliocraft? Bibliocraft goes against a lot of the normal conventions when it comes to containers and GUIs.

@Ricket
Copy link
Author

Ricket commented Nov 25, 2023

This also happens for the Cooking for Blockheads Fridge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants