public static boolean blockVariantMatches ( IBlockState bs , List < Variation > allowedVariants ) { for ( IProperty prop : bs . getProperties ( ) . keySet ( ) ) { if ( prop . getName ( ) . equals ( "variant" ) && prop . getValueClass ( ) . isEnum ( ) ) { Object current = bs . getValue ( prop ) ; if ( current != null ) { for ( Variation var : allowedVariants ) { if ( var . getValue ( ) . equalsIgnoreCase ( current . toString ( ) ) ) return true ; } } } } return false ; }
Test whether this block has a variant attribute which matches the list of allowed variants