-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
[1.20.6] Use stack hash strategy for mutable map in creative tab event #1043
Conversation
|
Uhhh. Are you positive you are not going to reintroduce this bug where the creative menu enchanted books gets broken or order incorrectly? #920 I feel like there was some issue I had before with the hashing and enchanted books in the menu. And had to remove the hashing in order to allow the enchanted books to show up properly |
I was not aware of that issue. This does reintroduce that bug. If this does not have a proper solution, then a better error should at least be implemented along with an explanation on the event hook with why the custom hash strategy cannot be used. |
If testing and the enchanted book bug doesn’t happen, then this pr should be alright. Though maybe we should have a junit test added to verify that two of exact same item errors but enchanted books passes. See my Neo startup config PR for an example of a junit test that is also a test mod |
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 a big fan of the impl. Honestly would rather just remove the map entirely and use something else
Vanilla disallows duplicate elements in creative mode tabs, throwing a pretty unhelpful error:
The current
BuildCreativeModeTabContentsEvent
mutable entries map does allow duplicate elements due to using default object comparison and hashing. This PR changes the hash strategy used toItemStackLinkedSet#TYPE_AND_TAG
Fixes #1040.