Skip to content

Conversation

@Dalethium
Copy link

@Dalethium Dalethium commented Jul 27, 2025

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 StructureStringSetting class, updates to accommodate both RegistryValue and string-based structures, and a client-side caching mechanism for structure data.

Structure handling improvements:

  • New StructureStringSetting class: Introduced to handle structure input as plain strings with autocomplete functionality, supporting both registry-based and cached data.
  • Fallback for missing registry data: Updated RegistryValueSetting to use cached structure data from ClientStructureDisplays when registry data is unavailable. This ensures better resilience.

Task-related updates:

  • Enhancements to StructureTask: Added support for a new structureString field in addition to the existing structures field, allowing tasks to work with both registry-based and string-based structures.
  • Improved task title formatting: Updated TaskTitleFormatters to generate display names for string-based structures, ensuring compatibility with the new approach.

Client-side caching:

  • New ClientStructureDisplays class: Implemented to cache structure and structure tag data on the client, enabling fallback mechanisms when registry access is unavailable.
  • Network integration: Registered a new packet, 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.

@CLAassistant
Copy link

CLAassistant commented Jul 27, 2025

CLA assistant check
All committers have signed the CLA.

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.

[Bug]: Crash when creating a Structure task

2 participants