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

Unable to Drag Items in the Crafting Table or Inventory #389

Open
1 task done
JamboChen opened this issue Dec 9, 2024 · 0 comments
Open
1 task done

Unable to Drag Items in the Crafting Table or Inventory #389

JamboChen opened this issue Dec 9, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@JamboChen
Copy link

I've searched existing issues and couldn't find a duplicate.

  • I confirm this is not a duplicate.

Operating System

ubuntu 24

Server Software Version/Commit

4d5b7ac

What happened?

When opening the crafting table, if there are already items in the table, it becomes impossible to drag items within the crafting table or the inventory. If the crafting table has no items, it returns to normal.

The following line of code fails to pass the check: https://github.com/Snowiiii/Pumpkin/blob/4d5b7ac1563a02c300b810fb1ce0cb7f243e3a1b/pumpkin/src/client/container.rs#L123

When dragging items with existing items in the crafting table:

  • packet.state_id.0 remains in the Start state.
  • Meanwhile, self.inventory().lock().await.state_id increments as the drag operation progresses.
  • Once dragging ends, packet.state_id.0 updates to synchronize.

This behavior may be related to the following code. Commenting it out resolves the issue:
https://github.com/Snowiiii/Pumpkin/blob/4d5b7ac1563a02c300b810fb1ce0cb7f243e3a1b/pumpkin/src/client/container.rs#L185-L189

Related issus: #266, I don't know if it's the same phenomenon.

To Reproduce

  1. Open the crafting table.
  2. Place one or more items in the crafting grid.
  3. Pick up another item and drag it across any slot while holding the left/middle/right mouse button.
  4. Upon releasing the mouse button, the dragged item returns to its original position.

Expected behavior

The drag operation should take effect as expected, consistent with the behavior when the crafting table is empty. Specifically: self.inventory().lock().await.state_id should not increment during the drag operation.

@JamboChen JamboChen added the bug Something isn't working label Dec 9, 2024
@Snowiiii Snowiiii added this to Pumpkin Dec 9, 2024
@Snowiiii Snowiiii moved this to Todo Bugs in Pumpkin Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants