Fixed structure tasks #263
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Basically, this commit just fixes structure tasks to actually be usable and just good on client and server.
More specifically it fixes #202
Autocomplete is there and it's alphabetized, it works in single-player and uses the actual registry in single-player, or in multiplayer it provides a cached registry of all the structures to the client, because if that's not done The client simply doesn't have access to the registry for the structures, This also accounts for situations where the server has data packs or mods installed for structure generation that were not required on the client, so aren't on there. This is especially useful for making quests on live multiplayer servers.
One other notable change that I made was bumping resourceful lib
I would really appreciate any feedback you have on the commit, and if there's any changes I can make, I'm definitely willing to. I just don't have much spare time, so I don't want to commit another five hours or something.
I've included an AI summary to this commit, and I want to be transparent that AI was used to assist me to make these changes. I wouldn't typically publicly publish this kind of AI work, but I thought it might be of actual value since it works so well for me.
I am going to leave edits open to maintainers in case you guys want to just quickly make changes without checking with me, I don't mind. And I want to be transparent that I didn't test this on Forge, However, the changes I made shouldn't be platform-dependent. I did test it with Fabric Client and Server and Fabric Singleplayer.
=============================================================================
This pull request introduces a new string-based approach for handling structure-related settings and tasks, improving flexibility and fallback mechanisms when registry data is unavailable. Key changes include the addition of a new
StructureStringSettingclass, updates to accommodate bothRegistryValueand string-based structures, and a client-side caching mechanism for structure data.Structure handling improvements:
StructureStringSettingclass: Introduced to handle structure input as plain strings with autocomplete functionality, supporting both registry-based and cached data.RegistryValueSettingto use cached structure data fromClientStructureDisplayswhen registry data is unavailable. This ensures better resilience.Task-related updates:
StructureTask: Added support for a newstructureStringfield in addition to the existingstructuresfield, allowing tasks to work with both registry-based and string-based structures.TaskTitleFormattersto generate display names for string-based structures, ensuring compatibility with the new approach.Client-side caching:
ClientStructureDisplaysclass: Implemented to cache structure and structure tag data on the client, enabling fallback mechanisms when registry access is unavailable.ClientboundStructureDisplayPacket, to synchronize structure data between the server and client.These changes collectively enhance the flexibility and robustness of structure handling in the system, while maintaining backward compatibility.