Skip to content

Conversation

@CosimoTiger
Copy link
Owner

@CosimoTiger CosimoTiger commented Jan 2, 2025

  • initially separate ItemMeta from the ItemStack and store it inside the ItemBuilder instance
  • apply it rarely as an optimization measure because the implemented methods in CraftBukkit seem to be expensive (a bunch of checks, instantiations...), and we're constantly getting and setting new copies of ItemMeta
  • apply it only in cases when:
    • finalizer build() is called
    • with Consumer method is called, which is when the true current state of the ItemStack needs to be seen and a new ItemMeta may be applied

@CosimoTiger CosimoTiger self-assigned this Jan 2, 2025
@CosimoTiger CosimoTiger merged commit 86bf6b2 into main Jan 2, 2025
1 check passed
@CosimoTiger CosimoTiger deleted the feature/optimize-itembuilder branch January 2, 2025 01:57
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