Skip to content

Conversation

@ghzdude
Copy link
Contributor

@ghzdude ghzdude commented May 30, 2025

What

Reworks ItemHandlerList to be more like a list. You can now add/remove handlers from the list as you would expect, and there is an immutable version as well. Introduces tests to ensure ItemHandlerList works as expected.

Implementation Details

you can add/remove handlers
set is not supported atm
list implements notifiable and delegates those calls to internal handlers
new tests for list operations
should item handler list be final? along with the immutable class?

Outcome

This wouldn't have any user-facing changes, but it makes ItemHandlerList easier to work with as devs

ghzdude added 6 commits May 28, 2025 18:26
add methods to simplify handler logic
improve handler list adding
improve get
add immutable handler list
improve handler list tests
and pass to inner handlers
@ghzdude ghzdude added the type: refactor Suggestion to refactor a section of code label May 30, 2025
@ghzdude ghzdude changed the title Gh/improve item handler list Rework Item Handler List May 30, 2025
ghzdude added 3 commits May 30, 2025 18:10
don't throw in `getIndexOffset()`
implement indexOf()
implement lastIndexOf()
remove braces
use methods instead of field access
improve immutable tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: refactor Suggestion to refactor a section of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant