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 bph) {
        this.block = bph;
    }
    
    public static BlockPredicate forBlock(final Block bph) {
        return new BlockPredicate(bph);
    }
    
    @Override
    public boolean test(@Nullable final BlockState byj) {
        return byj != null && byj.getBlock() == this.block;
    }
}
