package net.minecraft.client.renderer.block.model.multipart;

import java.util.stream.Collector;
import java.util.stream.Collectors;
import com.google.common.collect.Streams;
import java.util.List;
import java.util.function.Predicate;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.StateDefinition;

public class AndCondition implements Condition {
    private final Iterable<? extends Condition> conditions;
    
    public AndCondition(final Iterable<? extends Condition> iterable) {
        this.conditions = iterable;
    }
    
    @Override
    public Predicate<BlockState> getPredicate(final StateDefinition<Block, BlockState> byk) {
        final List<Predicate<BlockState>> list3 = Streams.stream(this.conditions).map(dsd -> dsd.getPredicate(byk)).collect(Collectors.toList());
        return byj -> list3.stream().allMatch(predicate -> predicate.test(byj));
    }
}
