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;
});

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


open fun matchTree(@NotNull predicate: @NotNull Predicate<RenderedBone>): Boolean

Checks if any bone in the flattened hierarchy matches the given predicate.


boolean hasDisplays = pipeline.matchTree(bone -> bone.getDisplay() != null);

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