Enable BlockStatePredicate list sizes of 1 #935
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.
Description
This fixes an issue with calling
BlockStatePredicate.wrap
with a list of size 1.Example Script
With existing implementation,
b1
is an empty list, whileb2
is notI removed the check for list size > 1 completely, rather than change it to list size > 0, as there should never be a case where list size is < 0, and the empty case is handled in the other branch.
Let me know if you would prefer there to be an explicit check for size > 0 and I can update the PR
Other details