Cleanup filter & region parsing & validation #1053
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.
Originally started to fix the /modes list command, ended up fixing way too many more things. This includes a more proper fix for the quick-and-dirty if-check added in #1050.
Monument Mode fixes:
/mode list
command sorting was still broken (initially tackled in Fix mode commands with filtered modes #1048, still broken in some conditions)Filter/region validation/parsing fixes:
parseProperty
methods available in bothRegionParser
andFilterParser
, with overloads for defaults, required, and validations.String... names
from region parsing, most of the times a single name is used, in the few places where multiple names are allowed they were replaced with calls that useNode.fromChildOrAttr(el, name1, name2)
or similar.Filterable
, which is essentially a guarantee that you'll break something. Filters need a scope to filter, they can't just filter "anything". If you're fine with "anything" simply useFilterables.scope(filter)
to find what the least-specific context the filter supports listening for.Note: No PGM behavior should have changed at all. No XML changes, no run-time changes. Only more strict validation for invalid usages of dynamic filters (eg: trying to use a non-dynamic filter in a place that requires a dynamic).
Note: This has been tested with main OCC map repositories, public and private, and has not caused any new map xml error within them except for the ones i manually introduced for testing, meaning this should already be in a stable state.