private static bool IsCellOpenForSowingPlantOfType(IntVec3 cell, Map map, ThingDef plantDef) { IPlantToGrowSettable playerSetPlantForCell = GetPlayerSetPlantForCell(cell, map); if (playerSetPlantForCell == null || !playerSetPlantForCell.CanAcceptSowNow()) { return(false); } ThingDef plantDefToGrow = playerSetPlantForCell.GetPlantDefToGrow(); if (plantDefToGrow == null || plantDefToGrow != plantDef) { return(false); } if (GridsUtility.GetPlant(cell, map) != null) { return(false); } if (GenPlant.AdjacentSowBlocker(plantDefToGrow, cell, map) != null) { return(false); } foreach (Thing current in map.thingGrid.ThingsListAt(cell)) { if (current.def.BlockPlanting) { return(false); } } return(GenPlant.CanEverPlantAt(plantDefToGrow, cell, map) && GenPlant.GrowthSeasonNow(cell, map)); }