Added a check for null BlockStates in the HiddenSwitch mechanic