Implement blocks filter & refactor regions #1076
Merged
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.
Implements a new filter type, blocks.
They allows for complex structures where you let players freely edit the air blocks (or other blocks) but prevent then from breaking the original blocks. PGM will on match load check all blocks that match the filter, and reuse them later to allow/deny queries against the filter.
In this example, the blocks within the woolroom region that aren't air or cobwebs, are made part of the blocks filter. They will be denied from breaking/replacing those blocks in any way.
The region is required, the filter may be specified as a
filter
attribute or a child filter (as shown in the example). Filter is not required and will default to a not-air filter.Keep in mind there can be performance considerations, with the new filter, avoid making unnecessarily big regions, when possible make smaller regions and join them in an union as pgm will handle them better.
The PR has been tested and works as intended.