-
-
Notifications
You must be signed in to change notification settings - Fork 40
Registry for custom behaviour with external storage for specific blocks #979
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
base: develop
Are you sure you want to change the base?
Registry for custom behaviour with external storage for specific blocks #979
Conversation
based |
Will let us integrate with QIO and AE2 very easily. |
"is rs2 or ae2 better" we're doing both now keep up |
I'm not sure that this will work properly. The external storage API is designed to just be active for all providers all the time, regardless of block type. We can't be block type dependant. The reason for this is: if we are block type dependant, that means you need to reload the storage if the connected block changes (this currently doesn't happen, by design). If you reload when the connected block changes, this causes 2 problems:
Listening to connected block changes isn't bad per se, but some blocks constantly send block updates. See #886 Regarding possible AE integration: Refined Storage shouldn't have integration with Applied Energistics, there is no use case for it and encourages people to create weird setups for no reason that create problems. |
If we were to merge this, only for QIO integration, |
I have two solutions. I changed the neighbourChanged method to re initialize if the changed block is in the registry. This might cause problems if the special block always sends updates. The other option is we store the block the storage is currently sitting on, and if it changes: if (savedBlock.getLootTable().registry() != newBlock.getLootTable().registry()) {
blockEntity.loadStorage(serverLevel);
} else... then we change the provider. |
I am trying to prevent hardcoded blocks/values so that if there is something else that need a custom provider, it'll be easy to integrate (for example create storage system) |
Yes, but that is less of a problem since we explicitly whitelist these blocks and can check them.
That is bound to cause issues: you have to deal with syncing world state & cache invalidation. |
I do not want to create more instability in a phase of development where we already have so many bugs. |
9fbc450
to
1834b02
Compare
Also, this doesn't have to be an urgent thing, I'm just submitting PRs as I finish working on them for you to review whenever you can. |
1834b02
to
c8b592a
Compare
c8b592a
to
1da3a0e
Compare
Is there a reason for updating external storage provider when an interface/special block is broken as opposed to just update when something is placed |
Implements #976