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

better chestswap then whatever the pr #4572 is #4690

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tympanicblock61
Copy link
Contributor

@tympanicblock61 tympanicblock61 commented Jun 27, 2024

Type of change

  • [x ] Bug fix
  • New feature

Description

the exact same stuff as #4572 just better code

How Has This Been Tested?

me

Checklist:

  • [x ] My code follows the style guidelines of this project.
  • [x ] I have added comments to my code in more complex areas.
  • [x ] I have tested the code in both development and production environments.

if (itemStack.isEmpty()) return 0;

int score = 0;
Object2IntMap<RegistryEntry<Enchantment>> enchantments = new Object2IntOpenHashMap<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this map a private static final field instead to avoid an allocation. The Utils.getEnchantments() method already clears the map.

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