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

WIP Allow overriding offerSingle and removeSingle #3930

Draft
wants to merge 1 commit into
base: api-11
Choose a base branch
from

Conversation

aromaa
Copy link
Member

@aromaa aromaa commented Dec 7, 2023

This is a very rough draft just to show some outlines.

Tries to solve the problem that offerSingle retrieves the whole list, modifies it and then offers it back as a set. This works fine for most things but it gets a bit awkward for potion effects as they can contain attributes which are reset, for example absorption. This causes you to get new set of absorption hearts every time new potion effects are offered. This is also a performance improvement in a sense.

I tried to go the alternative route which was to compare if the same effects are offered but it feels a bit awkward and clumsy.

Some open questions are:

  • Should we expose this in the API instead of doing instanceof checks?
  • The generic mess.
  • Is this worth it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant