matchTree
open fun matchTree(@NotNull predicate: @NotNull BonePredicate, @NotNull mapper: @NotNull BiPredicate<RenderedBone, BonePredicate>): Boolean
Applies a matching predicate function to bones matching the given bone predicate.
boolean matched = pipeline.matchTree(BonePredicate.name("head"), (bone, pred) -> {
return true;
});
Content copied to clipboard
Return
true if any matching bone satisfied the mapper, false otherwise
Since
1.15.2
Parameters
predicate
the bone predicate to filter bones
mapper
the evaluation function applied to matching bones
Throws
if predicate or mapper is null
Checks if any bone in the flattened hierarchy matches the given predicate.
boolean hasDisplays = pipeline.matchTree(bone -> bone.getDisplay() != null);
Content copied to clipboard
Return
true if at least one bone matched the predicate, false otherwise
Since
1.15.2
Parameters
predicate
the predicate to test each rendered bone
Throws
if predicate is null