Could it be possible to add a filter that will detect the first block
the BlockRay hit. The filter should detect if it hit the torch, snow
layer, slab, etc or if it hit the air of the block(Example: Around the
torch).
Player player = event.getCause().first(Player.class).get();
BlockRay optHit = BlockRay.from(player).filter(BlockRay.allFilter()).build();
BlockState state = null;
while(optHit.hasNext() && state == null){
BlockRayHit ray = optHit.next();
Vector3d lookPos = ray.getBlockPosition().toDouble();
BlockState blockState = player.getWorld().getBlock(lookPos.toInt());
state = !blockState.getType().equals(BlockTypes.AIR)?blockState:null;
}
System.out.println(state.getType());
https:https://forums-cdn.spongepowered.org/uploads/default/optimized/2X/2/2b995d83348c1d3736ad693f07b4abe4644fcda5_1_690x412.jpg