BlockState.StateMatcher doesn't check if the traits for the StateMatcher is empty. Found this while writing a config serializer and deserializer for StateMatcher.
The fix should be trivial.
https://github.com/SpongePowered/SpongeAPI/blob/a4aaeec0007ebd9c3570e41382454e81f875e0a1/src/main/java/org/spongepowered/api/block/BlockState.java#L289
For me it looks like the actual problem is that it is creating the array with one element less than required, it should just create the array using this.traits.size().
Guess I looked too long at it :P. Would it also be an idea to expose the inner fields in the matcher to allow for easier serialization (have to use reflection at the moment)?
You can open an issue about that. If anything, we could consider making it DataSerializable since that is how we expose serialization.
Most helpful comment
You can open an issue about that. If anything, we could consider making it
DataSerializablesince that is how we expose serialization.