Skip to content

Conversation

@ghzdude
Copy link
Contributor

@ghzdude ghzdude commented Nov 24, 2025

Call setSyncHandler() during initialiseSyncHandler() so that overriding classes can set their own instance of their sync handler. (as noted in javadoc)
make isValidSyncHandler() just be instanceof checks for ItemSlots and PhantomItemSlots
check if SH is not null before isValid check in ModularPanel
also fixes issues when using PhantomItemSlots in DynamicSyncedWidgets

also did a bit of refactoring
add a bit of javadoc
@brachy84
Copy link
Member

Should this be done for every widget using sync handlers?

@ghzdude
Copy link
Contributor Author

ghzdude commented Nov 26, 2025

what do you mean exactly? are there any widgets that implement ISynced but don't extend Widget<?>?
or are you talking about making other isValidSyncHandler() into simple instanceof checks?

@brachy84
Copy link
Member

or are you talking about making other isValidSyncHandler() into simple instanceof checks?

yes

make sure the sync handlers are set correctly
improve the setValue javadoc a bit
also check if it's a valid synchandler
@ghzdude
Copy link
Contributor Author

ghzdude commented Nov 26, 2025

i would say it's a good idea, as it shows how someone should implement this method.

@brachy84 brachy84 merged commit b3fa473 into CleanroomMC:master Nov 27, 2025
brachy84 added a commit that referenced this pull request Nov 27, 2025
brachy84 pushed a commit to brachy84/ModularUI2-GTNH that referenced this pull request Nov 27, 2025
…roomMC#176)

* it works now
also did a bit of refactoring
add a bit of javadoc

* refactor the other classes' `isValidSyncHandler()`
make sure the sync handlers are set correctly
improve the setValue javadoc a bit
also check if it's a valid synchandler

(cherry picked from commit b3fa473)
brachy84 added a commit to brachy84/ModularUI2-GTNH that referenced this pull request Nov 27, 2025
(cherry picked from commit 34dd086)
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