Skip to content
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

Various changes to StructureTemplates, 1.20.3 branch. #12

Conversation

solonovamax
Copy link

@solonovamax solonovamax commented Jun 14, 2024

Changed several things to do with StructureTemplates:

  • Add support for structure block keys with a list of items (Fixes Support structure block keys with a list of items #7)
  • Add iterator to structure template
  • Add getters for structure template fields (I personally had a usecase where I wanted to access some of the fields)
  • Support pickblocking the block in the structure preview. (if a structure preview is active and you middle-click on a block, it will place it into your inventory if in creative, or take it from the items you have in your inventory if in survival)
  • Persist structure previews across world reloads (exiting then re-opening world)

… in keys

Allow for arrays of strings in the keys of a structure template.
All the elements are parsed the same as they previously were,
this just allows for defining a list of possible blocks.

Also clean up code a decent amount to make it a tad more maintainable.

Signed-off-by: solonovamax <[email protected]>
- Implement Iterable<Pair<BlockPos, BlockStatePredicate>> for StructureTemplate
- Convert all fields to getters and introduce getters for more fields

Signed-off-by: solonovamax <[email protected]>
Add the ability to pickblock block that are in a structure preview

Note: the pickblock will *only* work on the currently previewed block, and not any compatible block.
eg. if in survival and the position you pickblock allows for either stone or dirt
if the preview is showing stone, and you have dirt in your inventory and pickblock it, then it will not select the dirt.

Signed-off-by: solonovamax <[email protected]>
Signed-off-by: solonovamax <[email protected]>
@solonovamax solonovamax changed the title Add support for structure block keys with a list of items. 1.20.3 branch. Various changes to StructureTemplates, 1.20.3 branch. Jun 25, 2024
@solonovamax
Copy link
Author

Closing. See: #13 (review)

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.

1 participant