Hi,
I meet some difficulties to found all block/blockstate affected by gravity.
Using GravityAffected property return me a false value even using BlockType or BlockState.
BlockTypes :
final Collection<BlockType> blocks = Sponge.getRegistry().getAllOf(BlockType.class);
blocks.parallelStream().filter(block -> {
final Optional<GravityAffectedProperty> optProp = block.getProperty(GravityAffectedProperty.class);
return optProp.isPresent() && optProp.get().getValue().booleanValue();
})
BlockStates :
blocks.parallelStream().map(blockType -> blockType.getAllBlockStates()).flatMap(l -> l.stream()).filter(blockState -> {
final Optional<GravityAffectedProperty> optProp = blockState.getProperty(GravityAffectedProperty.class);
return optProp.isPresent() && optProp.get().getValue().booleanValue();
}).collect(Collectors.toList());
Returns me an empty list. I use intelliJ inspector, and indeed, that property is false, even for sand.
Do you have any clue of how could I proceed ?
In Forge, I think I did an instanceof FallingBlock test on BlockType