-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Implement item stacking #562
Conversation
pumpkin/src/entity/item.rs
Outdated
let max_stack = Item::from_id(self.id) | ||
.unwrap_or(Item::AIR) | ||
.components | ||
.max_stack_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should rather save the Item/Itemstack somewhere instead of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ye, good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure from where though, as storing the item itself on the entity would take up memory. Having the item being created runtime might be the best option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even Slot::to_item
uses Item::from_id
I changed some of the code, this is definitely faster now. Only found a bug that item picking is now broken, Currently don't have time maybe you can fix that ? |
Thanks, gonna take a look |
You can item pick now but there's still something odd about it, will have to take another look later |
Pickblock is now fixed |
In Vanilla the Item stack you currently holding is prioritized, this means when you have a free slot at the first hotbar slot but already holding stone in an other slot while picking up stone you get the stone in the current held slot |
Fixed |
Looks good now. Thank you @4lve! 👍 |
Description
What's added:
Fixes:
#546
#534
Testing
Please follow our Coding Guidelines