package net.minecraft.world.level.block.state.predicate;

import javax.annotation.Nullable;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import java.util.function.Predicate;

public class BlockPredicate implements Predicate<BlockState> {
    private final Block block;
    
    public BlockPredicate(final Block bvr) {
        this.block = bvr;
    }
    
    public static BlockPredicate forBlock(final Block bvr) {
        return new BlockPredicate(bvr);
    }
    
    @Override
    public boolean test(@Nullable final BlockState cfj) {
        return cfj != null && cfj.is(this.block);
    }
}
