'check if block is any liquid (minecraft forge 1.18.1)

I have a function that is being called for every block. And I want that the function returns true when it is a fluid (not only Minecraft fluids aka other mod fluids example: oil)

This is my code:

public boolean shouldDestroy(BlockPos pos) {
    Block block = this.getLevel().getBlockState(pos).getBlock();
    boolean isDestructable = block == Blocks.BEDROCK || block == Blocks.AIR;

    // liquids
    boolean isDrainable = false; // set to true if block is a liquid

    return !isDestructable && isDrainable;
}

I searched, and I didn't found anything that could help me



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source