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

Blockstate schema generator improvements #6416

Open
wants to merge 10 commits into
base: minor-next
Choose a base branch
from

Conversation

dktapps
Copy link
Member

@dktapps dktapps commented Aug 9, 2024

Introduction

This PR adds a variety of improvements to the blockstate schema generator tool.
This mostly involves adding some utilities that I had locally for a while, and some minor improvements highlighted by 1.21.20.

Since I'm the only one with enough knowledge to do useful work on this tool, I decided to do this pro bono. Don't get excited, I'm not returning to active development.

  • Widened the criteria by which ID flattening rules are created
  • Allow TAG_Byte and TAG_Int to be flattened (facilitated by flattenedValueRemaps), useful for 1.21.20
  • Add schema testing utility
  • Add schema update/regeneration utility (to allow updating old schemas when improvements are made to the generator)

No backwards-incompatible changes were made, so old schemas will continue to work unchanged. Please see individual commits for specific changes.

Tests

Locally tested with 1.21.20 data supplied by @TwistedAsylumMC. Team members are advised to play with this tool to get familiar with it.

dktapps and others added 6 commits August 5, 2024 22:34
… new ID

this allows more compaction in certain cases, such as tallgrass recently.
instead of blacklisting any mapping which reuses the same flattened infix, we select the flatten property which produces the smallest number of distinct rules, which produces the most compact schema possible.
this change also permits potentially flattening other types of properties such as for corals (live/dead and type), although only one may be selected at a time.
this allows optimisation in upcoming versions.
this issue can be worked around by adding a dummy schema, but it's a bit clunky.
…ting them

this is useful when making changes to the generator, since regenerated schemas can now be tested for validity. This helps to find bugs in the generator.
…s to a newer format

this is useful when the generator was updated with new features & optimisations, to reduce the size and/or improve readability of existing schemas.
@dktapps dktapps added Type: Enhancement Contributes features or other improvements to PocketMine-MP Category: Dev Workflow Changes dev experience working with PocketMine-MP labels Aug 9, 2024
github-actions[bot]
github-actions bot previously approved these changes Aug 19, 2024
github-actions[bot]
github-actions bot previously approved these changes Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Dev Workflow Changes dev experience working with PocketMine-MP Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants