Skip to content

Conversation

@Gjum
Copy link
Contributor

@Gjum Gjum commented Nov 15, 2025

When the desired item is already in the hotbar, it is not necessary to move any items around. The client can tell the server the new selected hotbar slot and use the item there.

@adepierre
Copy link
Owner

Thanks for the PR. I'm really not a fan of having inventory related functions in the main client. There's already one for the transaction id thing and I'd like to refactor it out at one point.
Also having the SetHotbarSelected as public without sending the packet to the server is quite dangerous as it could cause a desync between client and server hotbar selection if not handled carefully by the user.

@Gjum
Copy link
Contributor Author

Gjum commented Nov 15, 2025

The reason I added it to ManagedClient was because the InventoryManager cannot send packets, as it does not hold a reference to any NetworkManager. If InventoryManager held a NetworkManager reference, SendInventoryTransaction() could also be moved to the InventoryManager.

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

Successfully merging this pull request may close these issues.

2 participants