Jump to content
×
×
  • Create New...

Components.stream(parent, child) is broken


Recommended Posts

Components.stream(parent, child) isn't returning any components at the moment. 

 

I made an alternative method that works as expected:

 

public static Component getFirst(int parent, int child, Predicate<Component> pred) {
    Component childComp = Components.stream(parent).filter(comp -> comp.index() == child).first();
    if (!childComp.valid()) {
        return Components.nil();
    }
    for (Component grandchild : childComp.components()) {
        if (pred.test(grandchild)) {
            return grandchild;
        }
    }
    return Components.nil();
    // return Components.stream(parent, child).filter(pred).first(); // Not working...
}
Link to post
Share on other sites

 Share